diff src/headers/tomcrypt_hash.h @ 380:d5faf4814ddb libtomcrypt-orig libtomcrypt-1.16

Update to LibTomCrypt 1.16
author Matt Johnston <matt@ucc.asn.au>
date Thu, 11 Jan 2007 02:22:00 +0000
parents 59400faa4b44
children
line wrap: on
line diff
--- a/src/headers/tomcrypt_hash.h	Wed Mar 08 12:58:00 2006 +0000
+++ b/src/headers/tomcrypt_hash.h	Thu Jan 11 02:22:00 2007 +0000
@@ -70,6 +70,22 @@
 };
 #endif
 
+#ifdef RIPEMD256
+struct rmd256_state {
+    ulong64 length;
+    unsigned char buf[64];
+    ulong32 curlen, state[8];
+};
+#endif
+
+#ifdef RIPEMD320
+struct rmd320_state {
+    ulong64 length;
+    unsigned char buf[64];
+    ulong32 curlen, state[10];
+};
+#endif
+
 #ifdef WHIRLPOOL
 struct whirlpool_state {
     ulong64 length, state[8];
@@ -87,6 +103,7 @@
 #endif
 
 typedef union Hash_state {
+    char dummy[1];
 #ifdef CHC_HASH
     struct chc_state chc;
 #endif
@@ -120,9 +137,16 @@
 #ifdef RIPEMD160
     struct rmd160_state rmd160;
 #endif
+#ifdef RIPEMD256
+    struct rmd256_state rmd256;
+#endif
+#ifdef RIPEMD320
+    struct rmd320_state rmd320;
+#endif
     void *data;
 } hash_state;
 
+/** hash descriptor */
 extern  struct ltc_hash_descriptor {
     /** name of hash */
     char *name;
@@ -159,6 +183,12 @@
       @return CRYPT_OK if successful, CRYPT_NOP if self-tests have been disabled
     */
     int (*test)(void);
+
+    /* accelerated hmac callback: if you need to-do multiple packets just use the generic hmac_memory and provide a hash callback */
+    int  (*hmac_block)(const unsigned char *key, unsigned long  keylen,
+                       const unsigned char *in,  unsigned long  inlen, 
+                             unsigned char *out, unsigned long *outlen);
+
 } hash_descriptor[];
 
 #ifdef CHC_HASH
@@ -272,14 +302,32 @@
 extern const struct ltc_hash_descriptor rmd160_desc;
 #endif
 
+#ifdef RIPEMD256
+int rmd256_init(hash_state * md);
+int rmd256_process(hash_state * md, const unsigned char *in, unsigned long inlen);
+int rmd256_done(hash_state * md, unsigned char *hash);
+int rmd256_test(void);
+extern const struct ltc_hash_descriptor rmd256_desc;
+#endif
+
+#ifdef RIPEMD320
+int rmd320_init(hash_state * md);
+int rmd320_process(hash_state * md, const unsigned char *in, unsigned long inlen);
+int rmd320_done(hash_state * md, unsigned char *hash);
+int rmd320_test(void);
+extern const struct ltc_hash_descriptor rmd320_desc;
+#endif
+
+
 int find_hash(const char *name);
 int find_hash_id(unsigned char ID);
+int find_hash_oid(const unsigned long *ID, unsigned long IDlen);
 int find_hash_any(const char *name, int digestlen);
 int register_hash(const struct ltc_hash_descriptor *hash);
 int unregister_hash(const struct ltc_hash_descriptor *hash);
 int hash_is_valid(int idx);
 
-LTC_MUTEX_PROTO(ltc_hash_mutex);
+LTC_MUTEX_PROTO(ltc_hash_mutex)
 
 int hash_memory(int hash, 
                 const unsigned char *in,  unsigned long inlen, 
@@ -327,5 +375,5 @@
 }
 
 /* $Source: /cvs/libtom/libtomcrypt/src/headers/tomcrypt_hash.h,v $ */
-/* $Revision: 1.12 $ */
-/* $Date: 2005/06/19 18:00:28 $ */
+/* $Revision: 1.19 $ */
+/* $Date: 2006/11/05 01:36:43 $ */