Visible to Intel only — GUID: GUID-FDBA9A6A-E721-4DFC-8C56-F8E561A4E17B
Visible to Intel only — GUID: GUID-FDBA9A6A-E721-4DFC-8C56-F8E561A4E17B
Hash Functions
Functions described in this section apply hash algorithms to digesting streaming messages.
Usage model of the generalized hash functions is similar to the model explained below.
A primitive implementing a hash algorithm uses the state context IppsHashState as an operational vehicle to carry all necessary variables to manage the computation of the chaining digest value.
The following example illustrates how the application code can apply the implemented SHA-1 hash standard to digest the input message stream.
Call the function HashGetSize to get the size required to configure the IppsHashState context.
Ensure that the required memory space is properly allocated. With the allocated memory, call the HashInit function with the value of hashAlg equal to ippHashAlg_SHA1 to set up the initial context state with the SHA-1 specified initialization vectors.
Keep calling the function HashUpdate to digest incoming message stream in the queue till its completion. To determine the current value of the digest, call HashGetTag between the two calls to HashUpdate.
Call the function HashFinal to pad the partial block into a final SHA-1 message block and transform it into a 160-bit message digest value.
- Clean up secret data stored in the context.
Call the operating system memory free service function to release the IppsSHA1StateIppsHashState context.
The IppsHashState context is position-dependent. The HashPack, HashUnpack functions transform this context to a position-independent form and vice versa.
For memory-critical applications, consider using Reduced Memory Footprint Functions.
The crypto community does not consider SHA-1 or MD5 algorithms secure anymore.
Recommendation: use a more secure hash algorithm (for example, any algorithm from the SHA-2 family) instead of SHA-1 or MD5.
- HashGetSize
Gets the size of the IppsHashState or IppsHashState_rmf context in bytes. - HashInit
Initializes user-supplied memory as IppsHashState or IppsHashState_rmf context for future use. - HashPack, HashUnpack
Packs/unpacks the IppsHashState or IppsHashState_rmf context into/from a user-defined buffer. - HashDuplicate
Copies one IppsHashState or IppsHashState_rmf context to another. - HashUpdate
Digests the current input message stream of the specified length. - HashFinal
Completes computation of the digest value. - HashGetTag
Computes the current digest value of the processed part of the message. - HashMethod
Returns a pointer to a pre-defined hash algorithm. - HashMethodSet
Initializes IppsHashMethod structure by pre-defined hash algorithm parameters. - HashMethodGetSize
Gets the size of the IppsHashMethod context in bytes. - SM3GetSize
Gets the size of the IppsSM3State context in bytes. - SM3Init
Initializes user-supplied memory as IppsSM3State context for future use. - SM3Pack, SM3Unpack
Packs/unpacks the IppsSM3State context into/from a user-defined buffer. - SM3Duplicate
Copies one IppsSM3State context to another. - SM3Update
Digests the current input message stream of the specified length. - SM3Final
Completes computation of the SM3 digest value. - SM3GetTag
Computes the current SM3 digest value of the processed part of the message. - MD5GetSize
Gets the size of the IppsMD5State context in bytes (deprecated). - MD5Init
Initializes user-supplied memory as IppsMD5State context for future use (deprecated). - MD5Pack, MD5Unpack
Packs/unpacks the IppsMD5State context into/from a user-defined buffer (deprecated). - MD5Duplicate
Copies one IppsMD5State context to another (deprecated). - MD5Update
Digests the current input message stream of the specified length (deprecated). - MD5Final
Completes computation of the MD5 digest value (deprecated). - MD5GetTag
Computes the current MD5 digest value of the processed part of the message (deprecated). - SHA1GetSize
Gets the size of the IppsSHA1State context in bytes. - SHA1Init
Initializes user-supplied memory as IppsSHA1State context for future use. - SHA1Pack, SHA1Unpack
Packs/unpacks the IppsSHA1State context into/from a user-defined buffer. - SHA1Duplicate
Copies one IppsSHA1State context to another. - SHA1Update
Digests the current input message stream of the specified length. - SHA1Final
Completes computation of the SHA-1 digest value. - SHA1GetTag
Computes the current SHA-1 digest value of the processed part of the message. - SHA224GetSize
Gets the size of the IppsSHA224State context in bytes. - SHA224Init
Initializes user-supplied memory as IppsSHA224State context for future use. - SHA224Pack, SHA224Unpack
Packs/unpacks the IppsSHA224State context into/from a user-defined buffer. - SHA224Duplicate
Copies one IppsSHA224State context to another. - SHA224Update
Digests the current input message stream of the specified length. - SHA224Final
Completes computation of the SHA-224 digest value. - SHA224GetTag
Computes the current SHA-224 digest value of the processed part of the message. - SHA256GetSize
Gets the size of the IppsSHA256State context in bytes. - SHA256Init
Initializes user-supplied memory as IppsSHA256State context for future use. - SHA256Pack, SHA256Unpack
Packs/unpacks the IppsSHA256State context into/from a user-defined buffer. - SHA256Duplicate
Copies one IppsSHA256State context to another. - SHA256Update
Digests the current input message stream of the specified length. - SHA256Final
Completes computation of the SHA-256 digest value. - SHA256GetTag
Computes the current SHA-256 digest value of the processed part of the message. - SHA384GetSize
Gets the size of the IppsSHA384State context in bytes. - SHA384Init
Initializes user-supplied memory as IppsSHA384State context for future use. - SHA384Pack, SHA384Unpack
Packs/unpacks the IppsSHA384State context into/from a user-defined buffer. - SHA384Duplicate
Copies one IppsSHA384State context to another. - SHA384Update
Digests the current input message stream of the specified length. - SHA384Final
Completes computing of the SHA-384 digest value. - SHA384GetTag
Computes the current SHA-384 digest value of the processed part of the message. - SHA512GetSize
Gets the size of the IppsSHA512State context in bytes. - SHA512Init
Initializes user-supplied memory as IppsSHA512State context for future use. - SHA512Pack, SHA512Unpack
Packs/unpacks the IppsSHA512State context into/from a user-defined buffer. - SHA512Duplicate
Copies one IppsSHA512State context to another. - SHA512Update
Digests the current input message stream of the specified length. - SHA512Final
Completes computation of the SHA-512 digest value. - SHA512GetTag
Computes the current SHA-512 digest value of the processed part of the message.
See Also
Did you find the information on this page useful?
Feedback Message
Characters remaining: