MagickCore 7.0.10
|
#include "wizard/studio.h"
#include "wizard/exception.h"
#include "wizard/exception-private.h"
#include "wizard/memory_.h"
#include "wizard/sha2256.h"
Go to the source code of this file.
Data Structures | |
struct | _SHA2256Info |
Macros | |
#define | SHA2256Blocksize 64 |
#define | SHA2256Digestsize 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 | TransformSHA2256 (SHA2256Info *) |
WizardExport SHA2256Info * | AcquireSHA2256Info (void) |
WizardExport SHA2256Info * | DestroySHA2256Info (SHA2256Info *sha_info) |
WizardExport WizardBooleanType | FinalizeSHA2256 (SHA2256Info *sha_info) |
WizardExport unsigned int | GetSHA2256Blocksize (const SHA2256Info *sha2256_info) |
WizardExport const StringInfo * | GetSHA2256Digest (const SHA2256Info *sha2256_info) |
WizardExport unsigned int | GetSHA2256Digestsize (const SHA2256Info *sha2256_info) |
WizardExport WizardBooleanType | InitializeSHA2256 (SHA2256Info *sha_info) |
static unsigned int | Ch (const unsigned int x, const unsigned int y, const unsigned int z) |
static unsigned int | Maj (const unsigned int x, const unsigned int y, const unsigned int z) |
static unsigned int | Trunc32 (const unsigned int x) |
static unsigned int | RotateRight (const unsigned int x, const unsigned int n) |
WizardExport WizardBooleanType | UpdateSHA2256 (SHA2256Info *sha_info, const StringInfo *message) |
#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 SHA2256Info * AcquireSHA2256Info | ( | void | ) |
Definition at line 108 of file sha2256.c.
References _SHA2256Info::accumulator, AcquireQuantumMemory(), AcquireStringInfo(), AcquireWizardMemory(), _SHA2256Info::blocksize, _SHA2256Info::digest, _SHA2256Info::digestsize, HashError, InitializeSHA2256(), _SHA2256Info::lsb_first, MemoryError, _SHA2256Info::message, SHA2256Blocksize, SHA2256Digestsize, _SHA2256Info::signature, ThrowWizardFatalError, _SHA2256Info::timestamp, WizardFalse, WizardSignature, and WizardTrue.
Referenced by AcquireHashInfo().
|
inlinestatic |
WizardExport SHA2256Info * DestroySHA2256Info | ( | SHA2256Info * | sha_info | ) |
Definition at line 159 of file sha2256.c.
References _SHA2256Info::accumulator, DestroyStringInfo(), _SHA2256Info::digest, GetWizardModule, LogWizardEvent(), _SHA2256Info::message, RelinquishWizardMemory(), _SHA2256Info::signature, TraceEvent, and WizardSignature.
Referenced by DestroyHashInfo().
WizardExport WizardBooleanType FinalizeSHA2256 | ( | SHA2256Info * | sha_info | ) |
Definition at line 198 of file sha2256.c.
References _SHA2256Info::accumulator, _SHA2256Info::digest, GetStringInfoDatum(), GetStringInfoLength(), GetWizardModule, _SHA2256Info::high_order, LogWizardEvent(), _SHA2256Info::low_order, _SHA2256Info::message, SHA2256Digestsize, _SHA2256Info::signature, TraceEvent, TransformSHA2256(), WizardSignature, and WizardTrue.
Referenced by FinalizeHash().
WizardExport unsigned int GetSHA2256Blocksize | ( | const SHA2256Info * | sha2256_info | ) |
Definition at line 291 of file sha2256.c.
References _SHA2256Info::blocksize, CipherDomain, GetWizardModule, LogWizardEvent(), _SHA2256Info::signature, TraceEvent, WizardAssert, and WizardSignature.
Referenced by GetHashBlocksize().
WizardExport const StringInfo * GetSHA2256Digest | ( | const SHA2256Info * | sha2256_info | ) |
Definition at line 321 of file sha2256.c.
References _SHA2256Info::digest, GetWizardModule, HashDomain, LogWizardEvent(), _SHA2256Info::signature, TraceEvent, WizardAssert, and WizardSignature.
Referenced by FinalizeHash().
WizardExport unsigned int GetSHA2256Digestsize | ( | const SHA2256Info * | sha2256_info | ) |
Definition at line 351 of file sha2256.c.
References CipherDomain, _SHA2256Info::digestsize, GetWizardModule, LogWizardEvent(), _SHA2256Info::signature, TraceEvent, WizardAssert, and WizardSignature.
Referenced by AcquireHashInfo(), and GetHashDigestsize().
WizardExport WizardBooleanType InitializeSHA2256 | ( | SHA2256Info * | sha_info | ) |
Definition at line 381 of file sha2256.c.
References _SHA2256Info::accumulator, GetWizardModule, _SHA2256Info::high_order, LogWizardEvent(), _SHA2256Info::low_order, _SHA2256Info::offset, _SHA2256Info::signature, TraceEvent, WizardSignature, and WizardTrue.
Referenced by AcquireSHA2256Info(), and InitializeHash().
|
inlinestatic |
|
static |
|
static |
Definition at line 445 of file sha2256.c.
References _SHA2256Info::accumulator, Ch, F(), G(), GetStringInfoDatum(), H(), _SHA2256Info::lsb_first, Maj, _SHA2256Info::message, Sigma0, Sigma1, Suma0, Suma1, Trunc32, and WizardFalse.
Referenced by FinalizeSHA2256(), and UpdateSHA2256().
|
inlinestatic |
WizardExport WizardBooleanType UpdateSHA2256 | ( | SHA2256Info * | sha_info, |
const StringInfo * | message | ||
) |
Definition at line 613 of file sha2256.c.
References CopyWizardMemory(), GetStringInfoDatum(), GetStringInfoLength(), _SHA2256Info::high_order, _SHA2256Info::low_order, _SHA2256Info::message, _SHA2256Info::offset, SetStringInfoDatum(), _SHA2256Info::signature, TransformSHA2256(), Trunc32, WizardSignature, and WizardTrue.
Referenced by UpdateHash().