Data Structures | Defines | Functions

sha256.c File Reference

#include "wizard/studio.h"
#include "wizard/exception.h"
#include "wizard/exception-private.h"
#include "wizard/memory_.h"
#include "wizard/sha256.h"

Data Structures

struct  _SHA256Info

Defines

#define SHA256Blocksize   64
#define SHA256Digestsize   32
#define Sigma0(x)   (RotateRight(x,7) ^ RotateRight(x,18) ^ Trunc32((x) >> 3))
#define Sigma1(x)   (RotateRight(x,17) ^ RotateRight(x,19) ^ Trunc32((x) >> 10))
#define Suma0(x)   (RotateRight(x,2) ^ RotateRight(x,13) ^ RotateRight(x,22))
#define Suma1(x)   (RotateRight(x,6) ^ RotateRight(x,11) ^ RotateRight(x,25))

Functions

static void TransformSHA256 (SHA256Info *)
WizardExport SHA256InfoAcquireSHA256Info (void)
WizardExport SHA256InfoDestroySHA256Info (SHA256Info *sha_info)
WizardExport void FinalizeSHA256 (SHA256Info *sha_info)
WizardExport unsigned int GetSHA256Blocksize (const SHA256Info *sha256_info)
WizardExport const StringInfoGetSHA256Digest (const SHA256Info *sha256_info)
WizardExport unsigned int GetSHA256Digestsize (const SHA256Info *sha256_info)
WizardExport void InitializeSHA256 (SHA256Info *sha_info)
static unsigned int Ch (unsigned int x, unsigned int y, unsigned int z)
static unsigned int Maj (unsigned int x, unsigned int y, unsigned int z)
static unsigned int Trunc32 (unsigned int x)
static unsigned int RotateRight (unsigned int x, unsigned int n)
WizardExport void UpdateSHA256 (SHA256Info *sha_info, const StringInfo *message)

Define Documentation

#define SHA256Blocksize   64

Referenced by AcquireSHA256Info().

#define SHA256Digestsize   32
#define Sigma0 (   x  )     (RotateRight(x,7) ^ RotateRight(x,18) ^ Trunc32((x) >> 3))
#define Sigma1 (   x  )     (RotateRight(x,17) ^ RotateRight(x,19) ^ Trunc32((x) >> 10))
#define Suma0 (   x  )     (RotateRight(x,2) ^ RotateRight(x,13) ^ RotateRight(x,22))
#define Suma1 (   x  )     (RotateRight(x,6) ^ RotateRight(x,11) ^ RotateRight(x,25))

Function Documentation

WizardExport SHA256Info* AcquireSHA256Info ( void   ) 
static unsigned int Ch ( unsigned int  x,
unsigned int  y,
unsigned int  z 
) [inline, static]

Referenced by TransformSHA256().

WizardExport SHA256Info* DestroySHA256Info ( SHA256Info sha_info  ) 
WizardExport void FinalizeSHA256 ( SHA256Info sha_info  ) 
WizardExport unsigned int GetSHA256Blocksize ( const SHA256Info sha256_info  ) 
WizardExport const StringInfo* GetSHA256Digest ( const SHA256Info sha256_info  ) 
WizardExport unsigned int GetSHA256Digestsize ( const SHA256Info sha256_info  ) 
WizardExport void InitializeSHA256 ( SHA256Info sha_info  ) 
static unsigned int Maj ( unsigned int  x,
unsigned int  y,
unsigned int  z 
) [inline, static]

Referenced by TransformSHA256().

static unsigned int RotateRight ( unsigned int  x,
unsigned int  n 
) [static]

References Trunc32().

static void TransformSHA256 ( SHA256Info sha_info  )  [static]
static unsigned int Trunc32 ( unsigned int  x  )  [inline, static]
WizardExport void UpdateSHA256 ( SHA256Info sha_info,
const StringInfo message 
)