What is Pancham?

What is MD5?

Pancham pin description

Pancham timing diagram

Download and usage information

Bug reporting

Pancham is Everywhere!


Donation Request


Support This Project


An MD5 compliant IP core

1. What is Pancham?

Pancham is a IP core that implements the MD5 message digest algorithm. The word Pancham, in Sanskrit, means the 5th.

Here are some of the features of Pancham:

  • Upto 128-bit input message.
  • Parameterized 'salts' that default to the MD5-prescribed values.
  • MD5 compliant a 128-bit output.
  • Verilog entry.
  • Very minimal amount of control signals (3).
  • Synchronous logic.

2. What is MD5?

MD5 is a secure hash algorithm in cryptography that produces a 128-bit message digest from an input message of any length. MD5 was first proposed by R. Rivest. It has been used widely for various applications, notably for numerous internet related secured applications. Since its proposal in 1992, there are some other minor variations of MD5 that improve on its performance. However, the original proposal remains highly popular and is still in use even after a decade.

3. Pancham pin description

Here are the pin description of Pancham.
Input Pin Name
clk Input clock.
reset Active high chip reset.
msg_in[0:127] Upto 128-bit wide input message.
msg_in_width[0:7] Actual width of the input message.
msg_in_valid Input message strobe; active high.

Output Pin Name
msg_out[0:127] Output message digest, always 128-bit wide.
msg_out_valid Strobe that indicates msg_out is valid; active high.
ready Core is ready again to receive another input; active high.

4. Pancham timing diagram

The timing diagram for the input and output signals is given in Figure 1 here.

The number of clocks the core takes to generate msg_out_valid after msg_in_valid is asserted is unspecified and may change in future versions of this core.

5. Download and usage information

5.1 Distribution

Pancham is distributed as an open source IP core under Lesser GNU Public License (LGPL).

5.2 Download source

You can download Pancham source from here. Support This Project Downloading is always free, but your donation is always appreciated.

5.3 Language

The core and the testbench are written in Verilog.

5.4 Directory structure of the downloaded tree

Once gunzipped and un-tarred, the downloaded source will create a directory named pancham. It will also create the following subdirectories under pancham.
  1. doc: home of this html file.
  2. dv: testbench directory.
  3. design: main Verilog source directory.

5.5 Parameterized 'salt' values

MD5 algorithm uses a set of 4 'salt' values (sometimes also referred to as 'magic numbers') to initialize its internal data structure. These salts are 32-bit quantities and are unrelated to how the main algorithm works. For better security, one may want to change these values by one's own.

This can be achieved by setting the Verilog parameters SALT1, SALT2, SALT3 and SALT4 inside the module pancham. This can be done by either editing the file design/pancham.v or using the Verilog command defparam from somewhere else (you may also want to check the specification of your synthesizer tool to see if it supports defparam as a synthesizable syntax). The default values of these salts are same as what the original MD5 algorithm suggested.

6. Bug reporting

Although some moderate amount of testing has been done, user testing is always welcome. If you find a problem, please file a bug here .

7. Pancham is Everywhere!

Since its first introduction to the world on 6th May, 2003, Pancham has been downloaded more than 3600 times (as of Oct 2014) from its original home at SourceForge.net. This is a success for any hardware IP. No wonder Pancham has been offered as a featured download from numerous other download sites, from where it has been downloaded many more times.

Here are few other news on Pancham over the years:

8. Author

Pancham is written by Swapnajit Mitra, Principal, Project VeriPage. Project VeriPage, the leading website for providing Verilog PLI related information, also provides design services and logic IPs including Camellia , the cryptographic primitive recommended by New European Schemes for Signatures, Integrity and Encryption (NESSIE). Contact Project VeriPage for business enquiries.

9. Donation Request

Pancham is and will remain as a free open-source core for MD5 application. It is available to students who are learning designing with Verilog, to people who are learning Message Digest algorithms, or to people, who simply want to use it in their application or core.

However, in order for us to maintain this core, to bring up new cores like this and to keep the open source revolution moving, we urge you to send us a small donation. We suggest US $20 (or equivalent, in other currencies), but the final decision is yours. All donations that you make will directly go into the development of this or similar cores.

So, show your support by clicking the button below. Thanks for your patronage.

Support This Project

10. Acknowledgement

  • My biggest thank goes to my wife for being as supportive and cooperative as she always is.
  • I also want to thank Icarus Verilog, an open source Verilog simulator. Pancham has been designed exclusively using this simulator (and no commercial one).
  • Last, but not the least, whoever asked the question in comp.lang.verilog looking for a free MD5 core.
    SourceForge.net Logo