2 This file is derived from sober128 implementation in corosync
3 cluster engine. corosync cluster engine borrows the implementation
6 The latest version of the original code can be found at
7 http://www.libtom.net/LibTomCrypt/ according to which this code is in the
12 * ---------------------------------------------------------------------
13 * LibTomCrypt, modular cryptographic library -- Tom St Denis
15 * LibTomCrypt is a library that provides various cryptographic
16 * algorithms in a highly modular and flexible manner.
18 * The library is free for all purposes without any express
21 * Tom St Denis, tomstdenis@iahu.ca, http://www.libtom.net/LibTomCrypt/
27 #include "ws_symbol_export.h"
29 typedef struct _sober128_prng
{
30 unsigned long R
[17], /* Working storage for the shift register */
31 initR
[17], /* saved register contents */
32 konst
, /* key dependent constant */
33 sbuf
; /* partial word encryption buffer */
35 int nbuf
, /* number of part-word stream bits buffered */
36 flag
, /* first add_entropy call or not? */
37 set
; /* did we call add_entropy to set key? */
42 int sober128_start(sober128_prng
*prng
);
44 int sober128_add_entropy(const unsigned char *buf
, unsigned long len
, sober128_prng
*prng
);
46 unsigned long sober128_read(unsigned char *buf
, unsigned long len
, sober128_prng
*prng
);
48 #endif /* sober128.h */