|
MagickCore 7.0.10
|
#include "wizard/studio.h"#include "wizard/aes.h"#include "wizard/chacha.h"#include "wizard/cipher.h"#include "wizard/exception.h"#include "wizard/exception-private.h"#include "wizard/memory_.h"#include "wizard/random_.h"#include "wizard/serpent.h"#include "wizard/twofish.h"Go to the source code of this file.
Data Structures | |
| struct | _CipherInfo |
Macros | |
| #define | CipherRandomHash SHA2256Hash |
Typedefs | |
| typedef void(* | DecipherBlock) (void *, const unsigned char *, const unsigned char *) |
| typedef void(*)(* | EncipherBlock) (void *, const unsigned char *, const unsigned char *) |
| #define CipherRandomHash SHA2256Hash |
| typedef void(* DecipherBlock) (void *, const unsigned char *, const unsigned char *) |
| typedef void(*)(* EncipherBlock) (void *, const unsigned char *, const unsigned char *) |
| WizardExport CipherInfo * AcquireCipherInfo | ( | const CipherType | cipher, |
| const CipherMode | mode | ||
| ) |
Definition at line 134 of file cipher.c.
References AcquireAESInfo(), AcquireChachaInfo(), AcquireRandomInfo(), AcquireSerpentInfo(), AcquireTwofishInfo(), AcquireWizardMemory(), AESCipher, _CipherInfo::blocksize, ChachaCipher, _CipherInfo::cipher, CipherDomain, CipherRandomHash, _CipherInfo::decipher_block, DecipherAESBlock(), DecipherChachaBlock(), DecipherSerpentBlock(), DecipherTwofishBlock(), DestroyStringInfo(), _CipherInfo::encipher_block, EncipherAESBlock(), EncipherChachaBlock(), EncipherSerpentBlock(), EncipherTwofishBlock(), EnumerateError, GenerateCipherNonce(), GetAESBlocksize(), GetChachaBlocksize(), GetSerpentBlocksize(), GetTwofishBlocksize(), _CipherInfo::handle, MemoryError, _CipherInfo::mode, _CipherInfo::nonce, _CipherInfo::random_info, SerpentCipher, _CipherInfo::signature, ThrowWizardFatalError, _CipherInfo::timestamp, TwofishCipher, and WizardSignature.
Referenced by AcquireKeyInfo(), and AcquireSecretInfo().
|
static |
Definition at line 237 of file cipher.c.
References _CipherInfo::blocksize, CipherDomain, _CipherInfo::decipher_block, GetStringInfoDatum(), GetStringInfoLength(), GetWizardModule, _CipherInfo::handle, LogWizardEvent(), MaxCipherBlocksize, _CipherInfo::nonce, ResetWizardMemory(), _CipherInfo::signature, TraceEvent, WizardAssert, and WizardSignature.
Referenced by DecipherCipher().
|
static |
Definition at line 319 of file cipher.c.
References _CipherInfo::blocksize, CipherDomain, _CipherInfo::encipher_block, GetStringInfoDatum(), GetStringInfoLength(), GetWizardModule, _CipherInfo::handle, LogWizardEvent(), MaxCipherBlocksize, _CipherInfo::nonce, ResetWizardMemory(), _CipherInfo::signature, TraceEvent, WizardAssert, and WizardSignature.
Referenced by DecipherCipher().
| WizardExport StringInfo * DecipherCipher | ( | CipherInfo * | cipher_info, |
| StringInfo * | ciphertext | ||
| ) |
Definition at line 405 of file cipher.c.
References CBCMode, CFBMode, CipherDomain, CTRMode, DecipherCBCMode(), DecipherCFBMode(), DecipherCTRMode(), DecipherECBMode(), DecipherOFBMode(), ECBMode, EnumerateError, GetWizardModule, LogWizardEvent(), _CipherInfo::mode, OFBMode, _CipherInfo::signature, ThrowWizardFatalError, TraceEvent, WizardAssert, and WizardSignature.
Referenced by AuthenticateSecretKey(), DecryptCipher(), and GetKeyInfo().
|
static |
Definition at line 497 of file cipher.c.
References _CipherInfo::blocksize, CipherDomain, _CipherInfo::encipher_block, GetStringInfoDatum(), GetStringInfoLength(), GetWizardModule, _CipherInfo::handle, IncrementCipherNonce(), LogWizardEvent(), MaxCipherBlocksize, _CipherInfo::nonce, ResetWizardMemory(), _CipherInfo::signature, TraceEvent, WizardAssert, and WizardSignature.
Referenced by DecipherCipher().
| static StringInfo * DecipherECBMode | ( | CipherInfo * | cipher_info, |
| StringInfo * | ciphertext | ||
| ) |
Definition at line 576 of file cipher.c.
References _CipherInfo::blocksize, CipherDomain, _CipherInfo::decipher_block, GetStringInfoDatum(), GetStringInfoLength(), GetWizardModule, _CipherInfo::handle, LogWizardEvent(), MaxCipherBlocksize, _CipherInfo::signature, TraceEvent, WizardAssert, and WizardSignature.
Referenced by DecipherCipher().
| static StringInfo * DecipherOFBMode | ( | CipherInfo * | cipher_info, |
| StringInfo * | ciphertext | ||
| ) |
Definition at line 635 of file cipher.c.
References _CipherInfo::blocksize, CipherDomain, _CipherInfo::encipher_block, GetStringInfoDatum(), GetStringInfoLength(), GetWizardModule, _CipherInfo::handle, LogWizardEvent(), MaxCipherBlocksize, _CipherInfo::nonce, ResetWizardMemory(), _CipherInfo::signature, TraceEvent, WizardAssert, and WizardSignature.
Referenced by DecipherCipher().
| WizardExport StringInfo * DecryptCipher | ( | CipherInfo * | cipher_info, |
| StringInfo * | plaintext | ||
| ) |
Definition at line 399 of file cipher.c.
References DecipherCipher().
| WizardExport CipherInfo * DestroyCipherInfo | ( | CipherInfo * | cipher_info | ) |
Definition at line 703 of file cipher.c.
References AESCipher, ChachaCipher, _CipherInfo::cipher, CipherDomain, DestroyAESInfo(), DestroyChachaInfo(), DestroyRandomInfo(), DestroySerpentInfo(), DestroyStringInfo(), DestroyTwofishInfo(), EnumerateError, GetWizardModule, _CipherInfo::handle, LogWizardEvent(), _CipherInfo::nonce, _CipherInfo::random_info, RelinquishWizardMemory(), SerpentCipher, _CipherInfo::signature, ThrowWizardFatalError, TraceEvent, TwofishCipher, WizardAssert, and WizardSignature.
Referenced by DestroyKeyInfo(), and DestroySecretInfo().
|
static |
Definition at line 775 of file cipher.c.
References _CipherInfo::blocksize, CipherDomain, _CipherInfo::encipher_block, GetStringInfoDatum(), GetStringInfoLength(), GetWizardModule, _CipherInfo::handle, LogWizardEvent(), MaxCipherBlocksize, _CipherInfo::nonce, _CipherInfo::random_info, ResetWizardMemory(), SetRandomKey(), _CipherInfo::signature, TraceEvent, WizardAssert, and WizardSignature.
Referenced by EncipherCipher().
|
static |
Definition at line 860 of file cipher.c.
References _CipherInfo::blocksize, CipherDomain, _CipherInfo::encipher_block, GetStringInfoDatum(), GetStringInfoLength(), GetWizardModule, _CipherInfo::handle, LogWizardEvent(), MaxCipherBlocksize, _CipherInfo::nonce, ResetWizardMemory(), _CipherInfo::signature, TraceEvent, WizardAssert, and WizardSignature.
Referenced by EncipherCipher().
| WizardExport StringInfo * EncipherCipher | ( | CipherInfo * | cipher_info, |
| StringInfo * | plaintext | ||
| ) |
Definition at line 946 of file cipher.c.
References CBCMode, CFBMode, CipherDomain, CTRMode, ECBMode, EncipherCBCMode(), EncipherCFBMode(), EncipherCTRMode(), EncipherECBMode(), EncipherOFBMode(), EnumerateError, GetWizardModule, LogWizardEvent(), _CipherInfo::mode, OFBMode, _CipherInfo::signature, ThrowWizardFatalError, TraceEvent, WizardAssert, and WizardSignature.
Referenced by EncryptCipher(), GenerateSecretKey(), and SetKeyInfo().
| static StringInfo * EncipherCTRMode | ( | CipherInfo * | cipher_info, |
| StringInfo * | plaintext | ||
| ) |
Definition at line 1022 of file cipher.c.
References _CipherInfo::blocksize, CipherDomain, _CipherInfo::encipher_block, GetStringInfoDatum(), GetStringInfoLength(), GetWizardModule, _CipherInfo::handle, IncrementCipherNonce(), LogWizardEvent(), MaxCipherBlocksize, _CipherInfo::nonce, _CipherInfo::random_info, ResetWizardMemory(), SetRandomKey(), _CipherInfo::signature, TraceEvent, WizardAssert, and WizardSignature.
Referenced by EncipherCipher().
| static StringInfo * EncipherECBMode | ( | CipherInfo * | cipher_info, |
| StringInfo * | plaintext | ||
| ) |
Definition at line 1108 of file cipher.c.
References _CipherInfo::blocksize, CipherDomain, _CipherInfo::encipher_block, GetStringInfoDatum(), GetStringInfoLength(), GetWizardModule, _CipherInfo::handle, LogWizardEvent(), MaxCipherBlocksize, _CipherInfo::random_info, SetRandomKey(), _CipherInfo::signature, TraceEvent, WizardAssert, and WizardSignature.
Referenced by EncipherCipher().
| static StringInfo * EncipherOFBMode | ( | CipherInfo * | cipher_info, |
| StringInfo * | plaintext | ||
| ) |
Definition at line 1173 of file cipher.c.
References _CipherInfo::blocksize, CipherDomain, _CipherInfo::encipher_block, GetStringInfoDatum(), GetStringInfoLength(), GetWizardModule, _CipherInfo::handle, LogWizardEvent(), MaxCipherBlocksize, _CipherInfo::nonce, _CipherInfo::random_info, ResetWizardMemory(), SetRandomKey(), _CipherInfo::signature, TraceEvent, WizardAssert, and WizardSignature.
Referenced by EncipherCipher().
| WizardExport StringInfo * EncryptCipher | ( | CipherInfo * | cipher_info, |
| StringInfo * | plaintext | ||
| ) |
Definition at line 940 of file cipher.c.
References EncipherCipher().
| WizardExport StringInfo * GenerateCipherNonce | ( | CipherInfo * | cipher_info | ) |
Definition at line 1278 of file cipher.c.
References AcquireStringInfo(), _CipherInfo::blocksize, CBCMode, CFBMode, CipherDomain, CTRMode, ECBMode, EnumerateError, GetRandomKey(), GetStringInfoDatum(), GetWizardModule, LogWizardEvent(), _CipherInfo::mode, OFBMode, _CipherInfo::random_info, ResetStringInfo(), SetRandomKey(), _CipherInfo::signature, ThrowWizardFatalError, TraceEvent, WizardAssert, and WizardSignature.
Referenced by AcquireCipherInfo(), AcquireKeyInfo(), and AcquireSecretInfo().
| WizardExport size_t GetCipherBlocksize | ( | const CipherInfo * | cipher_info | ) |
Definition at line 1248 of file cipher.c.
References _CipherInfo::blocksize, CipherDomain, GetWizardModule, LogWizardEvent(), _CipherInfo::signature, TraceEvent, WizardAssert, and WizardSignature.
| WizardExport const StringInfo * GetCipherNonce | ( | CipherInfo * | cipher_info | ) |
Definition at line 1332 of file cipher.c.
References CipherDomain, GetWizardModule, LogWizardEvent(), _CipherInfo::nonce, _CipherInfo::signature, TraceEvent, WizardAssert, and WizardSignature.
|
inlinestatic |
Definition at line 482 of file cipher.c.
References CipherFatalError, and ThrowFatalException.
Referenced by DecipherCTRMode(), and EncipherCTRMode().
| WizardExport void ResetCipherNonce | ( | CipherInfo * | cipher_info | ) |
Definition at line 1362 of file cipher.c.
References CipherDomain, GetWizardModule, LogWizardEvent(), _CipherInfo::nonce, ResetStringInfo(), _CipherInfo::signature, TraceEvent, WizardAssert, and WizardSignature.
| WizardExport void SetCipherKey | ( | CipherInfo * | cipher_info, |
| const StringInfo * | key | ||
| ) |
Definition at line 1429 of file cipher.c.
References AESCipher, ChachaCipher, _CipherInfo::cipher, CipherDomain, EnumerateError, GetWizardModule, _CipherInfo::handle, LogWizardEvent(), SerpentCipher, SetAESKey(), SetChachaKey(), SetSerpentKey(), SetTwofishKey(), _CipherInfo::signature, ThrowWizardFatalError, TraceEvent, TwofishCipher, WizardAssert, and WizardSignature.
Referenced by AuthenticateSecretKey(), GenerateSecretKey(), GetKeyInfo(), and SetKeyInfo().
| WizardExport void SetCipherNonce | ( | CipherInfo * | cipher_info, |
| const StringInfo * | nonce | ||
| ) |
Definition at line 1394 of file cipher.c.
References CipherDomain, GetWizardModule, LogWizardEvent(), _CipherInfo::nonce, SetStringInfo(), _CipherInfo::signature, TraceEvent, WizardAssert, and WizardSignature.
Referenced by AuthenticateSecretKey(), GenerateSecretKey(), GetKeyInfo(), and SetKeyInfo().