CalculateSha1

nn::crypto::CalculateSha1 Function

Syntax

void CalculateSha1(
     void * pOut,
     const void * pData,
     size_t size
);

Parameters

Name Description
out pOut Pointer to the location in which to store the SHA-1 value (4-byte alignment)
in pData Pointer to the input data.
in size Length of the input data.

Return Values

None.

Description

Utility function that encompasses a sequence of operations used for SHA-1 calculation.

pOut is a 4-byte aligned pointer. It requires Sha1Context::HASH_SIZE (=20) bytes of space as the destination for storing the indicated hash.

This function can only calculate the hash for a single clump of data. It thus cannot be used to calculate hashes for data that is read by means of multiple updates, such as streaming data.

Revision History

2011/03/04
Added note about 4-byte alignment restriction.
2010/01/07
Initial version.

CONFIDENTIAL