Rebuild OID database: duplicates got in there somehow??
[oweals/openssl.git] / crypto / md32_common.h
index e3ec1a72d63274d18cb4bfbb0fec8be0450a2997..089c4502905c68d78a5b267bc93a2e124b5a2b73 100644 (file)
@@ -1,6 +1,6 @@
 /* crypto/md32_common.h */
 /* ====================================================================
- * Copyright (c) 1999-2006 The OpenSSL Project.  All rights reserved.
+ * Copyright (c) 1999-2007 The OpenSSL Project.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -64,7 +64,8 @@
  * HASH_CBLOCK
  *     size of a unit chunk HASH_BLOCK operates on.
  * HASH_LONG
- *     has to be at lest 32 bit wide.
+ *     has to be at lest 32 bit wide, if it's wider, then
+ *     HASH_LONG_LOG2 *has to* be defined along
  * HASH_CTX
  *     context structure that at least contains following
  *     members:
@@ -72,8 +73,8 @@
  *                     ...
  *                     HASH_LONG       Nl,Nh;
  *                     either {
- *                       HASH_LONG     data[HASH_LBLOCK];
- *                       unsigned char data[HASH_CBLOCK];
+ *                     HASH_LONG       data[HASH_LBLOCK];
+ *                     unsigned char   data[HASH_CBLOCK];
  *                     };
  *                     unsigned int    num;
  *                     ...
@@ -97,6 +98,7 @@
  *     #define DATA_ORDER_IS_LITTLE_ENDIAN
  *
  *     #define HASH_LONG               MD5_LONG
+ *     #define HASH_LONG_LOG2          MD5_LONG_LOG2
  *     #define HASH_CTX                MD5_CTX
  *     #define HASH_CBLOCK             MD5_CBLOCK
  *     #define HASH_UPDATE             MD5_Update
@@ -352,9 +354,11 @@ int HASH_FINAL (unsigned char *md, HASH_CTX *c)
 
        if (n > (HASH_CBLOCK-8))
                {
+               memset (p+n,0,HASH_CBLOCK-n);
+               n=0;
                HASH_BLOCK_DATA_ORDER (c,p,1);
-               memset (p,0,HASH_CBLOCK);
                }
+       memset (p+n,0,HASH_CBLOCK-8-n);
 
        p += HASH_CBLOCK-8;
 #if   defined(DATA_ORDER_IS_BIG_ENDIAN)