MagickCore 7.0.10
|
#include "wizard/studio.h"
#include "wizard/aes.h"
#include "wizard/exception.h"
#include "wizard/exception-private.h"
#include "wizard/memory_.h"
Go to the source code of this file.
Data Structures | |
struct | _AESInfo |
Macros | |
#define | AESBlocksize 16 |
Functions | |
WizardExport AESInfo * | AcquireAESInfo (void) |
static void | AddRoundKey (const unsigned int *ciphertext, const unsigned int *key, unsigned int *plaintext) |
static unsigned int | ByteMultiply (const unsigned char alpha, const unsigned char beta) |
static unsigned int | ByteSubTransform (const unsigned int x, const unsigned char *s_box) |
static void | FinalizeRoundKey (const unsigned int *ciphertext, const unsigned int *key, unsigned char *plaintext) |
static void | InitializeRoundKey (const unsigned char *ciphertext, const unsigned int *key, unsigned int *plaintext) |
static unsigned int | RotateLeft (const unsigned int x) |
WizardExport void | DecipherAESBlock (AESInfo *aes_info, const unsigned char *ciphertext, unsigned char *plaintext) |
WizardExport AESInfo * | DestroyAESInfo (AESInfo *aes_info) |
WizardExport void | EncipherAESBlock (AESInfo *aes_info, const unsigned char *plaintext, unsigned char *ciphertext) |
WizardExport unsigned int | GetAESBlocksize (const AESInfo *aes_info) |
static void | InverseAddRoundKey (const unsigned int *alpha, unsigned int *beta) |
static unsigned int | XTime (unsigned char alpha) |
static unsigned int | RotateRight (const unsigned int x) |
WizardExport void | SetAESKey (AESInfo *aes_info, const StringInfo *key) |
Variables | |
static unsigned char | InverseLog [256] |
static unsigned char | Log [256] |
static unsigned char | SBox [256] |
WizardExport AESInfo * AcquireAESInfo | ( | void | ) |
Definition at line 165 of file aes.c.
References AcquireQuantumMemory(), AcquireStringInfo(), AcquireWizardMemory(), AESBlocksize, _AESInfo::blocksize, CipherDomain, _AESInfo::decipher_key, _AESInfo::encipher_key, _AESInfo::key, MemoryError, _AESInfo::signature, ThrowWizardFatalError, _AESInfo::timestamp, and WizardSignature.
Referenced by AcquireCipherInfo().
|
inlinestatic |
Definition at line 218 of file aes.c.
Referenced by DecipherAESBlock(), and EncipherAESBlock().
|
inlinestatic |
Definition at line 231 of file aes.c.
References InverseLog, and Log.
Referenced by InverseAddRoundKey().
|
inlinestatic |
Definition at line 242 of file aes.c.
Referenced by DecipherAESBlock(), EncipherAESBlock(), and SetAESKey().
WizardExport void DecipherAESBlock | ( | AESInfo * | aes_info, |
const unsigned char * | ciphertext, | ||
unsigned char * | plaintext | ||
) |
Definition at line 319 of file aes.c.
References AddRoundKey(), ByteSubTransform(), _AESInfo::decipher_key, FinalizeRoundKey(), I(), InitializeRoundKey(), ResetWizardMemory(), RotateLeft(), and _AESInfo::rounds.
Referenced by AcquireCipherInfo().
WizardExport AESInfo * DestroyAESInfo | ( | AESInfo * | aes_info | ) |
Definition at line 475 of file aes.c.
References CipherDomain, _AESInfo::decipher_key, DestroyStringInfo(), _AESInfo::encipher_key, GetWizardModule, _AESInfo::key, LogWizardEvent(), RelinquishWizardMemory(), _AESInfo::signature, TraceEvent, WizardAssert, and WizardSignature.
Referenced by DestroyCipherInfo().
WizardExport void EncipherAESBlock | ( | AESInfo * | aes_info, |
const unsigned char * | plaintext, | ||
unsigned char * | ciphertext | ||
) |
Definition at line 521 of file aes.c.
References AddRoundKey(), ByteSubTransform(), _AESInfo::encipher_key, FinalizeRoundKey(), InitializeRoundKey(), ResetWizardMemory(), RotateLeft(), _AESInfo::rounds, and SBox.
Referenced by AcquireCipherInfo().
|
static |
Definition at line 258 of file aes.c.
Referenced by DecipherAESBlock(), and EncipherAESBlock().
WizardExport unsigned int GetAESBlocksize | ( | const AESInfo * | aes_info | ) |
Definition at line 653 of file aes.c.
References _AESInfo::blocksize, CipherDomain, GetWizardModule, LogWizardEvent(), _AESInfo::signature, TraceEvent, WizardAssert, and WizardSignature.
Referenced by AcquireCipherInfo().
|
static |
Definition at line 287 of file aes.c.
Referenced by DecipherAESBlock(), and EncipherAESBlock().
|
inlinestatic |
|
inlinestatic |
Definition at line 314 of file aes.c.
Referenced by DecipherAESBlock(), and EncipherAESBlock().
|
inlinestatic |
WizardExport void SetAESKey | ( | AESInfo * | aes_info, |
const StringInfo * | key | ||
) |
Definition at line 722 of file aes.c.
References AESBlocksize, ByteSubTransform(), CipherDomain, CopyWizardMemory(), _AESInfo::decipher_key, _AESInfo::encipher_key, GetStringInfoDatum(), GetStringInfoLength(), GetWizardModule, InverseAddRoundKey(), _AESInfo::key, LogWizardEvent(), Min, ResetWizardMemory(), RotateRight, _AESInfo::rounds, SBox, _AESInfo::signature, TraceEvent, WizardAssert, WizardSignature, and XTime().
Referenced by SetCipherKey().
|
inlinestatic |
Definition at line 706 of file aes.c.
Referenced by SetAESKey().
|
static |
Definition at line 80 of file aes.c.
Referenced by ByteMultiply().
|
static |
Definition at line 102 of file aes.c.
Referenced by ByteMultiply().
|
static |
Definition at line 124 of file aes.c.
Referenced by EncipherAESBlock(), and SetAESKey().