sphlib
|
00001 /* $Id: sph_cubehash.h 180 2010-05-08 02:29:25Z tp $ */ 00037 #ifndef SPH_CUBEHASH_H__ 00038 #define SPH_CUBEHASH_H__ 00039 00040 #include <stddef.h> 00041 #include "sph_types.h" 00042 00046 #define SPH_SIZE_cubehash224 224 00047 00051 #define SPH_SIZE_cubehash256 256 00052 00056 #define SPH_SIZE_cubehash384 384 00057 00061 #define SPH_SIZE_cubehash512 512 00062 00073 typedef struct { 00074 #ifndef DOXYGEN_IGNORE 00075 unsigned char buf[32]; /* first field, for alignment */ 00076 size_t ptr; 00077 sph_u32 state[32]; 00078 #endif 00079 } sph_cubehash_context; 00080 00084 typedef sph_cubehash_context sph_cubehash224_context; 00085 00089 typedef sph_cubehash_context sph_cubehash256_context; 00090 00094 typedef sph_cubehash_context sph_cubehash384_context; 00095 00099 typedef sph_cubehash_context sph_cubehash512_context; 00100 00108 void sph_cubehash224_init(void *cc); 00109 00118 void sph_cubehash224(void *cc, const void *data, size_t len); 00119 00129 void sph_cubehash224_close(void *cc, void *dst); 00130 00144 void sph_cubehash224_addbits_and_close( 00145 void *cc, unsigned ub, unsigned n, void *dst); 00146 00154 void sph_cubehash256_init(void *cc); 00155 00164 void sph_cubehash256(void *cc, const void *data, size_t len); 00165 00175 void sph_cubehash256_close(void *cc, void *dst); 00176 00190 void sph_cubehash256_addbits_and_close( 00191 void *cc, unsigned ub, unsigned n, void *dst); 00192 00200 void sph_cubehash384_init(void *cc); 00201 00210 void sph_cubehash384(void *cc, const void *data, size_t len); 00211 00221 void sph_cubehash384_close(void *cc, void *dst); 00222 00236 void sph_cubehash384_addbits_and_close( 00237 void *cc, unsigned ub, unsigned n, void *dst); 00238 00246 void sph_cubehash512_init(void *cc); 00247 00256 void sph_cubehash512(void *cc, const void *data, size_t len); 00257 00267 void sph_cubehash512_close(void *cc, void *dst); 00268 00282 void sph_cubehash512_addbits_and_close( 00283 void *cc, unsigned ub, unsigned n, void *dst); 00284 00285 #endif