sphlib

sph_sha1.h

Go to the documentation of this file.
00001 /* $Id: sph_sha1.h 216 2010-06-08 09:46:57Z tp $ */
00042 #ifndef SPH_SHA1_H__
00043 #define SPH_SHA1_H__
00044 
00045 #include <stddef.h>
00046 #include "sph_types.h"
00047 
00051 #define SPH_SIZE_sha1   160
00052 
00063 typedef struct {
00064 #ifndef DOXYGEN_IGNORE
00065         unsigned char buf[64];    /* first field, for alignment */
00066         sph_u32 val[5];
00067 #if SPH_64
00068         sph_u64 count;
00069 #else
00070         sph_u32 count_high, count_low;
00071 #endif
00072 #endif
00073 } sph_sha1_context;
00074 
00080 void sph_sha1_init(void *cc);
00081 
00090 void sph_sha1(void *cc, const void *data, size_t len);
00091 
00101 void sph_sha1_close(void *cc, void *dst);
00102 
00116 void sph_sha1_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst);
00117 
00129 void sph_sha1_comp(const sph_u32 msg[16], sph_u32 val[5]);
00130 
00131 #endif