LTKCPP-- LLRP Toolkit C Plus Plus Library
|
00001 #ifndef HEADER_WHRLPOOL_H 00002 # define HEADER_WHRLPOOL_H 00003 00004 # include <openssl/e_os2.h> 00005 # include <stddef.h> 00006 00007 #ifdef __cplusplus 00008 extern "C" { 00009 #endif 00010 00011 # define WHIRLPOOL_DIGEST_LENGTH (512/8) 00012 # define WHIRLPOOL_BBLOCK 512 00013 # define WHIRLPOOL_COUNTER (256/8) 00014 00015 typedef struct { 00016 union { 00017 unsigned char c[WHIRLPOOL_DIGEST_LENGTH]; 00018 /* double q is here to ensure 64-bit alignment */ 00019 double q[WHIRLPOOL_DIGEST_LENGTH / sizeof(double)]; 00020 } H; 00021 unsigned char data[WHIRLPOOL_BBLOCK / 8]; 00022 unsigned int bitoff; 00023 size_t bitlen[WHIRLPOOL_COUNTER / sizeof(size_t)]; 00024 } WHIRLPOOL_CTX; 00025 00026 # ifndef OPENSSL_NO_WHIRLPOOL 00027 # ifdef OPENSSL_FIPS 00028 int private_WHIRLPOOL_Init(WHIRLPOOL_CTX *c); 00029 # endif 00030 int WHIRLPOOL_Init(WHIRLPOOL_CTX *c); 00031 int WHIRLPOOL_Update(WHIRLPOOL_CTX *c, const void *inp, size_t bytes); 00032 void WHIRLPOOL_BitUpdate(WHIRLPOOL_CTX *c, const void *inp, size_t bits); 00033 int WHIRLPOOL_Final(unsigned char *md, WHIRLPOOL_CTX *c); 00034 unsigned char *WHIRLPOOL(const void *inp, size_t bytes, unsigned char *md); 00035 # endif 00036 00037 #ifdef __cplusplus 00038 } 00039 #endif 00040 00041 #endif