sphlib

sph_groestl.h

Go to the documentation of this file.
00001 /* $Id: sph_groestl.h 216 2010-06-08 09:46:57Z tp $ */
00035 #ifndef SPH_GROESTL_H__
00036 #define SPH_GROESTL_H__
00037 
00038 #include <stddef.h>
00039 #include "sph_types.h"
00040 
00044 #define SPH_SIZE_groestl224   224
00045 
00049 #define SPH_SIZE_groestl256   256
00050 
00054 #define SPH_SIZE_groestl384   384
00055 
00059 #define SPH_SIZE_groestl512   512
00060 
00071 typedef struct {
00072 #ifndef DOXYGEN_IGNORE
00073         unsigned char buf[64];    /* first field, for alignment */
00074         size_t ptr;
00075         union {
00076 #if SPH_64
00077                 sph_u64 wide[8];
00078 #endif
00079                 sph_u32 narrow[16];
00080         } state;
00081 #if SPH_64
00082         sph_u64 count;
00083 #else
00084         sph_u32 count_high, count_low;
00085 #endif
00086 #endif
00087 } sph_groestl_small_context;
00088 
00093 typedef sph_groestl_small_context sph_groestl224_context;
00094 
00099 typedef sph_groestl_small_context sph_groestl256_context;
00100 
00111 typedef struct {
00112 #ifndef DOXYGEN_IGNORE
00113         unsigned char buf[128];    /* first field, for alignment */
00114         size_t ptr;
00115         union {
00116 #if SPH_64
00117                 sph_u64 wide[16];
00118 #endif
00119                 sph_u32 narrow[32];
00120         } state;
00121 #if SPH_64
00122         sph_u64 count;
00123 #else
00124         sph_u32 count_high, count_low;
00125 #endif
00126 #endif
00127 } sph_groestl_big_context;
00128 
00133 typedef sph_groestl_big_context sph_groestl384_context;
00134 
00139 typedef sph_groestl_big_context sph_groestl512_context;
00140 
00147 void sph_groestl224_init(void *cc);
00148 
00157 void sph_groestl224(void *cc, const void *data, size_t len);
00158 
00168 void sph_groestl224_close(void *cc, void *dst);
00169 
00183 void sph_groestl224_addbits_and_close(
00184         void *cc, unsigned ub, unsigned n, void *dst);
00185 
00192 void sph_groestl256_init(void *cc);
00193 
00202 void sph_groestl256(void *cc, const void *data, size_t len);
00203 
00213 void sph_groestl256_close(void *cc, void *dst);
00214 
00228 void sph_groestl256_addbits_and_close(
00229         void *cc, unsigned ub, unsigned n, void *dst);
00230 
00237 void sph_groestl384_init(void *cc);
00238 
00247 void sph_groestl384(void *cc, const void *data, size_t len);
00248 
00258 void sph_groestl384_close(void *cc, void *dst);
00259 
00273 void sph_groestl384_addbits_and_close(
00274         void *cc, unsigned ub, unsigned n, void *dst);
00275 
00282 void sph_groestl512_init(void *cc);
00283 
00292 void sph_groestl512(void *cc, const void *data, size_t len);
00293 
00303 void sph_groestl512_close(void *cc, void *dst);
00304 
00318 void sph_groestl512_addbits_and_close(
00319         void *cc, unsigned ub, unsigned n, void *dst);
00320 
00321 #endif