BCryptHash function (bcrypt.h)
NTSTATUS BCryptHash( BCRYPT_ALG_HANDLE hAlgorithm, PUCHAR pbSecret, ULONG cbSecret, PUCHAR pbInput, ULONG cbInput, PUCHAR pbOutput, ULONG cbOutput );
The handle of an algorithm provider created by using the BCryptOpenAlgorithmProvider function. The algorithm that was specified when the provider was created must support the hash interface.
A pointer to a buffer that contains the key to use for the hash or MAC. The cbSecret parameter contains the size of this buffer. This key only applies to hash algorithms opened by the BCryptOpenAlgorithmProvider function by using the BCRYPT_ALG_HANDLE_HMAC flag. Otherwise, set this parameter to NULL
The size, in bytes, of the pbSecret buffer. If no key is used, set this parameter to zero.
A pointer to a buffer that contains the data to process. The cbInput parameter contains the number of bytes in this buffer. This function does not modify the contents of this buffer.
The number of bytes in the pbInput buffer.
A pointer to a buffer that receives the hash or MAC value. The cbOutput parameter contains the size of this buffer.
The size, in bytes, of the pbOutput buffer. This size must exactly match the size of the hash or MAC value.
The size can be obtained by calling the BCryptGetProperty function to get the BCRYPT_HASH_LENGTH property. This will provide the size of the hash or MAC value for the specified algorithm.
A status code indicating success or failure.
|Minimum supported client||Windows 10 [desktop apps | UWP apps]|
|Minimum supported server||Windows Server 2016 [desktop apps | UWP apps]|