hasherfrog
23-11-2006, 00:12
Вот текст:
HCRYPTPROV hCryptProv;
HCRYPTKEY hKey;
HCRYPTHASH hHash;
//--------------------------------------------------------------------
// Get a handle to the default provider.
if(!CryptAcquireContext(&hCryptProv, NULL, MS_ENHANCED_PROV, PROV_RSA_FULL, 0))
MyHandleError("Error during CryptAcquireContext!");
//--------------------------------------------------------------------
// Create a hash object.
if(!CryptCreateHash(hCryptProv, CALG_MD5, 0, 0, &hHash))
MyHandleError("Error during CryptCreateHash!");
//Теперь внимание!
BYTE Data[20] = { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0 };
DWORD wDataLen = 20;
CryptGetHashParam(hHash, HP_HASHSIZE, 0, &wDataLen, 0);
printf("size: %d\n", wDataLen);
Почему размер получается 4???
HCRYPTPROV hCryptProv;
HCRYPTKEY hKey;
HCRYPTHASH hHash;
//--------------------------------------------------------------------
// Get a handle to the default provider.
if(!CryptAcquireContext(&hCryptProv, NULL, MS_ENHANCED_PROV, PROV_RSA_FULL, 0))
MyHandleError("Error during CryptAcquireContext!");
//--------------------------------------------------------------------
// Create a hash object.
if(!CryptCreateHash(hCryptProv, CALG_MD5, 0, 0, &hHash))
MyHandleError("Error during CryptCreateHash!");
//Теперь внимание!
BYTE Data[20] = { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0 };
DWORD wDataLen = 20;
CryptGetHashParam(hHash, HP_HASHSIZE, 0, &wDataLen, 0);
printf("size: %d\n", wDataLen);
Почему размер получается 4???