Data Structures | Functions

# hash.c File Reference

`#include "wizard/studio.h"`
`#include "wizard/crc64.h"`
`#include "wizard/exception.h"`
`#include "wizard/exception-private.h"`
`#include "wizard/hash.h"`
`#include "wizard/memory_.h"`
`#include "wizard/md5.h"`
`#include "wizard/sha1.h"`
`#include "wizard/sha224.h"`
`#include "wizard/sha256.h"`
`#include "wizard/sha384.h"`
`#include "wizard/sha512.h"`

## Data Structures
struct | _HashInfo
## Functions
WizardExport HashInfo * | AcquireHashInfo (const HashType hash)
WizardExport HashInfo * | DestroyHashInfo (HashInfo *hash_info)
WizardExport void | FinalizeHash (HashInfo *hash_info)
WizardExport size_t | GetHashBlocksize (const HashInfo *hash_info)
WizardExport const StringInfo * | GetHashDigest (const HashInfo *hash_info)
WizardExport size_t | GetHashDigestsize (const HashInfo *hash_info)
WizardExport char * | GetHashHexDigest (const HashInfo *hash_info)
WizardExport void | InitializeHash (HashInfo *hash_info)
WizardExport void | UpdateHash (HashInfo *hash_info, const StringInfo *message)

## Function Documentation

WizardExport HashInfo* AcquireHashInfo | ( | const HashType | hash | ) |

References AcquireCRC64Info(), AcquireMD5Info(), AcquireSHA1Info(), AcquireSHA224Info(), AcquireSHA256Info(), AcquireSHA384Info(), AcquireSHA512Info(), AcquireStringInfo(), AcquireWizardMemory(), CRC64Hash, _HashInfo::digest, EnumerateError, GetCRC64Digestsize(), GetMD5Digestsize(), GetSHA1Digestsize(), GetSHA224Digestsize(), GetSHA256Digestsize(), GetSHA384Digestsize(), GetSHA512Digestsize(), _HashInfo::handle, _HashInfo::hash, HashDomain, MD5Hash, MemoryError, ResetStringInfo(), ResetWizardMemory(), SHA1Hash, SHA224Hash, SHA256Hash, SHA384Hash, SHA512Hash, _HashInfo::signature, ThrowWizardFatalError, and _HashInfo::timestamp.

Referenced by AcquireHMACInfo(), AcquireRandomInfo(), GetWizardMagick(), and HashStringType().

WizardExport HashInfo* DestroyHashInfo | ( | HashInfo * | hash_info | ) |

References CRC64Hash, DestroyCRC64Info(), DestroyMD5Info(), DestroySHA1Info(), DestroySHA224Info(), DestroySHA256Info(), DestroySHA384Info(), DestroySHA512Info(), DestroyStringInfo(), _HashInfo::digest, EnumerateError, GetWizardModule, _HashInfo::handle, _HashInfo::hash, HashDomain, LogWizardEvent(), MD5Hash, RelinquishWizardMemory(), SHA1Hash, SHA224Hash, SHA256Hash, SHA384Hash, SHA512Hash, _HashInfo::signature, ThrowWizardFatalError, TraceEvent, and WizardSignature.

Referenced by AcquireRandomInfo(), DestroyHMACInfo(), GetWizardMagick(), and HashStringType().

WizardExport void FinalizeHash | ( | HashInfo * | hash_info | ) |

References CRC64Hash, _HashInfo::digest, EnumerateError, FinalizeCRC64(), FinalizeMD5(), FinalizeSHA1(), FinalizeSHA224(), FinalizeSHA256(), FinalizeSHA384(), FinalizeSHA512(), GetCRC64Digest(), GetMD5Digest(), GetSHA1Digest(), GetSHA224Digest(), GetSHA256Digest(), GetSHA384Digest(), GetSHA512Digest(), GetWizardModule, _HashInfo::handle, _HashInfo::hash, HashDomain, LogWizardEvent(), MD5Hash, SetStringInfo(), SHA1Hash, SHA224Hash, SHA256Hash, SHA384Hash, SHA512Hash, _HashInfo::signature, ThrowWizardFatalError, TraceEvent, and WizardSignature.

Referenced by AcquireRandomInfo(), FinalizeHMAC(), GetWizardMagick(), HashStringType(), and InitializeHMAC().

WizardExport size_t GetHashBlocksize | ( | const HashInfo * | hash_info | ) |

References CipherDomain, CRC64Hash, EnumerateError, GetCRC64Blocksize(), GetMD5Blocksize(), GetSHA1Blocksize(), GetSHA224Blocksize(), GetSHA256Blocksize(), GetSHA384Blocksize(), GetSHA512Blocksize(), GetWizardModule, _HashInfo::handle, _HashInfo::hash, HashDomain, LogWizardEvent(), MD5Hash, SHA1Hash, SHA224Hash, SHA256Hash, SHA384Hash, SHA512Hash, _HashInfo::signature, ThrowWizardFatalError, TraceEvent, WizardAssert, and WizardSignature.

Referenced by AcquireHMACInfo().

WizardExport const StringInfo* GetHashDigest | ( | const HashInfo * | hash_info | ) |

References _HashInfo::digest, GetWizardModule, HashDomain, LogWizardEvent(), _HashInfo::signature, TraceEvent, WizardAssert, and WizardSignature.

Referenced by AcquireRandomInfo(), FinalizeHMAC(), GetWizardMagick(), HashStringType(), and InitializeHMAC().

WizardExport size_t GetHashDigestsize | ( | const HashInfo * | hash_info | ) |

References CipherDomain, CRC64Hash, EnumerateError, GetCRC64Digestsize(), GetMD5Digestsize(), GetSHA1Digestsize(), GetSHA224Digestsize(), GetSHA256Digestsize(), GetSHA384Digestsize(), GetSHA512Digestsize(), GetWizardModule, _HashInfo::handle, _HashInfo::hash, HashDomain, LogWizardEvent(), MD5Hash, SHA1Hash, SHA224Hash, SHA256Hash, SHA384Hash, SHA512Hash, _HashInfo::signature, ThrowWizardFatalError, TraceEvent, WizardAssert, and WizardSignature.

Referenced by AcquireHMACInfo(), AcquireRandomInfo(), GetHashHexDigest(), and GetHMACDigestsize().

WizardExport char* GetHashHexDigest | ( | const HashInfo * | hash_info | ) |

References AcquireQuantumMemory(), _HashInfo::digest, FormatWizardString(), GetHashDigestsize(), GetStringInfoDatum(), GetWizardModule, HashDomain, LogWizardEvent(), MaxTextExtent, MemoryError, _HashInfo::signature, ThrowWizardFatalError, TraceEvent, WizardAssert, and WizardSignature.

WizardExport void InitializeHash | ( | HashInfo * | hash_info | ) |

References CRC64Hash, EnumerateError, GetWizardModule, _HashInfo::handle, _HashInfo::hash, HashDomain, InitializeCRC64(), InitializeMD5(), InitializeSHA1(), InitializeSHA224(), InitializeSHA256(), InitializeSHA384(), InitializeSHA512(), LogWizardEvent(), MD5Hash, SHA1Hash, SHA224Hash, SHA256Hash, SHA384Hash, SHA512Hash, _HashInfo::signature, ThrowWizardFatalError, TraceEvent, and WizardSignature.

Referenced by FinalizeHMAC(), GetWizardMagick(), HashStringType(), InitializeHMAC(), and ResetHMAC().

WizardExport void UpdateHash | ( | HashInfo * | hash_info,
|  | const StringInfo * | message |
| ) |  |  |

References CRC64Hash, EnumerateError, GetWizardModule, _HashInfo::handle, _HashInfo::hash, HashDomain, LogWizardEvent(), MD5Hash, SHA1Hash, SHA224Hash, SHA256Hash, SHA384Hash, SHA512Hash, _HashInfo::signature, ThrowWizardFatalError, TraceEvent, UpdateCRC64(), UpdateMD5(), UpdateSHA1(), UpdateSHA224(), UpdateSHA256(), UpdateSHA384(), UpdateSHA512(), and WizardSignature.

Referenced by AcquireRandomInfo(), FinalizeHMAC(), GetWizardMagick(), HashStringType(), InitializeHMAC(), ResetHMAC(), and UpdateHMAC().