Shadowrun: Awakened 29 September 2011 - Build 871
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes
cat::Skein Class Reference

#include <Skein.hpp>

Inheritance diagram for cat::Skein:

List of all members.

Public Member Functions

bool BeginKDF ()
bool BeginKey (int bits)
bool BeginMAC ()
bool BeginPRNG ()
void Crunch (const void *message, int bytes)
void End ()
void Generate (void *out, int bytes, int strengthening_rounds=0)
bool SetKey (ICryptHash *parent)
 ~Skein ()

Protected Types

typedef void(Skein::* HashComputation )(const void *message, int blocks, u32 byte_count, u64 *NextState)

Protected Member Functions

void GenerateInitialState (int bits)
void HashComputation256 (const void *message, int blocks, u32 byte_count, u64 *NextState)
void HashComputation512 (const void *message, int blocks, u32 byte_count, u64 *NextState)

Protected Attributes

int digest_words
HashComputation hash_func
u64 output_block_counter
bool output_prng_mode
u64 State [MAX_WORDS]
u64 Tweak [2]
int used_bytes
u8 Work [MAX_BYTES]

Static Protected Attributes

static const int BLK_TYPE_CFG = 4
static const int BLK_TYPE_KDF = 16
static const int BLK_TYPE_KEY = 0
static const int BLK_TYPE_MSG = 48
static const int BLK_TYPE_NONCE = 20
static const int BLK_TYPE_OUT = 63
static const int BLK_TYPE_PERS = 8
static const int BLK_TYPE_PK = 12
static const u32 ID_STRING_LE = 0x33414853
static const int MAX_BITS = 512
static const int MAX_BYTES = MAX_BITS / 8
static const int MAX_WORDS = MAX_BITS / 64
static const u64 SCHEMA_VER = ((u64)VERSION << 32) | ID_STRING_LE
static const u64 T1_MASK_BIT_PAD = (u64)1 << T1_POS_BIT_PAD
static const u64 T1_MASK_BLK_TYPE = (u64)63 << T1_POS_BLK_TYPE
static const u64 T1_MASK_FINAL = (u64)1 << T1_POS_FINAL
static const u64 T1_MASK_FIRST = (u64)1 << T1_POS_FIRST
static const u64 T1_MASK_TREE_LVL = (u64)0x7F << T1_POS_TREE_LVL
static const int T1_POS_BIT_PAD = 119-64
static const int T1_POS_BLK_TYPE = 120-64
static const int T1_POS_FINAL = 127-64
static const int T1_POS_FIRST = 126-64
static const int T1_POS_TREE_LVL = 112-64
static const u32 VERSION = 1

Detailed Description

Definition at line 43 of file Skein.hpp.


Member Typedef Documentation

typedef void(Skein::* cat::Skein::HashComputation)(const void *message, int blocks, u32 byte_count, u64 *NextState) [protected]

Definition at line 84 of file Skein.hpp.


Constructor & Destructor Documentation

cat::Skein::~Skein ( )

Member Function Documentation

bool cat::Skein::BeginKDF ( ) [virtual]

Implements cat::ICryptHash.

bool cat::Skein::BeginKey ( int  bits) [virtual]

Implements cat::ICryptHash.

bool cat::Skein::BeginMAC ( ) [virtual]

Implements cat::ICryptHash.

bool cat::Skein::BeginPRNG ( ) [virtual]

Implements cat::ICryptHash.

void cat::Skein::Crunch ( const void *  message,
int  bytes 
) [virtual]

Implements cat::ICryptHash.

void cat::Skein::End ( ) [virtual]

Implements cat::ICryptHash.

void cat::Skein::Generate ( void *  out,
int  bytes,
int  strengthening_rounds = 0 
) [virtual]

Implements cat::ICryptHash.

void cat::Skein::GenerateInitialState ( int  bits) [protected]
void cat::Skein::HashComputation256 ( const void *  message,
int  blocks,
u32  byte_count,
u64 NextState 
) [protected]
void cat::Skein::HashComputation512 ( const void *  message,
int  blocks,
u32  byte_count,
u64 NextState 
) [protected]
bool cat::Skein::SetKey ( ICryptHash parent) [virtual]

Implements cat::ICryptHash.


Member Data Documentation

const int cat::Skein::BLK_TYPE_CFG = 4 [static, protected]

Definition at line 61 of file Skein.hpp.

const int cat::Skein::BLK_TYPE_KDF = 16 [static, protected]

Definition at line 64 of file Skein.hpp.

const int cat::Skein::BLK_TYPE_KEY = 0 [static, protected]

Definition at line 60 of file Skein.hpp.

const int cat::Skein::BLK_TYPE_MSG = 48 [static, protected]

Definition at line 66 of file Skein.hpp.

const int cat::Skein::BLK_TYPE_NONCE = 20 [static, protected]

Definition at line 65 of file Skein.hpp.

const int cat::Skein::BLK_TYPE_OUT = 63 [static, protected]

Definition at line 67 of file Skein.hpp.

const int cat::Skein::BLK_TYPE_PERS = 8 [static, protected]

Definition at line 62 of file Skein.hpp.

const int cat::Skein::BLK_TYPE_PK = 12 [static, protected]

Definition at line 63 of file Skein.hpp.

int cat::Skein::digest_words [protected]

Definition at line 80 of file Skein.hpp.

Definition at line 89 of file Skein.hpp.

const u32 cat::Skein::ID_STRING_LE = 0x33414853 [static, protected]

Definition at line 69 of file Skein.hpp.

const int cat::Skein::MAX_BITS = 512 [static, protected]

Definition at line 73 of file Skein.hpp.

const int cat::Skein::MAX_BYTES = MAX_BITS / 8 [static, protected]

Definition at line 75 of file Skein.hpp.

const int cat::Skein::MAX_WORDS = MAX_BITS / 64 [static, protected]

Definition at line 74 of file Skein.hpp.

Definition at line 81 of file Skein.hpp.

Definition at line 82 of file Skein.hpp.

const u64 cat::Skein::SCHEMA_VER = ((u64)VERSION << 32) | ID_STRING_LE [static, protected]

Definition at line 71 of file Skein.hpp.

Definition at line 78 of file Skein.hpp.

const u64 cat::Skein::T1_MASK_BIT_PAD = (u64)1 << T1_POS_BIT_PAD [static, protected]

Definition at line 56 of file Skein.hpp.

const u64 cat::Skein::T1_MASK_BLK_TYPE = (u64)63 << T1_POS_BLK_TYPE [static, protected]

Definition at line 58 of file Skein.hpp.

const u64 cat::Skein::T1_MASK_FINAL = (u64)1 << T1_POS_FINAL [static, protected]

Definition at line 55 of file Skein.hpp.

const u64 cat::Skein::T1_MASK_FIRST = (u64)1 << T1_POS_FIRST [static, protected]

Definition at line 54 of file Skein.hpp.

const u64 cat::Skein::T1_MASK_TREE_LVL = (u64)0x7F << T1_POS_TREE_LVL [static, protected]

Definition at line 57 of file Skein.hpp.

const int cat::Skein::T1_POS_BIT_PAD = 119-64 [static, protected]

Definition at line 48 of file Skein.hpp.

const int cat::Skein::T1_POS_BLK_TYPE = 120-64 [static, protected]

Definition at line 49 of file Skein.hpp.

const int cat::Skein::T1_POS_FINAL = 127-64 [static, protected]

Definition at line 51 of file Skein.hpp.

const int cat::Skein::T1_POS_FIRST = 126-64 [static, protected]

Definition at line 50 of file Skein.hpp.

const int cat::Skein::T1_POS_TREE_LVL = 112-64 [static, protected]

Definition at line 47 of file Skein.hpp.

u64 cat::Skein::Tweak[2] [protected]

Definition at line 77 of file Skein.hpp.

int cat::Skein::used_bytes [protected]

Definition at line 80 of file Skein.hpp.

const u32 cat::Skein::VERSION = 1 [static, protected]

Definition at line 70 of file Skein.hpp.

Definition at line 79 of file Skein.hpp.


The documentation for this class was generated from the following file:

Copyright © 2007-2010 by The Shadowrun: Awakened Team. This work is licensed under the GNU Lesser General Public License 3.

GNU Lesser General Public License 3 Sourceforge.net