[BACK]Return to sha1.c CVS log [TXT][DIR] Up to [local] / OpenXM / src / ox_ntl / crypt / sha1

Diff for /OpenXM/src/ox_ntl/crypt/sha1/sha1.c between version 1.5 and 1.6

version 1.5, 2004/07/04 02:31:51 version 1.6, 2004/07/22 12:12:05
Line 1 
Line 1 
 /* $OpenXM: OpenXM/src/ox_ntl/crypt/sha1/sha1.c,v 1.4 2004/06/20 10:59:01 iwane Exp $ */  /* $OpenXM: OpenXM/src/ox_ntl/crypt/sha1/sha1.c,v 1.5 2004/07/04 02:31:51 iwane Exp $ */
 /* RFC 3174 - SHA-1 (US Secure Hash Algorithm 1 (SHA1))*/  /* RFC 3174 - SHA-1 (US Secure Hash Algorithm 1 (SHA1))*/
   
 #include <stdio.h>  #include <stdio.h>
Line 158  sha1_h(unsigned char *Ph, const unsigned char *msg, si
Line 158  sha1_h(unsigned char *Ph, const unsigned char *msg, si
         }          }
   
         memset(Ph, 0x00, sizeof(H));          memset(Ph, 0x00, sizeof(H));
         for (i = 0; i < sizeof(H) / sizeof(H[0]); i++) {          for (i = 0; i < (int)(sizeof(H) / sizeof(H[0])); i++) {
                 for (j = 0; j < 32; j++) {                  for (j = 0; j < 32; j++) {
                         Ph[4 * i + j / 8] |= ((h[i] >> (31 - j)) & 1) << (7 - j % 8);                          Ph[4 * i + j / 8] |= ((h[i] >> (31 - j)) & 1) << (7 - j % 8);
                 }                  }
Line 229  _PADDING:
Line 229  _PADDING:
   
   
         memset(Ph, 0x00, sizeof(H));          memset(Ph, 0x00, sizeof(H));
         for (i = 0; i < sizeof(H) / sizeof(H[0]); i++) {          for (i = 0; i < (int)(sizeof(H) / sizeof(H[0])); i++) {
                 for (j = 0; j < 32; j++) {                  for (j = 0; j < 32; j++) {
                         Ph[4 * i + j / 8] |= ((h[i] >> (31 - j)) & 1) << (7 - j % 8);                          Ph[4 * i + j / 8] |= ((h[i] >> (31 - j)) & 1) << (7 - j % 8);
                 }                  }

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>