CVS: crypto/src SHA256.c,1.3,1.4

"A.M. Kuchling" <[email protected]> Tue, 29 Nov 2005 08:31:39 -0800
Newsgroups gmane.comp.python.cryptography.cvs
Message-ID <[email protected]>
Update of /cvsroot/pycrypto/crypto/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21439/src

Modified Files:
	SHA256.c 
Log Message:
Fix SHA256 padding bug

Index: SHA256.c
===================================================================
RCS file: /cvsroot/pycrypto/crypto/src/SHA256.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- SHA256.c	10 Jun 2005 19:22:55 -0000	1.3
+++ SHA256.c	29 Nov 2005 16:31:36 -0000	1.4
@@ -136,11 +136,11 @@
     /* append the '1' bit */
     md->buf[md->curlen++] = 0x80;
 
-    /* if the length is currenlly above 56 bytes we append zeros
+    /* if the length is currently above 56 bytes we append zeros
                                * then compress.  Then we can fall back to padding zeros and length
                                * encoding like normal.
                              */
-    if (md->curlen >= 56) {
+    if (md->curlen > 56) {
         for (; md->curlen < 64;)
             md->buf[md->curlen++] = 0;
         sha_compress(md);



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click