Remove tag files.
[bertos.git] / bertos / sec / hash / ripemd.h
1 #ifndef SEC_HASH_RIPEMD_H
2 #define SEC_HASH_RIPEMD_H
3
4 #include <cfg/compiler.h>
5 #include <sec/hash.h>
6 #include <alloca.h>
7
8 typedef struct {
9         Hash hash;
10     uint32_t h[5];      /* The current hash state */
11     uint64_t length;    /* Total number of _bits_ (not bytes) added to the
12                            hash.  This includes bits that have been buffered
13                            but not not fed through the compression function yet. */
14     union {
15         uint32_t w[16];
16         uint8_t b[64];
17     } buf;
18     uint8_t bufpos;     /* number of bytes currently in the buffer */
19
20 } RIPEMD_Context;
21
22 void RIPEMD_init(RIPEMD_Context *ctx);
23
24 #define RIPEMD_stackinit(...) \
25         ({ RIPEMD_Context *ctx = alloca(sizeof(RIPEMD_Context)); RIPEMD_init(ctx , ##__VA_ARGS__); &ctx->hash; })
26
27 int RIPEMD_testSetup(void);
28 int RIPEMD_testRun(void);
29 int RIPEMD_testTearDown(void);
30
31
32 #endif /* SEC_HASH_RIPEMD_H */