|
WizardsToolkit
1.0.7
|
#include "wizard/studio.h"#include "wizard/exception.h"#include "wizard/exception-private.h"#include "wizard/memory_.h"#include "wizard/sha256.h"
Go to the source code of this file.
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 SHA256Info * | AcquireSHA256Info (void) |
| 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 | 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 SHA256Blocksize 64 |
Definition at line 50 of file sha256.c.
Referenced by AcquireSHA256Info().
| #define SHA256Digestsize 32 |
Definition at line 51 of file sha256.c.
Referenced by AcquireSHA256Info(), and FinalizeSHA256().
| #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)) |
| WizardExport SHA256Info* AcquireSHA256Info | ( | void | ) |
Definition at line 108 of file sha256.c.
References AcquireWizardMemory(), ThrowWizardFatalError, HashError, MemoryError, ResetWizardMemory(), _SHA256Info::digestsize, SHA256Digestsize, _SHA256Info::blocksize, SHA256Blocksize, _SHA256Info::digest, AcquireStringInfo(), _SHA256Info::message, _SHA256Info::accumulator, AcquireQuantumMemory(), _SHA256Info::lsb_first, WizardTrue, WizardFalse, _SHA256Info::timestamp, _SHA256Info::signature, WizardSignature, and InitializeSHA256().
Referenced by AcquireHashInfo().
| static unsigned int Ch | ( | unsigned int | x, |
| unsigned int | y, | ||
| unsigned int | z | ||
| ) | [inline, static] |
Definition at line 419 of file sha256.c.
Referenced by TransformSHA256().
| WizardExport SHA256Info* DestroySHA256Info | ( | SHA256Info * | sha_info | ) |
Definition at line 159 of file sha256.c.
References LogWizardEvent(), TraceEvent, GetWizardModule, _SHA256Info::signature, WizardSignature, _SHA256Info::accumulator, RelinquishWizardMemory(), _SHA256Info::message, DestroyStringInfo(), and _SHA256Info::digest.
Referenced by DestroyHashInfo().
| WizardExport void FinalizeSHA256 | ( | SHA256Info * | sha_info | ) |
Definition at line 198 of file sha256.c.
References LogWizardEvent(), TraceEvent, GetWizardModule, _SHA256Info::signature, WizardSignature, _SHA256Info::low_order, _SHA256Info::high_order, GetStringInfoDatum(), _SHA256Info::message, GetStringInfoLength(), ResetWizardMemory(), TransformSHA256(), _SHA256Info::accumulator, _SHA256Info::digest, and SHA256Digestsize.
Referenced by FinalizeHash().
| WizardExport unsigned int GetSHA256Blocksize | ( | const SHA256Info * | sha256_info | ) |
Definition at line 288 of file sha256.c.
References LogWizardEvent(), TraceEvent, GetWizardModule, WizardAssert, CipherDomain, _SHA256Info::signature, WizardSignature, and _SHA256Info::blocksize.
Referenced by GetHashBlocksize().
| WizardExport const StringInfo* GetSHA256Digest | ( | const SHA256Info * | sha256_info | ) |
Definition at line 318 of file sha256.c.
References LogWizardEvent(), TraceEvent, GetWizardModule, WizardAssert, HashDomain, _SHA256Info::signature, WizardSignature, and _SHA256Info::digest.
Referenced by FinalizeHash().
| WizardExport unsigned int GetSHA256Digestsize | ( | const SHA256Info * | sha256_info | ) |
Definition at line 348 of file sha256.c.
References LogWizardEvent(), TraceEvent, GetWizardModule, WizardAssert, CipherDomain, _SHA256Info::signature, WizardSignature, and _SHA256Info::digestsize.
Referenced by AcquireHashInfo(), and GetHashDigestsize().
| WizardExport void InitializeSHA256 | ( | SHA256Info * | sha_info | ) |
Definition at line 378 of file sha256.c.
References LogWizardEvent(), TraceEvent, GetWizardModule, _SHA256Info::signature, WizardSignature, _SHA256Info::accumulator, _SHA256Info::low_order, _SHA256Info::high_order, and _SHA256Info::offset.
Referenced by InitializeHash(), and AcquireSHA256Info().
| static unsigned int Maj | ( | unsigned int | x, |
| unsigned int | y, | ||
| unsigned int | z | ||
| ) | [inline, static] |
Definition at line 424 of file sha256.c.
Referenced by TransformSHA256().
| static unsigned int RotateRight | ( | unsigned int | x, |
| unsigned int | n | ||
| ) | [static] |
| static void TransformSHA256 | ( | SHA256Info * | sha_info | ) | [static] |
Definition at line 439 of file sha256.c.
References F(), G(), H(), GetStringInfoDatum(), _SHA256Info::message, _SHA256Info::lsb_first, WizardFalse, Trunc32(), _SHA256Info::accumulator, Sigma1, Sigma0, Suma1, Ch(), Suma0, Maj(), and ResetWizardMemory().
Referenced by FinalizeSHA256(), and UpdateSHA256().
| static unsigned int Trunc32 | ( | unsigned int | x | ) | [inline, static] |
Definition at line 429 of file sha256.c.
Referenced by RotateRight(), TransformSHA256(), and UpdateSHA256().
| WizardExport void UpdateSHA256 | ( | SHA256Info * | sha_info, |
| const StringInfo * | message | ||
| ) |
Definition at line 606 of file sha256.c.
References _SHA256Info::signature, WizardSignature, GetStringInfoLength(), Trunc32(), _SHA256Info::low_order, _SHA256Info::high_order, GetStringInfoDatum(), _SHA256Info::offset, _SHA256Info::message, CopyWizardMemory(), TransformSHA256(), and SetStringInfoDatum().
Referenced by UpdateHash().