29 global::Interop.BCrypt.BCryptOpenAlgorithmProviderFlags bCryptOpenAlgorithmProviderFlags = global::Interop.BCrypt.BCryptOpenAlgorithmProviderFlags.None;
33 bCryptOpenAlgorithmProviderFlags |= global::Interop.BCrypt.BCryptOpenAlgorithmProviderFlags.BCRYPT_ALG_HANDLE_HMAC_FLAG;
35 _hAlgorithm = global::Interop.BCrypt.BCryptAlgorithmCache.GetCachedBCryptAlgorithmHandle(hashAlgId, bCryptOpenAlgorithmProviderFlags, out
_hashSize);
37 global::Interop.BCrypt.NTSTATUS nTSTATUS = global::Interop.BCrypt.BCryptCreateHash(
_hAlgorithm, out phHash,
IntPtr.
Zero, 0,
key, (!(
key ==
null)) ?
key.Length : 0, global::Interop.BCrypt.BCryptCreateHashFlags.BCRYPT_HASH_REUSABLE_FLAG);
40 case global::Interop.BCrypt.NTSTATUS.STATUS_INVALID_PARAMETER:
46 throw global::Interop.BCrypt.CreateCryptographicException(nTSTATUS);
47 case global::Interop.BCrypt.NTSTATUS.STATUS_SUCCESS: