Defines | Typedefs | Enumerations | Functions

# cipher.h File Reference

`#include "wizard/random_.h"`

Go to the source code of this file.

## Defines

#define | MaxCipherBlocksize 128

## Typedefs

typedef struct _CipherInfo | CipherInfo

## Enumerations

enum | CipherMode { UndefinedMode, CBCMode, CFBMode, CTRMode, ECBMode, OFBMode }
enum | CipherType { UndefinedCipher, NoCipher, AESCipher, SerpentCipher, TwofishCipher }

## Functions

WizardExport CipherInfo * | AcquireCipherInfo (const CipherType, const CipherMode)
WizardExport CipherInfo ** | DestroyCipherInfo (CipherInfo *)
WizardExport const StringInfo * | GetCipherNonce (CipherInfo *)
WizardExport StringInfo * | DecipherCipher (CipherInfo *, StringInfo *)
WizardExport StringInfo ** | EncipherCipher (CipherInfo *, StringInfo *)
WizardExport StringInfo *** | GenerateCipherNonce (CipherInfo *)
WizardExport size_t | GetCipherBlocksize (const CipherInfo *)
WizardExport void | ResetCipherNonce (CipherInfo *)
WizardExport void | SetCipherNonce (CipherInfo *, const StringInfo *)
WizardExport void | SetCipherKey (CipherInfo *, const StringInfo *)
WizardExport StringInfo * | DecryptCipher (CipherInfo *, StringInfo *)
WizardExport StringInfo ** | EncryptCipher (CipherInfo *, StringInfo *)

## Define Documentation

#define MaxCipherBlocksize 128

Referenced by AcquireStringInfo(), CloneStringInfo(), ConfigureFileToStringInfo(), DecipherCBCMode(), DecipherCFBMode(), DecipherCTRMode(), DecipherECBMode(), DecipherOFBMode(), EncipherCBCMode(), EncipherCFBMode(), EncipherCTRMode(), EncipherECBMode(), EncipherOFBMode(), FileToBlob(), SetStringInfoLength(), and SplitStringInfo().

## Typedef Documentation

typedef struct _CipherInfo CipherInfo

## Enumeration Type Documentation

enum CipherMode

Enumerator:

  UndefinedMode |
  CBCMode |
  CFBMode |
  CTRMode |
  ECBMode |
  OFBMode |

enum CipherType

Enumerator:

  UndefinedCipher |
  NoCipher |
  AESCipher |
  SerpentCipher |
  TwofishCipher |

## Function Documentation

WizardExport CipherInfo* AcquireCipherInfo | ( | const | CipherType,
|  | const | CipherMode |
| ) |  |  |

WizardExport StringInfo* DecipherCipher | ( | CipherInfo * | ,
|  | StringInfo * |  |
| ) |  |  |

WizardExport StringInfo* DecryptCipher | ( | CipherInfo * | ,
|  | StringInfo * |  |
| ) |  |  |

WizardExport CipherInfo* * DestroyCipherInfo | ( | CipherInfo * |  | ) |

References AESCipher, _CipherInfo::cipher, CipherDomain, DestroyAESInfo(), 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().

WizardExport StringInfo* * EncipherCipher | ( | CipherInfo * | ,
|  | StringInfo * |  |
| ) |  |  |

WizardExport StringInfo* * EncryptCipher | ( | CipherInfo * | ,
|  | StringInfo * |  |
| ) |  |  |

References EncipherCipher().

WizardExport StringInfo* * * GenerateCipherNonce | ( | CipherInfo * |  | ) |

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 * |  | ) |

References _CipherInfo::blocksize, CipherDomain, GetWizardModule, LogWizardEvent(), _CipherInfo::signature, TraceEvent, WizardAssert, and WizardSignature.

WizardExport const StringInfo* GetCipherNonce | ( | CipherInfo * |  | ) |

References CipherDomain, GetWizardModule, LogWizardEvent(), _CipherInfo::nonce, _CipherInfo::signature, TraceEvent, WizardAssert, and WizardSignature.

WizardExport void ResetCipherNonce | ( | CipherInfo * |  | ) |

WizardExport void SetCipherKey | ( | CipherInfo * | ,
|  | const StringInfo * |  |
| ) |  |  |

References AESCipher, _CipherInfo::cipher, CipherDomain, EnumerateError, GetWizardModule, _CipherInfo::handle, LogWizardEvent(), SerpentCipher, SetAESKey(), SetSerpentKey(), SetTwofishKey(), _CipherInfo::signature, ThrowWizardFatalError, TraceEvent, TwofishCipher, WizardAssert, and WizardSignature.

Referenced by AuthenticateSecretKey(), GenerateSecretKey(), GetKeyInfo(), and SetKeyInfo().

WizardExport void SetCipherNonce | ( | CipherInfo * | ,
|  | const StringInfo * |  |
| ) |  |  |