BeRTOS
sha1.h
Go to the documentation of this file.
00001 
00039 #ifndef SEC_HASH_SHA1
00040 #define SEC_HASH_SHA1
00041 
00042 #include <cfg/compiler.h>
00043 #include <sec/hash.h>
00044 #include <alloca.h>
00045 
00049 typedef struct {
00050     Hash h;
00051     uint32_t state[5];
00052     uint32_t count[2];
00053     uint8_t buffer[64];
00054 } SHA1_Context;
00055 
00056 void SHA1_init(SHA1_Context *context);
00057 
00058 #define SHA1_stackinit(...) \
00059     ({ SHA1_Context *ctx = alloca(sizeof(SHA1_Context)); SHA1_init(ctx, ##__VA_ARGS__); &ctx->h; })
00060 
00061 int SHA1_testSetup(void);
00062 int SHA1_testRun(void);
00063 int SHA1_testTearDown(void);
00064 
00065 #endif