BeRTOS
yarrow.h
Go to the documentation of this file.
00001 
00038 #ifndef SEC_PRNG_YARROW_H
00039 #define SEC_PRNG_YARROW_H
00040 
00041 #include <sec/prng.h>
00042 #include <sec/cipher/aes.h>
00043 
00044 typedef struct YarrowContext
00045 {
00046     PRNG prng;
00047 
00048     uint8_t counter[16];
00049     uint8_t curkey[16];
00050     uint8_t last[16];
00051     uint8_t curkey_gencount;
00052     uint8_t lastidx;
00053 } YarrowContext;
00054 
00055 void yarrow_init(YarrowContext *ctx);
00056 
00057 #define yarrow_stackinit(...) \
00058     ({ YarrowContext *ctx = alloca(sizeof(YarrowContext)); yarrow_init(ctx, ##__VA_ARGS__); &ctx->prng; })
00059 
00060 #endif /* SEC_PRNG_YARROW_H */