<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>DES, MD5 and SHA1 code size</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/36553/des-md5-and-sha1-code-size</link><description> Hello, 
 
we made a straight forward port of the DES, MD5 and SHA1 algorithms from OpenSSL library ( http://www.openssl.org ) without optimizing the source code. 
The following code size is indicated in the .map when compiling using the default compiler</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: DES, MD5 and SHA1 code size</title><link>https://community.arm.com/thread/72123?ContentTypeID=1</link><pubDate>Tue, 09 Dec 2003 03:54:33 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:cdc8100f-1c05-4808-8632-110a0b90623e</guid><dc:creator>Graham Cole</dc:creator><description>&lt;p&gt;You can find a compact version of DES here:&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.bds.dogma.net/des_page.htm" target="_blank"&gt;http://www.bds.dogma.net/des_page.htm&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
In general, it should be possible to implement DES quite efficiently on an 8-bit processor.&lt;br /&gt;
&lt;br /&gt;
If you are interested in my version of MD5, please e-mail g r a h a m . c o l e @ b t . c o m&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DES, MD5 and SHA1 code size</title><link>https://community.arm.com/thread/41364?ContentTypeID=1</link><pubDate>Mon, 08 Dec 2003 13:20:09 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:0bc02f80-8bca-4ab4-8ecf-469cc6190edd</guid><dc:creator>Drew Davis</dc:creator><description>&lt;p&gt;You can do MD5 for the 8051 in under 2k of code + constants.  Graham Cole has some even tighter code.  I imagine the 166 should be even better.&lt;br /&gt;
&lt;br /&gt;
I had much the same problem when I started looking at MD5.  I grabbed some code from the net, and it was about 20k.  It was &amp;quot;workstation C&amp;quot;; I&amp;#39;m sure the author thought a mere 20k was a perfectly adequate job.  So I wound up rewriting the whole thing.  A 10:1 reduction is not impossible.&lt;br /&gt;
&lt;br /&gt;
The major change needed for reducing the size was replacing all the macros (no doubt &amp;quot;for speed&amp;quot;) with function calls, and making the parameters table-driven rather than inline.  Also look out for assumptions that &amp;quot;int&amp;quot; is 32 bits, and that 32 bits is a good size for doing all your operations.&lt;br /&gt;
&lt;br /&gt;
In my case, I also saved a smidgen of code as I knew that my use of MD5 could not be reentrant, so I didn&amp;#39;t need to pass a state parameter to allow multiple simultaneous calculations.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>