|
MagickCore 7.0.10
|
#include "wizard/studio.h"#include "wizard/exception.h"#include "wizard/exception-private.h"#include "wizard/memory_.h"#include "wizard/sha3.h"Go to the source code of this file.
Data Structures | |
| struct | _SHA3Info |
Macros | |
| #define | SHA3Blocksize 64 |
| #define | SHA3Digestsize 64 |
| #define | SHA3Index(x, y) (((x) % 5)+5*((y) % 5)) |
| #define | SHA3Lanes 25 |
| #define | SHA3MaximumRate 1536 |
| #define | SHA3PermutationSize 1600 |
| #define | SHA3RotateLeft(x, offset) |
| #define | SHA3Rounds 24 |
Functions | |
| WizardExport SHA3Info * | AcquireSHA3Info (const HashType hash) |
| WizardExport SHA3Info * | DestroySHA3Info (SHA3Info *sha_info) |
| static void | ConvertBytesToWords (const unsigned char *bytes, WizardSizeType *words) |
| static void | ConvertWordsToBytes (const WizardSizeType *words, unsigned char *bytes) |
| static void | SHA3PermutationOnWords (const SHA3Info *sha_info, WizardSizeType *state) |
| static void | SHA3Permutation (const SHA3Info *sha_info, unsigned char *bytes) |
| static void | SHA3PermutationAfterXor (const SHA3Info *sha_info, const unsigned char *message, const size_t length, unsigned char *state) |
| static void | AbsorbQueue (SHA3Info *sha_info) |
| static void | PadAndSwitchToSqueezingPhase (SHA3Info *sha_info) |
| static WizardBooleanType | Squeeze (SHA3Info *sha_info, const size_t length, unsigned char *output) |
| WizardExport WizardBooleanType | FinalizeSHA3 (SHA3Info *sha_info) |
| WizardExport unsigned int | GetSHA3Blocksize (const SHA3Info *sha_info) |
| WizardExport const StringInfo * | GetSHA3Digest (const SHA3Info *sha_info) |
| WizardExport unsigned int | GetSHA3Digestsize (const SHA3Info *sha_info) |
| static int | LFSR86540 (unsigned char *byte) |
| static void | SHA3InitializeRoundConstants (SHA3Info *sha_info) |
| static void | SHA3InitializeRho (SHA3Info *sha_info) |
| static WizardBooleanType | InitializeSponge (SHA3Info *sha_info, const unsigned int rate, const unsigned int capacity) |
| WizardExport WizardBooleanType | InitializeSHA3 (SHA3Info *sha_info) |
| static WizardBooleanType | Absorb (SHA3Info *sha_info, const unsigned char *message, const size_t length) |
| WizardExport WizardBooleanType | UpdateSHA3 (SHA3Info *sha_info, const StringInfo *message) |
| #define SHA3RotateLeft | ( | x, | |
| offset | |||
| ) |
|
inlinestatic |
Definition at line 776 of file sha3.c.
References AbsorbQueue(), _SHA3Info::bits_in_queue, _SHA3Info::message, _SHA3Info::rate, SHA3PermutationAfterXor(), _SHA3Info::squeeze, _SHA3Info::state, WizardFalse, and WizardTrue.
Referenced by UpdateSHA3().
|
inlinestatic |
Definition at line 368 of file sha3.c.
References _SHA3Info::bits_in_queue, _SHA3Info::message, _SHA3Info::rate, SHA3PermutationAfterXor(), and _SHA3Info::state.
Referenced by Absorb(), and PadAndSwitchToSqueezingPhase().
| WizardExport SHA3Info * AcquireSHA3Info | ( | const HashType | hash | ) |
Definition at line 132 of file sha3.c.
References AcquireStringInfo(), AcquireWizardMemory(), _SHA3Info::blocksize, _SHA3Info::digest, _SHA3Info::digestsize, _SHA3Info::hash, HashDomain, HashIOError, InitializeSHA3(), _SHA3Info::lsb_first, MemoryError, SHA3224Hash, SHA3256Hash, SHA3384Hash, SHA3512Hash, SHA3Blocksize, SHA3Hash, _SHA3Info::signature, ThrowWizardFatalError, _SHA3Info::timestamp, WizardFalse, WizardSignature, and WizardTrue.
Referenced by AcquireHashInfo().
|
inlinestatic |
Definition at line 243 of file sha3.c.
References SHA3PermutationSize.
Referenced by SHA3Permutation().
|
inlinestatic |
Definition at line 260 of file sha3.c.
References SHA3PermutationSize.
Referenced by SHA3Permutation().
| WizardExport SHA3Info * DestroySHA3Info | ( | SHA3Info * | sha_info | ) |
Definition at line 208 of file sha3.c.
References DestroyStringInfo(), _SHA3Info::digest, GetWizardModule, LogWizardEvent(), RelinquishWizardMemory(), _SHA3Info::signature, TraceEvent, and WizardSignature.
Referenced by DestroyHashInfo().
| WizardExport WizardBooleanType FinalizeSHA3 | ( | SHA3Info * | sha_info | ) |
Definition at line 469 of file sha3.c.
References _SHA3Info::digest, _SHA3Info::digestsize, GetStringInfoDatum(), GetWizardModule, _SHA3Info::length, LogWizardEvent(), SHA3Digestsize, _SHA3Info::signature, Squeeze(), TraceEvent, WizardFalse, WizardSignature, and WizardTrue.
Referenced by FinalizeHash().
| WizardExport unsigned int GetSHA3Blocksize | ( | const SHA3Info * | sha_info | ) |
Definition at line 527 of file sha3.c.
References _SHA3Info::blocksize, CipherDomain, GetWizardModule, LogWizardEvent(), _SHA3Info::signature, TraceEvent, WizardAssert, and WizardSignature.
Referenced by GetHashBlocksize().
| WizardExport const StringInfo * GetSHA3Digest | ( | const SHA3Info * | sha_info | ) |
Definition at line 557 of file sha3.c.
References _SHA3Info::digest, GetWizardModule, HashDomain, LogWizardEvent(), _SHA3Info::signature, TraceEvent, WizardAssert, and WizardSignature.
Referenced by FinalizeHash().
| WizardExport unsigned int GetSHA3Digestsize | ( | const SHA3Info * | sha_info | ) |
Definition at line 587 of file sha3.c.
References CipherDomain, _SHA3Info::digestsize, GetWizardModule, LogWizardEvent(), _SHA3Info::signature, TraceEvent, WizardAssert, and WizardSignature.
Referenced by AcquireHashInfo(), and GetHashDigestsize().
| WizardExport WizardBooleanType InitializeSHA3 | ( | SHA3Info * | sha_info | ) |
Definition at line 706 of file sha3.c.
References GetWizardModule, _SHA3Info::hash, InitializeSponge(), LogWizardEvent(), SHA3224Hash, SHA3256Hash, SHA3384Hash, SHA3512Hash, SHA3Hash, _SHA3Info::signature, TraceEvent, WizardFalse, and WizardSignature.
Referenced by AcquireSHA3Info(), and InitializeHash().
|
inlinestatic |
Definition at line 685 of file sha3.c.
References _SHA3Info::bits_in_queue, _SHA3Info::capacity, _SHA3Info::length, _SHA3Info::message, _SHA3Info::rate, SHA3InitializeRho(), SHA3InitializeRoundConstants(), SHA3MaximumRate, SHA3PermutationSize, _SHA3Info::squeeze, _SHA3Info::squeeze_bits, _SHA3Info::state, WizardFalse, and WizardTrue.
Referenced by InitializeSHA3().
|
inlinestatic |
Definition at line 618 of file sha3.c.
Referenced by SHA3InitializeRoundConstants().
|
inlinestatic |
Definition at line 412 of file sha3.c.
References AbsorbQueue(), _SHA3Info::bits_in_queue, _SHA3Info::message, _SHA3Info::rate, _SHA3Info::squeeze, _SHA3Info::squeeze_bits, _SHA3Info::state, and WizardTrue.
Referenced by Squeeze().
|
inlinestatic |
Definition at line 661 of file sha3.c.
References _SHA3Info::rho, and SHA3Index.
Referenced by InitializeSponge().
|
inlinestatic |
Definition at line 634 of file sha3.c.
References LFSR86540(), _SHA3Info::rounds, and SHA3Rounds.
Referenced by InitializeSponge().
|
inlinestatic |
Definition at line 341 of file sha3.c.
References ConvertBytesToWords(), ConvertWordsToBytes(), _SHA3Info::lsb_first, SHA3PermutationOnWords(), and SHA3PermutationSize.
Referenced by SHA3PermutationAfterXor(), and Squeeze().
|
inlinestatic |
Definition at line 357 of file sha3.c.
References SHA3Permutation().
Referenced by Absorb(), and AbsorbQueue().
|
static |
Definition at line 276 of file sha3.c.
References _SHA3Info::rho, _SHA3Info::rounds, SHA3Index, SHA3RotateLeft, and SHA3Rounds.
Referenced by SHA3Permutation().
|
inlinestatic |
Definition at line 435 of file sha3.c.
References _SHA3Info::message, PadAndSwitchToSqueezingPhase(), _SHA3Info::rate, SHA3Permutation(), _SHA3Info::squeeze, _SHA3Info::squeeze_bits, _SHA3Info::state, WizardFalse, and WizardTrue.
Referenced by FinalizeSHA3().
| WizardExport WizardBooleanType UpdateSHA3 | ( | SHA3Info * | sha_info, |
| const StringInfo * | message | ||
| ) |
Definition at line 903 of file sha3.c.
References Absorb(), GetStringInfoDatum(), GetStringInfoLength(), _SHA3Info::signature, and WizardSignature.
Referenced by UpdateHash().