From: A.M. K. <aku...@us...> - 2005-11-29 16:31:58
|
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); |