whirlpool.h File Reference

#include <limits.h>

Include dependency graph for whirlpool.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  NESSIEstruct

Defines

#define ONE32   0xffffffffU
#define ONE8   0xffU
#define ONE16   0xffffU
#define T8(x)   ((x) & ONE8)
#define T16(x)   ((x) & ONE16)
#define T32(x)   ((x) & ONE32)
#define LL(v)   (v##ULL)
#define ONE64   LL(0xffffffffffffffff)
#define T64(x)   ((x) & ONE64)
#define ROTR64(v, n)   (((v) >> (n)) | T64((v) << (64 - (n))))
#define U8TO32_BIG(c)   (((u32)T8(*(c)) << 24) | ((u32)T8(*((c) + 1)) << 16) | ((u32)T8(*((c) + 2)) << 8) | ((u32)T8(*((c) + 3))))
#define U8TO32_LITTLE(c)   (((u32)T8(*(c))) | ((u32)T8(*((c) + 1)) << 8) | (u32)T8(*((c) + 2)) << 16) | ((u32)T8(*((c) + 3)) << 24))
#define U32TO8_BIG(c, v)   do { u32 x = (v); u8 *d = (c); d[0] = T8(x >> 24); d[1] = T8(x >> 16); d[2] = T8(x >> 8); d[3] = T8(x); } while (0)
#define U32TO8_LITTLE(c, v)   do { u32 x = (v); u8 *d = (c); d[0] = T8(x); d[1] = T8(x >> 8); d[2] = T8(x >> 16); d[3] = T8(x >> 24); } while (0)
#define ROTL32(v, n)   (T32((v) << (n)) | ((v) >> (32 - (n))))
#define DIGESTBYTES   64
#define DIGESTBITS   (8*DIGESTBYTES)
#define WBLOCKBYTES   64
#define WBLOCKBITS   (8*WBLOCKBYTES)
#define LENGTHBYTES   32
#define LENGTHBITS   (8*LENGTHBYTES)

Typedefs

typedef signed char s8
typedef unsigned char u8
typedef signed short s16
typedef signed int s32
typedef unsigned short u16
typedef unsigned int u32
typedef unsigned long long u64
typedef signed long long s64

Functions

void NESSIEinit (NESSIEstruct *const)
void NESSIEadd (const unsigned char *const, unsigned long, NESSIEstruct *const)
void NESSIEfinalize (NESSIEstruct *const, unsigned char *const)
void makeNESSIETestVectors ()
void testAPI (void)


Define Documentation

#define DIGESTBITS   (8*DIGESTBYTES)
 

Definition at line 114 of file whirlpool.h.

#define DIGESTBYTES   64
 

Definition at line 113 of file whirlpool.h.

Referenced by cryptfunctionvalue(), and NESSIEfinalize().

#define LENGTHBITS   (8*LENGTHBYTES)
 

Definition at line 120 of file whirlpool.h.

#define LENGTHBYTES   32
 

Definition at line 119 of file whirlpool.h.

Referenced by NESSIEfinalize().

#define LL v   )     (v##ULL)
 

Definition at line 59 of file whirlpool.h.

Referenced by NESSIEadd().

#define ONE16   0xffffU
 

Definition at line 45 of file whirlpool.h.

#define ONE32   0xffffffffU
 

Definition at line 31 of file whirlpool.h.

#define ONE64   LL(0xffffffffffffffff)
 

Definition at line 60 of file whirlpool.h.

#define ONE8   0xffU
 

Definition at line 44 of file whirlpool.h.

#define ROTL32 v,
 )     (T32((v) << (n)) | ((v) >> (32 - (n))))
 

Definition at line 107 of file whirlpool.h.

#define ROTR64 v,
 )     (((v) >> (n)) | T64((v) << (64 - (n))))
 

Definition at line 63 of file whirlpool.h.

#define T16  )     ((x) & ONE16)
 

Definition at line 48 of file whirlpool.h.

#define T32  )     ((x) & ONE32)
 

Definition at line 49 of file whirlpool.h.

#define T64  )     ((x) & ONE64)
 

Definition at line 62 of file whirlpool.h.

#define T8  )     ((x) & ONE8)
 

Definition at line 47 of file whirlpool.h.

#define U32TO8_BIG c,
v   )     do { u32 x = (v); u8 *d = (c); d[0] = T8(x >> 24); d[1] = T8(x >> 16); d[2] = T8(x >> 8); d[3] = T8(x); } while (0)
 

Definition at line 89 of file whirlpool.h.

#define U32TO8_LITTLE c,
v   )     do { u32 x = (v); u8 *d = (c); d[0] = T8(x); d[1] = T8(x >> 8); d[2] = T8(x >> 16); d[3] = T8(x >> 24); } while (0)
 

Definition at line 95 of file whirlpool.h.

#define U8TO32_BIG  )     (((u32)T8(*(c)) << 24) | ((u32)T8(*((c) + 1)) << 16) | ((u32)T8(*((c) + 2)) << 8) | ((u32)T8(*((c) + 3))))
 

Definition at line 77 of file whirlpool.h.

#define U8TO32_LITTLE  )     (((u32)T8(*(c))) | ((u32)T8(*((c) + 1)) << 8) | (u32)T8(*((c) + 2)) << 16) | ((u32)T8(*((c) + 3)) << 24))
 

Definition at line 83 of file whirlpool.h.

#define WBLOCKBITS   (8*WBLOCKBYTES)
 

Definition at line 117 of file whirlpool.h.

#define WBLOCKBYTES   64
 

Definition at line 116 of file whirlpool.h.

Referenced by NESSIEfinalize(), and processBuffer().


Typedef Documentation

typedef signed short s16
 

Definition at line 26 of file whirlpool.h.

typedef signed int s32
 

Definition at line 27 of file whirlpool.h.

typedef signed long long s64
 

Definition at line 58 of file whirlpool.h.

typedef signed char s8
 

Definition at line 21 of file whirlpool.h.

typedef unsigned short u16
 

Definition at line 28 of file whirlpool.h.

typedef unsigned int u32
 

Definition at line 29 of file whirlpool.h.

typedef unsigned long long u64
 

Definition at line 57 of file whirlpool.h.

typedef unsigned char u8
 

Definition at line 22 of file whirlpool.h.


Function Documentation

void makeNESSIETestVectors  ) 
 

void NESSIEadd const unsigned char *const   source,
unsigned long  sourceBits,
struct NESSIEstruct *const   structpointer
 

Delivers input data to the hashing algorithm.

Parameters:
source plaintext data to hash.
sourceBits how many bits of plaintext to process.
This method maintains the invariant: bufferBits < DIGESTBITS

Definition at line 1518 of file whirlpool.c.

References NESSIEstruct::bitLength, NESSIEstruct::buffer, NESSIEstruct::bufferBits, NESSIEstruct::bufferPos, LL, and value.

Referenced by cryptfunctionvalue().

void NESSIEfinalize struct NESSIEstruct *const   structpointer,
unsigned char *const   result
 

Get the hash value from the hashing state.

This method uses the invariant: bufferBits < DIGESTBITS

Definition at line 1636 of file whirlpool.c.

References NESSIEstruct::bitLength, NESSIEstruct::buffer, NESSIEstruct::bufferBits, NESSIEstruct::bufferPos, DIGESTBYTES, NESSIEstruct::hash, LENGTHBYTES, processBuffer(), and WBLOCKBYTES.

Referenced by cryptfunctionvalue().

Here is the call graph for this function:

void NESSIEinit struct NESSIEstruct *const   structpointer  ) 
 

Initialize the hashing state.

Definition at line 1482 of file whirlpool.c.

References NESSIEstruct::bitLength, NESSIEstruct::buffer, NESSIEstruct::bufferBits, NESSIEstruct::bufferPos, and NESSIEstruct::hash.

Referenced by cryptfunctionvalue().

void testAPI void   ) 
 


Generated on Wed Jun 14 04:24:15 2006 for frontierkernel 10.1.10a by  doxygen 1.4.6