Data Structures | Defines | Functions

# sha2384.c File Reference

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

## Data Structures
struct | _SHA224Info
## Defines
#define | SHA224Blocksize 64
#define | SHA224Digestsize 28
#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 | TransformSHA224 (SHA224Info *)
WizardExport SHA224Info * | AcquireSHA224Info (void)
WizardExport SHA224Info * | DestroySHA224Info (SHA224Info *sha_info)
WizardExport void | FinalizeSHA224 (SHA224Info *sha_info)
WizardExport unsigned int | GetSHA224Blocksize (const SHA224Info *sha2384_info)
WizardExport const StringInfo * | GetSHA224Digest (const SHA224Info *sha2384_info)
WizardExport unsigned int | GetSHA224Digestsize (const SHA224Info *sha2384_info)
WizardExport void | InitializeSHA224 (SHA224Info *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 | UpdateSHA224 (SHA224Info *sha_info, const StringInfo *message)

## Define Documentation

#define SHA224Blocksize 64

Referenced by AcquireSHA224Info().

#define SHA224Digestsize 28

Referenced by AcquireSHA224Info(), and FinalizeSHA224().

#define Sigma0 | ( |  | x | ) | (RotateRight(x,7) ^ RotateRight(x,18) ^ Trunc32((x) >> 3))

Referenced by TransformSHA224(), TransformSHA256(), TransformSHA384(), TransformSHA512(), and TransformSignature().

#define Sigma1 | ( |  | x | ) | (RotateRight(x,17) ^ RotateRight(x,19) ^ Trunc32((x) >> 10))

Referenced by TransformSHA224(), TransformSHA256(), TransformSHA384(), TransformSHA512(), and TransformSignature().

#define Suma0 | ( |  | x | ) | (RotateRight(x,2) ^ RotateRight(x,13) ^ RotateRight(x,22))

Referenced by TransformSHA224(), TransformSHA256(), TransformSHA384(), TransformSHA512(), and TransformSignature().

#define Suma1 | ( |  | x | ) | (RotateRight(x,6) ^ RotateRight(x,11) ^ RotateRight(x,25))

Referenced by TransformSHA224(), TransformSHA256(), TransformSHA384(), TransformSHA512(), and TransformSignature().

## Function Documentation

WizardExport SHA224Info* AcquireSHA224Info | ( | void |  | ) |

References _SHA224Info::accumulator, AcquireQuantumMemory(), AcquireStringInfo(), AcquireWizardMemory(), _SHA224Info::blocksize, _SHA224Info::digest, _SHA224Info::digestsize, HashError, InitializeSHA224(), _SHA224Info::lsb_first, MemoryError, _SHA224Info::message, ResetWizardMemory(), SHA224Blocksize, SHA224Digestsize, _SHA224Info::signature, ThrowWizardFatalError, _SHA224Info::timestamp, and WizardTrue.

Referenced by AcquireHashInfo().

static unsigned int Ch | ( | unsigned int | x,
|  | unsigned int | y,
|  | unsigned int | z |
| ) |  |  | `[inline, static]`

Referenced by TransformSHA224().

WizardExport SHA224Info* DestroySHA224Info | ( | SHA224Info * | sha_info | ) |

References _SHA224Info::accumulator, DestroyStringInfo(), _SHA224Info::digest, GetWizardModule, LogWizardEvent(), _SHA224Info::message, RelinquishWizardMemory(), _SHA224Info::signature, TraceEvent, and WizardSignature.

Referenced by DestroyHashInfo().

WizardExport void FinalizeSHA224 | ( | SHA224Info * | sha_info | ) |

References _SHA224Info::accumulator, _SHA224Info::digest, GetStringInfoDatum(), GetStringInfoLength(), GetWizardModule, _SHA224Info::high_order, LogWizardEvent(), _SHA224Info::low_order, _SHA224Info::message, ResetWizardMemory(), SHA224Digestsize, _SHA224Info::signature, TraceEvent, TransformSHA224(), and WizardSignature.

Referenced by FinalizeHash().

WizardExport unsigned int GetSHA224Blocksize | ( | const SHA224Info * | sha2384_info | ) |

References _SHA224Info::blocksize, CipherDomain, GetWizardModule, LogWizardEvent(), _SHA224Info::signature, TraceEvent, WizardAssert, and WizardSignature.

Referenced by GetHashBlocksize().

WizardExport const StringInfo* GetSHA224Digest | ( | const SHA224Info * | sha2384_info | ) |

References _SHA224Info::digest, GetWizardModule, HashDomain, LogWizardEvent(), _SHA224Info::signature, TraceEvent, WizardAssert, and WizardSignature.

Referenced by FinalizeHash().

WizardExport unsigned int GetSHA224Digestsize | ( | const SHA224Info * | sha2384_info | ) |

References CipherDomain, _SHA224Info::digestsize, GetWizardModule, LogWizardEvent(), _SHA224Info::signature, TraceEvent, WizardAssert, and WizardSignature.

Referenced by AcquireHashInfo(), and GetHashDigestsize().

WizardExport void InitializeSHA224 | ( | SHA224Info * | sha_info | ) |

References _SHA224Info::accumulator, GetWizardModule, _SHA224Info::high_order, LogWizardEvent(), _SHA224Info::low_order, _SHA224Info::offset, _SHA224Info::signature, TraceEvent, and WizardSignature.

Referenced by AcquireSHA224Info(), and InitializeHash().

static unsigned int Maj | ( | unsigned int | x,
|  | unsigned int | y,
|  | unsigned int | z |
| ) |  |  | `[inline, static]`

Referenced by TransformSHA224().

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

References Trunc32().

static void TransformSHA224 | ( | SHA224Info * | sha_info | ) | `[static]`

References _SHA224Info::accumulator, Ch(), GetStringInfoDatum(), _SHA224Info::lsb_first, Maj(), _SHA224Info::message, ResetWizardMemory(), Sigma0, Sigma1, Suma0, Suma1, Trunc32(), and WizardFalse.

Referenced by FinalizeSHA224(), and UpdateSHA224().

static unsigned int Trunc32 | ( | unsigned int | x | ) | `[inline, static]`

Referenced by RotateRight(), TransformSHA224(), and UpdateSHA224().

WizardExport void UpdateSHA224 | ( | SHA224Info * | sha_info,
|  | const StringInfo * | message |
| ) |  |  |

References CopyWizardMemory(), GetStringInfoDatum(), GetStringInfoLength(), _SHA224Info::high_order, _SHA224Info::low_order, _SHA224Info::message, _SHA224Info::offset, SetStringInfoDatum(), _SHA224Info::signature, TransformSHA224(), Trunc32(), and WizardSignature.

Referenced by UpdateHash().