please dont rip this site Prev Next

CryptHashData info  Overview  Group

The CryptHashData function is used to compute the cryptographic hash on a stream of data. This function and CryptHashSessionKey can be called multiple times to compute the hash on long streams or on discontinuous streams.

Before calling this function, the CryptCreateHash function must be called to get a handle to a hash object.



    BYTE *pbData,

    DWORD dwDataLen,

    DWORD dwFlags



[in] A handle to the hash object. An application obtains this handle using the CryptCreateHash function.
[in] The address of the data to be hashed.
[in] The number of bytes of data to be hashed. This must be zero if the CRYPT_USERDATA flag is set.
[in] The flag values. The following values are currently defined:

The Microsoft RSA Base Provider ignores this parameter.

Return Values

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To retrieve extended error information, use the GetLastError function.

The following table lists the error codes most commonly returned by the GetLastError function. The error codes prefaced by “NTE” are generated by the particular CSP you are using.




One of the parameters specifies an invalid handle.


One of the parameters contains an invalid value. This is most often an illegal pointer.


The hHash handle specifies an algorithm that this CSP does not support.


The dwFlags parameter contains an invalid value.


The hash object specified by the hHash parameter is invalid.


An attempt was made to add data to a hash object that is already marked “finished.”


A keyed hash algorithm is being used, but the session key is no longer valid. This error will be generated if the session key is destroyed before the hashing operating is complete.


The CRYPT_USERDATA flag is set and the dwDataLen parameter has a nonzero value.


The CSP context that was specified when the hash object was created cannot be found.


The function failed in some unexpected way.


The CSP ran out of memory during the operation.


See the “Example” section in the CryptSignHash function.

See Also

CryptCreateHash, CryptHashSessionKey, CryptSignHash 

file: /Techref/os/win/api/win32/func/src/f12_11.htm, 6KB, , updated: 2000/4/7 12:19, local time: 2023/6/1 21:55,

 ©2023 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE!

<A HREF=""> CryptHashData Release 2]</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.

Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?

  PICList 2023 contributors:
o List host: MIT, Site host, Top posters @none found
- Page Editors: James Newton, David Cary, and YOU!
* Roman Black of Black Robotics donates from sales of Linistep stepper controller kits.
* Ashley Roll of Digital Nemesis donates from sales of RCL-1 RS232 to TTL converters.
* Monthly Subscribers: Gregg Rew. on-going support is MOST appreciated!
* Contributors: Richard Seriani, Sr.

Welcome to!