Logo Search packages:      
Sourcecode: libtomcrypt version File versions  Download package

Defines | Functions | Variables

sober128.c File Reference

#include "tomcrypt.h"
#include "sober128tab.c"
Include dependency graph for sober128.c:

Go to the source code of this file.


#define ADDKEY(k)   c->R[KEYP] += (k);
#define B(x, i)   ((unsigned char)(((x) >> (8*i)) & 0xFF))
#define DROUND(z)   STEP(c->R,z); NLFUNC(c,(z+1)); c->R[OFF((z+1),FOLDP)] ^= t;
#define FOLD   N
#define FOLDP   4
#define INITKONST   0x6996c53a
#define KEYP   15
#define N   17
#define NLFUNC(c, z)
#define OFF(zero, i)   (((zero)+(i)) % N)
#define SROUND(z)   STEP(c->R,z); NLFUNC(c,(z+1)); XORWORD(t, out+(z*4));
#define STEP(R, z)   R[OFF(z,0)] = R[OFF(z,15)] ^ R[OFF(z,4)] ^ (R[OFF(z,0)] << 8) ^ Multab[(R[OFF(z,0)] >> 24) & 0xFF];
#define WORD2BYTE(w, b)   STORE32L(b, w)
#define XORNL(nl)   c->R[FOLDP] ^= (nl);


static ulong32 BYTE2WORD (unsigned char *b)
static void cycle (ulong32 *R)
static ulong32 nltap (struct sober128_prng *c)
static void s128_diffuse (struct sober128_prng *c)
static void s128_genkonst (struct sober128_prng *c)
static void s128_reloadstate (struct sober128_prng *c)
static void s128_savestate (struct sober128_prng *c)
int sober128_add_entropy (const unsigned char *in, unsigned long inlen, prng_state *prng)
int sober128_done (prng_state *prng)
int sober128_export (unsigned char *out, unsigned long *outlen, prng_state *prng)
int sober128_import (const unsigned char *in, unsigned long inlen, prng_state *prng)
unsigned long sober128_read (unsigned char *out, unsigned long outlen, prng_state *prng)
int sober128_ready (prng_state *prng)
int sober128_start (prng_state *prng)
int sober128_test (void)
static void XORWORD (ulong32 w, unsigned char *b)


struct ltc_prng_descriptor sober128_desc

Detailed Description

Implementation of SOBER-128 by Tom St Denis. Based on s128fast.c reference code supplied by Greg Rose of QUALCOMM.

Definition in file sober128.c.

Generated by  Doxygen 1.6.0   Back to index