Add new SHAxxx hash algorithms to tables of SECHashObjects.
authornelsonb%netscape.com
Tue, 19 Jun 2012 05:46:52 +0000
changeset 10383 b62364782ee549729fba70bd166f84b57233a3a4
parent 10382 769bfbf2f6352712b6794cdd145aeed6dc9b449d
child 10384 fc8284028d66352fea3efe398618020d925cfc18
push idunknown
push userunknown
push dateunknown
Add new SHAxxx hash algorithms to tables of SECHashObjects.
security/nss/lib/util/hasht.h
--- a/security/nss/lib/util/hasht.h
+++ b/security/nss/lib/util/hasht.h
@@ -42,29 +42,36 @@
 typedef struct SECHashObjectStr SECHashObject;
 typedef struct HASHContextStr HASHContext;
 
 /*
  * The hash functions the security library supports
  * NOTE the order must match the definition of SECHashObjects[]!
  */
 typedef enum {
-    HASH_AlgNULL = 0,
-    HASH_AlgMD2 = 1,
-    HASH_AlgMD5 = 2,
-    HASH_AlgSHA1 = 3,
+    HASH_AlgNULL   = 0,
+    HASH_AlgMD2    = 1,
+    HASH_AlgMD5    = 2,
+    HASH_AlgSHA1   = 3,
+    HASH_AlgSHA256 = 4,
+    HASH_AlgSHA384 = 5,
+    HASH_AlgSHA512 = 6,
     HASH_AlgTOTAL
 } HASH_HashType;
 
 /*
  * Number of bytes each hash algorithm produces
  */
 #define MD2_LENGTH	16
 #define MD5_LENGTH	16
 #define SHA1_LENGTH	20
+#define SHA256_LENGTH 	32
+#define SHA384_LENGTH 	48
+#define SHA512_LENGTH 	64
+#define HASH_LENGTH_MAX SHA512_LENGTH
 
 /*
  * Structure to hold hash computation info and routines
  */
 struct SECHashObjectStr {
     unsigned int length;
     void * (*create)(void);
     void * (*clone)(void *);