49 global::Interop.BCrypt.BCryptAlgPseudoHandle bCryptAlgPseudoHandle;
51 switch (hashAlgorithmId)
54 bCryptAlgPseudoHandle = (isHmac ? global::Interop.BCrypt.BCryptAlgPseudoHandle.BCRYPT_HMAC_MD5_ALG_HANDLE : global::Interop.BCrypt.BCryptAlgPseudoHandle.BCRYPT_MD5_ALG_HANDLE);
58 bCryptAlgPseudoHandle = (isHmac ? global::Interop.BCrypt.BCryptAlgPseudoHandle.BCRYPT_HMAC_SHA1_ALG_HANDLE : global::Interop.BCrypt.BCryptAlgPseudoHandle.BCRYPT_SHA1_ALG_HANDLE);
62 bCryptAlgPseudoHandle = (isHmac ? global::Interop.BCrypt.BCryptAlgPseudoHandle.BCRYPT_HMAC_SHA256_ALG_HANDLE : global::Interop.BCrypt.BCryptAlgPseudoHandle.BCRYPT_SHA256_ALG_HANDLE);
66 bCryptAlgPseudoHandle = (isHmac ? global::Interop.BCrypt.BCryptAlgPseudoHandle.BCRYPT_HMAC_SHA384_ALG_HANDLE : global::Interop.BCrypt.BCryptAlgPseudoHandle.BCRYPT_SHA384_ALG_HANDLE);
70 bCryptAlgPseudoHandle = (isHmac ? global::Interop.BCrypt.BCryptAlgPseudoHandle.BCRYPT_HMAC_SHA512_ALG_HANDLE : global::Interop.BCrypt.BCryptAlgPseudoHandle.BCRYPT_SHA512_ALG_HANDLE);
86 global::Interop.BCrypt.NTSTATUS nTSTATUS = global::Interop.BCrypt.BCryptHash((nuint)bCryptAlgPseudoHandle, pbSecret,
key.Length, pbInput,
source.Length, pbOutput, num);
89 throw global::Interop.BCrypt.CreateCryptographicException(nTSTATUS);
99 global::Interop.BCrypt.NTSTATUS nTSTATUS = global::Interop.BCrypt.BCryptCreateHash(algHandle, out var phHash,
IntPtr.
Zero, 0,
key,
key.Length, global::Interop.BCrypt.BCryptCreateHashFlags.None);
103 throw global::Interop.BCrypt.CreateCryptographicException(nTSTATUS);
107 nTSTATUS = global::Interop.BCrypt.BCryptHashData(phHash,
source,
source.Length, 0);
110 throw global::Interop.BCrypt.CreateCryptographicException(nTSTATUS);
112 global::Interop.BCrypt.BCryptFinishHash(phHash,
destination, hashSize, 0);