summaryrefslogtreecommitdiffhomepage
path: root/src/headers/tomcrypt_hash.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/headers/tomcrypt_hash.h')
-rw-r--r--src/headers/tomcrypt_hash.h54
1 files changed, 51 insertions, 3 deletions
diff --git a/src/headers/tomcrypt_hash.h b/src/headers/tomcrypt_hash.h
index a0534f9..d9916ac 100644
--- a/src/headers/tomcrypt_hash.h
+++ b/src/headers/tomcrypt_hash.h
@@ -70,6 +70,22 @@ struct rmd160_state {
};
#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 @@ struct chc_state {
#endif
typedef union Hash_state {
+ char dummy[1];
#ifdef CHC_HASH
struct chc_state chc;
#endif
@@ -120,9 +137,16 @@ typedef union Hash_state {
#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 @@ extern struct ltc_hash_descriptor {
@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 @@ int rmd160_test(void);
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 @@ int func_name (hash_state * md, const unsigned char *in, unsigned long inlen)
}
/* $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 $ */