sphlib

sph_sha0.h

Go to the documentation of this file.
00001 /* $Id: sph_sha0.h 216 2010-06-08 09:46:57Z tp $ */
00050 #ifndef SPH_SHA0_H__
00051 #define SPH_SHA0_H__
00052 
00053 #include <stddef.h>
00054 #include "sph_types.h"
00055 
00059 #define SPH_SIZE_sha0   160
00060 
00071 typedef struct {
00072 #ifndef DOXYGEN_IGNORE
00073         unsigned char buf[64];    /* first field, for alignment */
00074         sph_u32 val[5];
00075 #if SPH_64
00076         sph_u64 count;
00077 #else
00078         sph_u32 count_high, count_low;
00079 #endif
00080 #endif
00081 } sph_sha0_context;
00082 
00088 void sph_sha0_init(void *cc);
00089 
00098 void sph_sha0(void *cc, const void *data, size_t len);
00099 
00109 void sph_sha0_close(void *cc, void *dst);
00110 
00124 void sph_sha0_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst);
00125 
00137 void sph_sha0_comp(const sph_u32 msg[16], sph_u32 val[5]);
00138 
00139 #endif