Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\LibraryImports.g.cs (118)
1237public static partial global::Interop.BCrypt.NTSTATUS BCryptOpenAlgorithmProvider(out global::Internal.NativeCrypto.SafeAlgorithmHandle phAlgorithm, string pszAlgId, string pszImplementation, int dwFlags)
1244global::Interop.BCrypt.NTSTATUS __retVal = default;
1275static extern unsafe global::Interop.BCrypt.NTSTATUS __PInvoke(nint* __phAlgorithm_native, ushort* __pszAlgId_native, ushort* __pszImplementation_native, int __dwFlags_native);
1288public static partial global::Interop.BCrypt.NTSTATUS BCryptSetProperty(global::Internal.NativeCrypto.SafeAlgorithmHandle hObject, string pszProperty, string pbInput, int cbInput, int dwFlags)
1293global::Interop.BCrypt.NTSTATUS __retVal = default;
1319static extern unsafe global::Interop.BCrypt.NTSTATUS __PInvoke(nint __hObject_native, ushort* __pszProperty_native, ushort* __pbInput_native, int __cbInput_native, int __dwFlags_native);
1332private static partial global::Interop.BCrypt.NTSTATUS BCryptSetIntPropertyPrivate(global::Microsoft.Win32.SafeHandles.SafeBCryptHandle hObject, string pszProperty, ref int pdwInput, int cbInput, int dwFlags)
1337global::Interop.BCrypt.NTSTATUS __retVal = default;
1363static extern unsafe global::Interop.BCrypt.NTSTATUS __PInvoke(nint __hObject_native, ushort* __pszProperty_native, int* __pdwInput_native, int __cbInput_native, int __dwFlags_native);
1376public static partial global::Interop.BCrypt.NTSTATUS BCryptSetProperty(global::Microsoft.Win32.SafeHandles.SafeBCryptHandle hObject, string pszProperty, global::System.ReadOnlySpan<byte> pbInput, int cbInput, int dwFlags)
1381global::Interop.BCrypt.NTSTATUS __retVal = default;
1407static extern unsafe global::Interop.BCrypt.NTSTATUS __PInvoke(nint __hObject_native, ushort* __pszProperty_native, byte* __pbInput_native, int __cbInput_native, int __dwFlags_native);
1434internal static extern partial global::Interop.BCrypt.NTSTATUS BCryptCloseAlgorithmProvider(nint hAlgorithm, int dwFlags);
1442internal static partial global::Interop.BCrypt.NTSTATUS BCryptCreateHash(global::Microsoft.Win32.SafeHandles.SafeBCryptAlgorithmHandle hAlgorithm, out global::Microsoft.Win32.SafeHandles.SafeBCryptHashHandle phHash, nint pbHashObject, int cbHashObject, global::System.ReadOnlySpan<byte> secret, int cbSecret, global::Interop.BCrypt.BCryptCreateHashFlags dwFlags)
1450global::Interop.BCrypt.NTSTATUS __retVal = default;
1488static extern unsafe global::Interop.BCrypt.NTSTATUS __PInvoke(nint __hAlgorithm_native, nint* __phHash_native, nint __pbHashObject_native, int __cbHashObject_native, byte* __secret_native, int __cbSecret_native, global::Interop.BCrypt.BCryptCreateHashFlags __dwFlags_native);
1498internal static partial global::Interop.BCrypt.NTSTATUS BCryptCreateHash(nuint hAlgorithm, out global::Microsoft.Win32.SafeHandles.SafeBCryptHashHandle phHash, nint pbHashObject, int cbHashObject, global::System.ReadOnlySpan<byte> secret, int cbSecret, global::Interop.BCrypt.BCryptCreateHashFlags dwFlags)
1505global::Interop.BCrypt.NTSTATUS __retVal = default;
1535static extern unsafe global::Interop.BCrypt.NTSTATUS __PInvoke(nuint __hAlgorithm_native, nint* __phHash_native, nint __pbHashObject_native, int __cbHashObject_native, byte* __secret_native, int __cbSecret_native, global::Interop.BCrypt.BCryptCreateHashFlags __dwFlags_native);
1545private static unsafe partial global::Interop.BCrypt.NTSTATUS BCryptDecapsulate(global::Microsoft.Win32.SafeHandles.SafeBCryptKeyHandle hKey, byte* pbCipherText, uint cbCipherText, byte* pbSecretKey, uint cbSecretKey, out uint pcbSecretKey, uint dwFlags)
1551global::Interop.BCrypt.NTSTATUS __retVal = default;
1576static extern unsafe global::Interop.BCrypt.NTSTATUS __PInvoke(nint __hKey_native, byte* __pbCipherText_native, uint __cbCipherText_native, byte* __pbSecretKey_native, uint __cbSecretKey_native, uint* __pcbSecretKey_native, uint __dwFlags_native);
1586private static unsafe partial global::Interop.BCrypt.NTSTATUS BCryptEncapsulate(global::Microsoft.Win32.SafeHandles.SafeBCryptKeyHandle hKey, byte* pbSecretKey, uint cbSecretKey, out uint pcbSecretKey, byte* pbCipherText, uint cbCipherText, out uint pcbCipherText, uint dwFlags)
1593global::Interop.BCrypt.NTSTATUS __retVal = default;
1619static extern unsafe global::Interop.BCrypt.NTSTATUS __PInvoke(nint __hKey_native, byte* __pbSecretKey_native, uint __cbSecretKey_native, uint* __pcbSecretKey_native, byte* __pbCipherText_native, uint __cbCipherText_native, uint* __pcbCipherText_native, uint __dwFlags_native);
1629private static unsafe partial global::Interop.BCrypt.NTSTATUS BCryptDeriveKey(global::Microsoft.Win32.SafeHandles.SafeBCryptSecretHandle hSharedSecret, string pwszKDF, ref readonly global::Interop.BCrypt.BCryptBufferDesc pParameterList, byte* pbDerivedKey, uint cbDerivedKey, out uint pcbResult, uint dwFlags)
1635global::Interop.BCrypt.NTSTATUS __retVal = default;
1644fixed (global::Interop.BCrypt.BCryptBufferDesc* __pParameterList_native = &pParameterList)
1662static extern unsafe global::Interop.BCrypt.NTSTATUS __PInvoke(nint __hSharedSecret_native, ushort* __pwszKDF_native, global::Interop.BCrypt.BCryptBufferDesc* __pParameterList_native, byte* __pbDerivedKey_native, uint __cbDerivedKey_native, uint* __pcbResult_native, uint __dwFlags_native);
1672internal static extern partial global::Interop.BCrypt.NTSTATUS BCryptDestroyHash(nint hHash);
1680internal static extern partial global::Interop.BCrypt.NTSTATUS BCryptDestroyKey(nint hKey);
1688internal static extern partial global::Interop.BCrypt.NTSTATUS BCryptDestroySecret(nint hSecret);
1696private static partial global::Interop.BCrypt.NTSTATUS BCryptDuplicateHash(global::Microsoft.Win32.SafeHandles.SafeBCryptHashHandle hHash, out global::Microsoft.Win32.SafeHandles.SafeBCryptHashHandle phNewHash, nint pbHashObject, int cbHashObject, int dwFlags)
1704global::Interop.BCrypt.NTSTATUS __retVal = default;
1740static extern unsafe global::Interop.BCrypt.NTSTATUS __PInvoke(nint __hHash_native, nint* __phNewHash_native, nint __pbHashObject_native, int __cbHashObject_native, int __dwFlags_native);
1750public static unsafe partial global::Interop.BCrypt.NTSTATUS BCryptEncrypt(global::Internal.NativeCrypto.SafeKeyHandle hKey, byte* pbInput, int cbInput, nint paddingInfo, byte[] pbIV, int cbIV, byte* pbOutput, int cbOutput, out int cbResult, int dwFlags)
1756global::Interop.BCrypt.NTSTATUS __retVal = default;
1782static extern unsafe global::Interop.BCrypt.NTSTATUS __PInvoke(nint __hKey_native, byte* __pbInput_native, int __cbInput_native, nint __paddingInfo_native, byte* __pbIV_native, int __cbIV_native, byte* __pbOutput_native, int __cbOutput_native, int* __cbResult_native, int __dwFlags_native);
1792public static unsafe partial global::Interop.BCrypt.NTSTATUS BCryptDecrypt(global::Internal.NativeCrypto.SafeKeyHandle hKey, byte* pbInput, int cbInput, nint paddingInfo, byte[] pbIV, int cbIV, byte* pbOutput, int cbOutput, out int cbResult, int dwFlags)
1798global::Interop.BCrypt.NTSTATUS __retVal = default;
1824static extern unsafe global::Interop.BCrypt.NTSTATUS __PInvoke(nint __hKey_native, byte* __pbInput_native, int __cbInput_native, nint __paddingInfo_native, byte* __pbIV_native, int __cbIV_native, byte* __pbOutput_native, int __cbOutput_native, int* __cbResult_native, int __dwFlags_native);
1834private static unsafe partial global::Interop.BCrypt.NTSTATUS BCryptEncrypt(global::Microsoft.Win32.SafeHandles.SafeBCryptKeyHandle hKey, byte* pbInput, int cbInput, void* paddingInfo, byte* pbIV, int cbIV, byte* pbOutput, int cbOutput, out int cbResult, global::Interop.BCrypt.BCryptEncryptFlags dwFlags)
1840global::Interop.BCrypt.NTSTATUS __retVal = default;
1865static extern unsafe global::Interop.BCrypt.NTSTATUS __PInvoke(nint __hKey_native, byte* __pbInput_native, int __cbInput_native, void* __paddingInfo_native, byte* __pbIV_native, int __cbIV_native, byte* __pbOutput_native, int __cbOutput_native, int* __cbResult_native, global::Interop.BCrypt.BCryptEncryptFlags __dwFlags_native);
1875private static unsafe partial global::Interop.BCrypt.NTSTATUS BCryptDecrypt(global::Microsoft.Win32.SafeHandles.SafeBCryptKeyHandle hKey, byte* pbInput, int cbInput, void* paddingInfo, byte* pbIV, int cbIV, byte* pbOutput, int cbOutput, out int cbResult, global::Interop.BCrypt.BCryptEncryptFlags dwFlags)
1881global::Interop.BCrypt.NTSTATUS __retVal = default;
1906static extern unsafe global::Interop.BCrypt.NTSTATUS __PInvoke(nint __hKey_native, byte* __pbInput_native, int __cbInput_native, void* __paddingInfo_native, byte* __pbIV_native, int __cbIV_native, byte* __pbOutput_native, int __cbOutput_native, int* __cbResult_native, global::Interop.BCrypt.BCryptEncryptFlags __dwFlags_native);
1916private static partial global::Interop.BCrypt.NTSTATUS BCryptExportKey(global::Microsoft.Win32.SafeHandles.SafeBCryptKeyHandle hKey, nint hExportKey, string pszBlobType, byte[] pbOutput, int cbOutput, out int pcbResult, int dwFlags)
1922global::Interop.BCrypt.NTSTATUS __retVal = default;
1949static extern unsafe global::Interop.BCrypt.NTSTATUS __PInvoke(nint __hKey_native, nint __hExportKey_native, ushort* __pszBlobType_native, byte* __pbOutput_native, int __cbOutput_native, int* __pcbResult_native, int __dwFlags_native);
1959private static unsafe partial global::Interop.BCrypt.NTSTATUS BCryptFinalizeKeyPair(global::Microsoft.Win32.SafeHandles.SafeBCryptKeyHandle hKey, uint dwFlags)
1964global::Interop.BCrypt.NTSTATUS __retVal = default;
1987static extern unsafe global::Interop.BCrypt.NTSTATUS __PInvoke(nint __hKey_native, uint __dwFlags_native);
1997internal static partial global::Interop.BCrypt.NTSTATUS BCryptFinishHash(global::Microsoft.Win32.SafeHandles.SafeBCryptHashHandle hHash, global::System.Span<byte> pbOutput, int cbOutput, int dwFlags)
2002global::Interop.BCrypt.NTSTATUS __retVal = default;
2027static extern unsafe global::Interop.BCrypt.NTSTATUS __PInvoke(nint __hHash_native, byte* __pbOutput_native, int __cbOutput_native, int __dwFlags_native);
2037internal static unsafe partial global::Interop.BCrypt.NTSTATUS BCryptFinishHash(global::Microsoft.Win32.SafeHandles.SafeBCryptHashHandle hHash, byte* pbOutput, int cbOutput, int dwFlags)
2042global::Interop.BCrypt.NTSTATUS __retVal = default;
2065static extern unsafe global::Interop.BCrypt.NTSTATUS __PInvoke(nint __hHash_native, byte* __pbOutput_native, int __cbOutput_native, int __dwFlags_native);
2075internal static unsafe extern partial global::Interop.BCrypt.NTSTATUS BCryptGenRandom(nint hAlgorithm, byte* pbBuffer, int cbBuffer, int dwFlags);
2083private static unsafe partial global::Interop.BCrypt.NTSTATUS BCryptGenerateKeyPair(global::Microsoft.Win32.SafeHandles.SafeBCryptAlgorithmHandle hAlgorithm, out global::Microsoft.Win32.SafeHandles.SafeBCryptKeyHandle phKey, int dwLength, uint dwFlags)
2091global::Interop.BCrypt.NTSTATUS __retVal = default;
2127static extern unsafe global::Interop.BCrypt.NTSTATUS __PInvoke(nint __hAlgorithm_native, nint* __phKey_native, int __dwLength_native, uint __dwFlags_native);
2137internal static unsafe partial global::Interop.BCrypt.NTSTATUS BCryptGenerateSymmetricKey(global::Microsoft.Win32.SafeHandles.SafeBCryptAlgorithmHandle hAlgorithm, out global::Microsoft.Win32.SafeHandles.SafeBCryptKeyHandle phKey, nint pbKeyObject, int cbKeyObject, byte* pbSecret, int cbSecret, uint dwFlags)
2145global::Interop.BCrypt.NTSTATUS __retVal = default;
2181static extern unsafe global::Interop.BCrypt.NTSTATUS __PInvoke(nint __hAlgorithm_native, nint* __phKey_native, nint __pbKeyObject_native, int __cbKeyObject_native, byte* __pbSecret_native, int __cbSecret_native, uint __dwFlags_native);
2191internal static unsafe partial global::Interop.BCrypt.NTSTATUS BCryptGenerateSymmetricKey(nuint hAlgorithm, out global::Microsoft.Win32.SafeHandles.SafeBCryptKeyHandle phKey, nint pbKeyObject, int cbKeyObject, byte* pbSecret, int cbSecret, uint dwFlags)
2198global::Interop.BCrypt.NTSTATUS __retVal = default;
2226static extern unsafe global::Interop.BCrypt.NTSTATUS __PInvoke(nuint __hAlgorithm_native, nint* __phKey_native, nint __pbKeyObject_native, int __cbKeyObject_native, byte* __pbSecret_native, int __cbSecret_native, uint __dwFlags_native);
2236internal static unsafe partial global::Interop.BCrypt.NTSTATUS BCryptGetProperty(global::Microsoft.Win32.SafeHandles.SafeBCryptHandle hObject, string pszProperty, void* pbOutput, int cbOutput, out int pcbResult, int dwFlags)
2242global::Interop.BCrypt.NTSTATUS __retVal = default;
2268static extern unsafe global::Interop.BCrypt.NTSTATUS __PInvoke(nint __hObject_native, ushort* __pszProperty_native, void* __pbOutput_native, int __cbOutput_native, int* __pcbResult_native, int __dwFlags_native);
2278internal static unsafe extern partial global::Interop.BCrypt.NTSTATUS BCryptHash(nuint hAlgorithm, byte* pbSecret, int cbSecret, byte* pbInput, int cbInput, byte* pbOutput, int cbOutput);
2286internal static partial global::Interop.BCrypt.NTSTATUS BCryptHashData(global::Microsoft.Win32.SafeHandles.SafeBCryptHashHandle hHash, global::System.ReadOnlySpan<byte> pbInput, int cbInput, int dwFlags)
2291global::Interop.BCrypt.NTSTATUS __retVal = default;
2316static extern unsafe global::Interop.BCrypt.NTSTATUS __PInvoke(nint __hHash_native, byte* __pbInput_native, int __cbInput_native, int __dwFlags_native);
2326private static unsafe partial global::Interop.BCrypt.NTSTATUS BCryptImportKey(global::Internal.NativeCrypto.SafeAlgorithmHandle hAlgorithm, nint hImportKey, string pszBlobType, out global::Internal.NativeCrypto.SafeKeyHandle hKey, nint pbKeyObject, int cbKeyObject, byte* pbInput, int cbInput, int dwFlags)
2334global::Interop.BCrypt.NTSTATUS __retVal = default;
2372static extern unsafe global::Interop.BCrypt.NTSTATUS __PInvoke(nint __hAlgorithm_native, nint __hImportKey_native, ushort* __pszBlobType_native, nint* __hKey_native, nint __pbKeyObject_native, int __cbKeyObject_native, byte* __pbInput_native, int __cbInput_native, int __dwFlags_native);
2382private static unsafe partial global::Interop.BCrypt.NTSTATUS BCryptImportKeyPair(global::Microsoft.Win32.SafeHandles.SafeBCryptAlgorithmHandle hAlgorithm, nint hImportKey, string pszBlobType, out global::Microsoft.Win32.SafeHandles.SafeBCryptKeyHandle phKey, byte* pbInput, int cbInput, uint dwFlags)
2390global::Interop.BCrypt.NTSTATUS __retVal = default;
2428static extern unsafe global::Interop.BCrypt.NTSTATUS __PInvoke(nint __hAlgorithm_native, nint __hImportKey_native, ushort* __pszBlobType_native, nint* __phKey_native, byte* __pbInput_native, int __cbInput_native, uint __dwFlags_native);
2438internal static unsafe partial global::Interop.BCrypt.NTSTATUS BCryptKeyDerivation(global::Microsoft.Win32.SafeHandles.SafeBCryptKeyHandle hKey, global::Interop.BCrypt.BCryptBufferDesc* pParameterList, byte* pbDerivedKey, int cbDerivedKey, out uint pcbResult, int dwFlags)
2444global::Interop.BCrypt.NTSTATUS __retVal = default;
2469static extern unsafe global::Interop.BCrypt.NTSTATUS __PInvoke(nint __hKey_native, global::Interop.BCrypt.BCryptBufferDesc* __pParameterList_native, byte* __pbDerivedKey_native, int __cbDerivedKey_native, uint* __pcbResult_native, int __dwFlags_native);
2479internal static partial global::Interop.BCrypt.NTSTATUS BCryptOpenAlgorithmProvider(out global::Microsoft.Win32.SafeHandles.SafeBCryptAlgorithmHandle phAlgorithm, string pszAlgId, string pszImplementation, global::Interop.BCrypt.BCryptOpenAlgorithmProviderFlags dwFlags)
2486global::Interop.BCrypt.NTSTATUS __retVal = default;
2517static extern unsafe global::Interop.BCrypt.NTSTATUS __PInvoke(nint* __phAlgorithm_native, ushort* __pszAlgId_native, ushort* __pszImplementation_native, global::Interop.BCrypt.BCryptOpenAlgorithmProviderFlags __dwFlags_native);
2527private static unsafe partial global::Interop.BCrypt.NTSTATUS BCryptSecretAgreement(global::Microsoft.Win32.SafeHandles.SafeBCryptKeyHandle hPrivKey, global::Microsoft.Win32.SafeHandles.SafeBCryptKeyHandle hPubKey, out global::Microsoft.Win32.SafeHandles.SafeBCryptSecretHandle phAgreedSecret, uint dwFlags)
2536global::Interop.BCrypt.NTSTATUS __retVal = default;
2576static extern unsafe global::Interop.BCrypt.NTSTATUS __PInvoke(nint __hPrivKey_native, nint __hPubKey_native, nint* __phAgreedSecret_native, uint __dwFlags_native);
2586internal static unsafe partial global::Interop.BCrypt.NTSTATUS BCryptSetProperty(global::Microsoft.Win32.SafeHandles.SafeBCryptHandle hObject, string pszProperty, void* pbInput, uint cbInput, uint dwFlags)
2591global::Interop.BCrypt.NTSTATUS __retVal = default;
2616static extern unsafe global::Interop.BCrypt.NTSTATUS __PInvoke(nint __hObject_native, ushort* __pszProperty_native, void* __pbInput_native, uint __cbInput_native, uint __dwFlags_native);
2626private static unsafe partial global::Interop.BCrypt.NTSTATUS BCryptSignHash(global::Microsoft.Win32.SafeHandles.SafeBCryptKeyHandle hKey, void* pPaddingInfo, byte* pbInput, int cbInput, byte* pbOutput, int cbOutput, out int pcbResult, global::Interop.BCrypt.BCryptSignVerifyFlags dwFlags)
2632global::Interop.BCrypt.NTSTATUS __retVal = default;
2657static extern unsafe global::Interop.BCrypt.NTSTATUS __PInvoke(nint __hKey_native, void* __pPaddingInfo_native, byte* __pbInput_native, int __cbInput_native, byte* __pbOutput_native, int __cbOutput_native, int* __pcbResult_native, global::Interop.BCrypt.BCryptSignVerifyFlags __dwFlags_native);
2667private static unsafe partial global::Interop.BCrypt.NTSTATUS BCryptVerifySignature(global::Microsoft.Win32.SafeHandles.SafeBCryptKeyHandle hKey, void* pPaddingInfo, byte* pbHash, int cbHash, byte* pbSignature, int cbSignature, global::Interop.BCrypt.BCryptSignVerifyFlags dwFlags)
2672global::Interop.BCrypt.NTSTATUS __retVal = default;
2695static extern unsafe global::Interop.BCrypt.NTSTATUS __PInvoke(nint __hKey_native, void* __pPaddingInfo_native, byte* __pbHash_native, int __cbHash_native, byte* __pbSignature_native, int __cbSignature_native, global::Interop.BCrypt.BCryptSignVerifyFlags __dwFlags_native);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CompositeMLDsaImplementation.Windows.cs (16)
12using NTSTATUS = Interop.BCrypt.NTSTATUS;
47return Interop.BCrypt.BCryptSignHashPqcPure(_key, data, context, destination);
51Interop.BCrypt.BCryptVerifySignaturePqcPure(_key, data, context, signature);
63SafeBCryptKeyHandle keyHandle = Interop.BCrypt.BCryptGenerateKeyPair(s_algHandle, keyLength: 0);
67Interop.BCrypt.BCryptSetSZProperty(keyHandle, Interop.BCrypt.BCryptPropertyStrings.BCRYPT_PARAMETER_SET_NAME, parameterSet);
68Interop.BCrypt.BCryptFinalizeKeyPair(keyHandle);
89const string PublicBlobType = Interop.BCrypt.KeyBlobType.BCRYPT_PQDSA_PUBLIC_BLOB;
96static blob => Interop.BCrypt.BCryptImportKeyPair(s_algHandle, PublicBlobType, blob));
111const string PrivateBlobType = Interop.BCrypt.KeyBlobType.BCRYPT_PQDSA_PRIVATE_BLOB;
118static blob => Interop.BCrypt.BCryptImportKeyPair(s_algHandle, PrivateBlobType, blob));
134ExportKey(Interop.BCrypt.KeyBlobType.BCRYPT_PQDSA_PUBLIC_BLOB, destination);
143return ExportKey(Interop.BCrypt.KeyBlobType.BCRYPT_PQDSA_PRIVATE_BLOB, destination);
159ArraySegment<byte> keyBlob = Interop.BCrypt.BCryptExportKey(_key, keyBlobType);
202NTSTATUS status = Interop.BCrypt.BCryptOpenAlgorithmProvider(
206Interop.BCrypt.BCryptOpenAlgorithmProviderFlags.None);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CompositeMLKemImplementation.Windows.cs (15)
9using NTSTATUS = Interop.BCrypt.NTSTATUS;
47SafeBCryptKeyHandle keyHandle = Interop.BCrypt.BCryptGenerateKeyPair(s_algHandle, keyLength: 0);
51Interop.BCrypt.BCryptSetSZProperty(
53Interop.BCrypt.BCryptPropertyStrings.BCRYPT_PARAMETER_SET_NAME,
55Interop.BCrypt.BCryptFinalizeKeyPair(keyHandle);
71return ImportKey(algorithm, source, Interop.BCrypt.KeyBlobType.BCRYPT_COMPOSITE_MLKEM_PUBLIC_BLOB, hasDecapsulationKey: false);
79return ImportKey(algorithm, source, Interop.BCrypt.KeyBlobType.BCRYPT_COMPOSITE_MLKEM_PRIVATE_BLOB, hasDecapsulationKey: true);
92uint written = Interop.BCrypt.BCryptDecapsulate(_key, ciphertext, sharedSecret, 0);
106Interop.BCrypt.BCryptEncapsulate(
125return ExportKey(Interop.BCrypt.KeyBlobType.BCRYPT_COMPOSITE_MLKEM_PUBLIC_BLOB, destination);
137return ExportKey(Interop.BCrypt.KeyBlobType.BCRYPT_COMPOSITE_MLKEM_PRIVATE_BLOB, destination);
180static (algHandle, blobKind, blob) => Interop.BCrypt.BCryptImportKeyPair(algHandle, blobKind, blob));
187ArraySegment<byte> keyBlob = Interop.BCrypt.BCryptExportKey(_key, blobType);
225NTSTATUS status = Interop.BCrypt.BCryptOpenAlgorithmProvider(
229Interop.BCrypt.BCryptOpenAlgorithmProviderFlags.None);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\DSACng.ImportExport.cs (33)
7using static Interop.BCrypt;
9using KeyBlobMagicNumber = Interop.BCrypt.KeyBlobMagicNumber;
199Interop.BCrypt.EmitBigEndian(blob, ref offset, parameters.Counter);
200Interop.BCrypt.Emit(blob, ref offset, parameters.Seed);
206Interop.BCrypt.EmitByte(blob, ref offset, 0xff, Sha1HashOutputSize + sizeof(int));
213Interop.BCrypt.Emit(blob, ref offset, parameters.Q);
217Interop.BCrypt.Emit(blob, ref offset, parameters.P!);
218Interop.BCrypt.Emit(blob, ref offset, parameters.G!);
219Interop.BCrypt.Emit(blob, ref offset, parameters.Y!);
222Interop.BCrypt.Emit(blob, ref offset, parameters.X!);
279Interop.BCrypt.EmitBigEndian(blob, ref offset, parameters.Counter);
283Interop.BCrypt.Emit(blob, ref offset, parameters.Seed);
289Interop.BCrypt.EmitByte(blob, ref offset, 0xff, sizeof(int));
294Interop.BCrypt.EmitByte(blob, ref offset, 0xff, defaultSeedLength);
297Interop.BCrypt.Emit(blob, ref offset, parameters.Q);
298Interop.BCrypt.Emit(blob, ref offset, parameters.P);
299Interop.BCrypt.Emit(blob, ref offset, parameters.G);
300Interop.BCrypt.Emit(blob, ref offset, parameters.Y);
304Interop.BCrypt.Emit(blob, ref offset, parameters.X!);
359dsaParams.Counter = BinaryPrimitives.ReadInt32BigEndian(Interop.BCrypt.Consume(dsaBlob, ref offset, 4));
360dsaParams.Seed = Interop.BCrypt.Consume(dsaBlob, ref offset, Sha1HashOutputSize);
361dsaParams.Q = Interop.BCrypt.Consume(dsaBlob, ref offset, Sha1HashOutputSize);
364dsaParams.P = Interop.BCrypt.Consume(dsaBlob, ref offset, pBcryptBlob->cbKey);
365dsaParams.G = Interop.BCrypt.Consume(dsaBlob, ref offset, pBcryptBlob->cbKey);
366dsaParams.Y = Interop.BCrypt.Consume(dsaBlob, ref offset, pBcryptBlob->cbKey);
369dsaParams.X = Interop.BCrypt.Consume(dsaBlob, ref offset, Sha1HashOutputSize);
393dsaParams.Counter = BinaryPrimitives.ReadInt32BigEndian(Interop.BCrypt.Consume(dsaBlob, ref offset, 4));
397dsaParams.Seed = Interop.BCrypt.Consume(dsaBlob, ref offset, pBcryptBlob->cbSeedLength);
398dsaParams.Q = Interop.BCrypt.Consume(dsaBlob, ref offset, pBcryptBlob->cbGroupSize);
399dsaParams.P = Interop.BCrypt.Consume(dsaBlob, ref offset, pBcryptBlob->cbKey);
400dsaParams.G = Interop.BCrypt.Consume(dsaBlob, ref offset, pBcryptBlob->cbKey);
401dsaParams.Y = Interop.BCrypt.Consume(dsaBlob, ref offset, pBcryptBlob->cbKey);
404dsaParams.X = Interop.BCrypt.Consume(dsaBlob, ref offset, pBcryptBlob->cbGroupSize);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\ECCng.ImportExport.cs (37)
6using BCRYPT_ECC_PARAMETER_HEADER = Interop.BCrypt.BCRYPT_ECC_PARAMETER_HEADER;
7using BCRYPT_ECCFULLKEY_BLOB = Interop.BCrypt.BCRYPT_ECCFULLKEY_BLOB;
9using KeyBlobMagicNumber = Interop.BCrypt.KeyBlobMagicNumber;
93Interop.BCrypt.Emit(blob, ref offset, curve.Prime);
94Interop.BCrypt.Emit(blob, ref offset, curve.A);
95Interop.BCrypt.Emit(blob, ref offset, curve.B);
96Interop.BCrypt.Emit(blob, ref offset, curve.G.X);
97Interop.BCrypt.Emit(blob, ref offset, curve.G.Y);
98Interop.BCrypt.Emit(blob, ref offset, curve.Order);
99Interop.BCrypt.Emit(blob, ref offset, curve.Cofactor);
102Interop.BCrypt.Emit(blob, ref offset, curve.Seed);
104Interop.BCrypt.Emit(blob, ref offset, parameters.Q.X);
105Interop.BCrypt.Emit(blob, ref offset, parameters.Q.Y);
108Interop.BCrypt.Emit(blob, ref offset, parameters.D!);
200primeCurve.Prime = Interop.BCrypt.Consume(ecBlob, ref offset, pBcryptBlob->cbFieldLength);
201primeCurve.A = Interop.BCrypt.Consume(ecBlob, ref offset, pBcryptBlob->cbFieldLength);
202primeCurve.B = Interop.BCrypt.Consume(ecBlob, ref offset, pBcryptBlob->cbFieldLength);
205X = Interop.BCrypt.Consume(ecBlob, ref offset, pBcryptBlob->cbFieldLength),
206Y = Interop.BCrypt.Consume(ecBlob, ref offset, pBcryptBlob->cbFieldLength),
208primeCurve.Order = Interop.BCrypt.Consume(ecBlob, ref offset, pBcryptBlob->cbSubgroupOrder);
209primeCurve.Cofactor = Interop.BCrypt.Consume(ecBlob, ref offset, pBcryptBlob->cbCofactor);
212primeCurve.Seed = pBcryptBlob->cbSeed == 0 ? null : Interop.BCrypt.Consume(ecBlob, ref offset, pBcryptBlob->cbSeed);
216X = Interop.BCrypt.Consume(ecBlob, ref offset, pBcryptBlob->cbFieldLength),
217Y = Interop.BCrypt.Consume(ecBlob, ref offset, pBcryptBlob->cbFieldLength)
222ecParams.D = Interop.BCrypt.Consume(ecBlob, ref offset, pBcryptBlob->cbSubgroupOrder);
258pBcryptBlob->Version = Interop.BCrypt.BCRYPT_ECC_PARAMETER_HEADER_V1;
268Interop.BCrypt.Emit(blob, ref offset, curve.Prime);
269Interop.BCrypt.Emit(blob, ref offset, curve.A);
270Interop.BCrypt.Emit(blob, ref offset, curve.B);
271Interop.BCrypt.Emit(blob, ref offset, curve.G.X);
272Interop.BCrypt.Emit(blob, ref offset, curve.G.Y);
273Interop.BCrypt.Emit(blob, ref offset, curve.Order);
274Interop.BCrypt.Emit(blob, ref offset, curve.Cofactor);
277Interop.BCrypt.Emit(blob, ref offset, curve.Seed);
400private static Interop.BCrypt.ECC_CURVE_TYPE_ENUM ConvertToCurveTypeEnum(ECCurve.ECCurveType value)
406return (Interop.BCrypt.ECC_CURVE_TYPE_ENUM)value;
412private static ECCurve.ECCurveType ConvertToCurveTypeEnum(Interop.BCrypt.ECC_CURVE_TYPE_ENUM value)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\ECCng.ImportExport.NamedCurve.cs (12)
7using BCRYPT_ECCKEY_BLOB = Interop.BCrypt.BCRYPT_ECCKEY_BLOB;
9using KeyBlobMagicNumber = Interop.BCrypt.KeyBlobMagicNumber;
58Interop.BCrypt.Emit(blob, ref offset, x);
59Interop.BCrypt.Emit(blob, ref offset, y);
64Interop.BCrypt.Emit(blob, ref offset, d!);
108byte[] x = Interop.BCrypt.Consume(ecBlob, ref offset, pBcryptBlob->cbKey);
109byte[] y = Interop.BCrypt.Consume(ecBlob, ref offset, pBcryptBlob->cbKey);
119Interop.BCrypt.Consume(ecBlob, ref offset, d.Length, d);
158Interop.BCrypt.BCryptBufferDesc desc = default;
159Interop.BCrypt.BCryptBuffer buff = default;
162buff.BufferType = Interop.BCrypt.CngBufferDescriptors.NCRYPTBUFFER_ECC_CURVE_NAME;
167desc.ulVersion = Interop.BCrypt.BCRYPTBUFFER_VERSION;
src\runtime\src\libraries\Common\src\System\Security\Cryptography\MLDsaImplementation.Windows.cs (22)
10using NTSTATUS = Interop.BCrypt.NTSTATUS;
47int written = Interop.BCrypt.BCryptSignHashPqcPure(_key, data, context, destination);
51Debug.Fail($"Expected {destination.Length} bytes, but {nameof(Interop.BCrypt.BCryptSignHashPqcPure)} wrote {written} bytes.");
57Interop.BCrypt.BCryptVerifySignaturePqcPure(_key, data, context, signature);
79Interop.BCrypt.BCryptSignHashPqcPreHash(_key, hash, hashAlgorithmIdentifier, context, destination);
97return Interop.BCrypt.BCryptVerifySignaturePqcPreHash(_key, hash, hashAlgorithmIdentifier, context, signature);
111SafeBCryptKeyHandle keyHandle = Interop.BCrypt.BCryptGenerateKeyPair(s_algHandle, keyLength: 0);
115Interop.BCrypt.BCryptSetSZProperty(keyHandle, Interop.BCrypt.BCryptPropertyStrings.BCRYPT_PARAMETER_SET_NAME, parameterSet);
116Interop.BCrypt.BCryptFinalizeKeyPair(keyHandle);
131const string PublicBlobType = Interop.BCrypt.KeyBlobType.BCRYPT_PQDSA_PUBLIC_BLOB;
138static blob => Interop.BCrypt.BCryptImportKeyPair(s_algHandle, PublicBlobType, blob));
147const string PrivateBlobType = Interop.BCrypt.KeyBlobType.BCRYPT_PQDSA_PRIVATE_BLOB;
154static blob => Interop.BCrypt.BCryptImportKeyPair(s_algHandle, PrivateBlobType, blob));
163const string PrivateSeedBlobType = Interop.BCrypt.KeyBlobType.BCRYPT_PQDSA_PRIVATE_SEED_BLOB;
170static blob => Interop.BCrypt.BCryptImportKeyPair(s_algHandle, PrivateSeedBlobType, blob));
177Interop.BCrypt.KeyBlobType.BCRYPT_PQDSA_PUBLIC_BLOB,
189Interop.BCrypt.KeyBlobType.BCRYPT_PQDSA_PRIVATE_BLOB,
202Interop.BCrypt.KeyBlobType.BCRYPT_PQDSA_PRIVATE_SEED_BLOB,
230ArraySegment<byte> keyBlob = Interop.BCrypt.BCryptExportKey(_key, keyBlobType);
268NTSTATUS status = Interop.BCrypt.BCryptOpenAlgorithmProvider(
272Interop.BCrypt.BCryptOpenAlgorithmProviderFlags.None);
System\Security\Cryptography\CngHelpers.cs (16)
10using BCRYPT_RSAKEY_BLOB = Interop.BCrypt.BCRYPT_RSAKEY_BLOB;
12using KeyBlobMagicNumber = Interop.BCrypt.KeyBlobMagicNumber;
98if (bcryptMagic != Interop.BCrypt.BCRYPT_KEY_DATA_BLOB_HEADER.BCRYPT_KEY_DATA_BLOB_MAGIC)
102if (dwVersion != Interop.BCrypt.BCRYPT_KEY_DATA_BLOB_HEADER.BCRYPT_KEY_DATA_BLOB_VERSION1)
208Interop.BCrypt.Emit(rsaBlob, ref offset, parameters.Exponent);
209Interop.BCrypt.Emit(rsaBlob, ref offset, parameters.Modulus);
213Interop.BCrypt.Emit(rsaBlob, ref offset, parameters.P!);
214Interop.BCrypt.Emit(rsaBlob, ref offset, parameters.Q!);
262rsaParams.Exponent = Interop.BCrypt.Consume(rsaBlob, ref offset, pBcryptBlob->cbPublicExp);
263rsaParams.Modulus = Interop.BCrypt.Consume(rsaBlob, ref offset, pBcryptBlob->cbModulus);
267rsaParams.P = Interop.BCrypt.Consume(rsaBlob, ref offset, pBcryptBlob->cbPrime1);
268rsaParams.Q = Interop.BCrypt.Consume(rsaBlob, ref offset, pBcryptBlob->cbPrime2);
269rsaParams.DP = Interop.BCrypt.Consume(rsaBlob, ref offset, pBcryptBlob->cbPrime1);
270rsaParams.DQ = Interop.BCrypt.Consume(rsaBlob, ref offset, pBcryptBlob->cbPrime2);
271rsaParams.InverseQ = Interop.BCrypt.Consume(rsaBlob, ref offset, pBcryptBlob->cbPrime1);
272rsaParams.D = Interop.BCrypt.Consume(rsaBlob, ref offset, pBcryptBlob->cbModulus);
System\Security\Cryptography\HashProviderCng.cs (16)
9using BCryptCreateHashFlags = Interop.BCrypt.BCryptCreateHashFlags;
10using BCryptOpenAlgorithmProviderFlags = Interop.BCrypt.BCryptOpenAlgorithmProviderFlags;
11using NTSTATUS = Interop.BCrypt.NTSTATUS;
38_hAlgorithm = Interop.BCrypt.BCryptAlgorithmCache.GetCachedBCryptAlgorithmHandle(hashAlgId, dwFlags, out _hashSize);
39NTSTATUS ntStatus = Interop.BCrypt.BCryptCreateHash(_hAlgorithm, out _hHash, IntPtr.Zero, 0, key, key.Length, BCryptCreateHashFlags.BCRYPT_HASH_REUSABLE_FLAG);
44throw Interop.BCrypt.CreateCryptographicException(ntStatus);
68NTSTATUS ntStatus = Interop.BCrypt.BCryptHashData(_hHash, source, source.Length, 0);
71throw Interop.BCrypt.CreateCryptographicException(ntStatus);
85NTSTATUS ntStatus = Interop.BCrypt.BCryptFinishHash(_hHash, destination, _hashSize, 0);
89throw Interop.BCrypt.CreateCryptographicException(ntStatus);
105using (SafeBCryptHashHandle tmpHash = Interop.BCrypt.BCryptDuplicateHash(_hHash))
107NTSTATUS ntStatus = Interop.BCrypt.BCryptFinishHash(tmpHash, destination, _hashSize, 0);
111throw Interop.BCrypt.CreateCryptographicException(ntStatus);
123SafeBCryptHashHandle clone = Interop.BCrypt.BCryptDuplicateHash(_hHash);
159NTSTATUS ntStatus = Interop.BCrypt.BCryptCreateHash(_hAlgorithm, out hHash, IntPtr.Zero, 0, _key, _key == null ? 0 : _key.Length, Flags);
164throw Interop.BCrypt.CreateCryptographicException(ntStatus);
System\Security\Cryptography\HashProviderDispenser.Windows.cs (33)
8using BCryptAlgorithmCache = Interop.BCrypt.BCryptAlgorithmCache;
9using BCryptCreateHashFlags = Interop.BCrypt.BCryptCreateHashFlags;
10using BCryptOpenAlgorithmProviderFlags = Interop.BCrypt.BCryptOpenAlgorithmProviderFlags;
11using NTSTATUS = Interop.BCrypt.NTSTATUS;
121if (Interop.BCrypt.PseudoHandlesSupported)
148Debug.Assert(Interop.BCrypt.PseudoHandlesSupported);
157if (Interop.BCrypt.PseudoHandlesSupported)
194Interop.BCrypt.BCryptAlgPseudoHandle algHandle;
200Interop.BCrypt.BCryptAlgPseudoHandle.BCRYPT_HMAC_MD5_ALG_HANDLE :
201Interop.BCrypt.BCryptAlgPseudoHandle.BCRYPT_MD5_ALG_HANDLE;
207Interop.BCrypt.BCryptAlgPseudoHandle.BCRYPT_HMAC_SHA1_ALG_HANDLE :
208Interop.BCrypt.BCryptAlgPseudoHandle.BCRYPT_SHA1_ALG_HANDLE;
214Interop.BCrypt.BCryptAlgPseudoHandle.BCRYPT_HMAC_SHA256_ALG_HANDLE :
215Interop.BCrypt.BCryptAlgPseudoHandle.BCRYPT_SHA256_ALG_HANDLE;
221Interop.BCrypt.BCryptAlgPseudoHandle.BCRYPT_HMAC_SHA384_ALG_HANDLE :
222Interop.BCrypt.BCryptAlgPseudoHandle.BCRYPT_SHA384_ALG_HANDLE;
228Interop.BCrypt.BCryptAlgPseudoHandle.BCRYPT_HMAC_SHA512_ALG_HANDLE :
229Interop.BCrypt.BCryptAlgPseudoHandle.BCRYPT_SHA512_ALG_HANDLE;
235Interop.BCrypt.BCryptAlgPseudoHandle.BCRYPT_HMAC_SHA3_256_ALG_HANDLE :
236Interop.BCrypt.BCryptAlgPseudoHandle.BCRYPT_SHA3_256_ALG_HANDLE;
242Interop.BCrypt.BCryptAlgPseudoHandle.BCRYPT_HMAC_SHA3_384_ALG_HANDLE :
243Interop.BCrypt.BCryptAlgPseudoHandle.BCRYPT_SHA3_384_ALG_HANDLE;
249Interop.BCrypt.BCryptAlgPseudoHandle.BCRYPT_HMAC_SHA3_512_ALG_HANDLE :
250Interop.BCrypt.BCryptAlgPseudoHandle.BCRYPT_SHA3_512_ALG_HANDLE;
255algHandle = Interop.BCrypt.BCryptAlgPseudoHandle.BCRYPT_CSHAKE128_ALG_HANDLE;
260algHandle = Interop.BCrypt.BCryptAlgPseudoHandle.BCRYPT_CSHAKE256_ALG_HANDLE;
279NTSTATUS ntStatus = Interop.BCrypt.BCryptHash((uint)algHandle, pKey, key.Length, pSrc, source.Length, pDest, digestSizeInBytes);
283throw Interop.BCrypt.CreateCryptographicException(ntStatus);
297NTSTATUS ntStatus = Interop.BCrypt.BCryptCreateHash(
309throw Interop.BCrypt.CreateCryptographicException(ntStatus);
314ntStatus = Interop.BCrypt.BCryptHashData(hHash, source, source.Length, 0);
318throw Interop.BCrypt.CreateCryptographicException(ntStatus);
321Interop.BCrypt.BCryptFinishHash(hHash, destination, hashSize, 0);
System\Security\Cryptography\LiteHash.Windows.cs (43)
8using BCryptCreateHashFlags = Interop.BCrypt.BCryptCreateHashFlags;
9using BCryptOpenAlgorithmProviderFlags = Interop.BCrypt.BCryptOpenAlgorithmProviderFlags;
10using NTSTATUS = Interop.BCrypt.NTSTATUS;
50HashAlgorithmNames.KMAC128 => (nuint)Interop.BCrypt.BCryptAlgPseudoHandle.BCRYPT_KMAC128_ALG_HANDLE,
51HashAlgorithmNames.KMAC256 => (nuint)Interop.BCrypt.BCryptAlgPseudoHandle.BCRYPT_KMAC256_ALG_HANDLE,
55NTSTATUS ntStatus = Interop.BCrypt.BCryptCreateHash(
67throw Interop.BCrypt.CreateCryptographicException(ntStatus);
82throw Interop.BCrypt.CreateCryptographicException(ntStatus);
117CheckStatus(Interop.BCrypt.BCryptFinishHash(_hashHandle, buffer, 0, dwFlags: 0));
128CheckStatus(Interop.BCrypt.BCryptHashData(_hashHandle, data, data.Length, dwFlags: 0));
135using (SafeBCryptHashHandle dup = Interop.BCrypt.BCryptDuplicateHash(_hashHandle))
137CheckStatus(Interop.BCrypt.BCryptFinishHash(dup, pDestination, destination.Length, _finishFlags));
148CheckStatus(Interop.BCrypt.BCryptFinishHash(_hashHandle, pDestination, destination.Length, _finishFlags));
156SafeBCryptHashHandle clone = Interop.BCrypt.BCryptDuplicateHash(_hashHandle);
169throw Interop.BCrypt.CreateCryptographicException(status);
184HashAlgorithmNames.CSHAKE128 => (nuint)Interop.BCrypt.BCryptAlgPseudoHandle.BCRYPT_CSHAKE128_ALG_HANDLE,
185HashAlgorithmNames.CSHAKE256 => (nuint)Interop.BCrypt.BCryptAlgPseudoHandle.BCRYPT_CSHAKE256_ALG_HANDLE,
191NTSTATUS ntStatus = Interop.BCrypt.BCryptCreateHash(
203throw Interop.BCrypt.CreateCryptographicException(ntStatus);
237NTSTATUS ntStatus = Interop.BCrypt.BCryptHashData(_hashHandle, data, data.Length, dwFlags: 0);
241throw Interop.BCrypt.CreateCryptographicException(ntStatus);
249NTSTATUS ntStatus = Interop.BCrypt.BCryptFinishHash(_hashHandle, pDestination, destination.Length, dwFlags: 0);
253throw Interop.BCrypt.CreateCryptographicException(ntStatus);
267using (SafeBCryptHashHandle tmpHash = Interop.BCrypt.BCryptDuplicateHash(_hashHandle))
270NTSTATUS ntStatus = Interop.BCrypt.BCryptFinishHash(tmpHash, pDestination, destination.Length, dwFlags: 0);
274throw Interop.BCrypt.CreateCryptographicException(ntStatus);
281SafeBCryptHashHandle clone = Interop.BCrypt.BCryptDuplicateHash(_hashHandle);
289NTSTATUS ntStatus = Interop.BCrypt.BCryptFinishHash(_hashHandle, pDestination, destination.Length, dwFlags: BCRYPT_HASH_DONT_RESET_FLAG);
293throw Interop.BCrypt.CreateCryptographicException(ntStatus);
318SafeBCryptAlgorithmHandle algorithmHandle = Interop.BCrypt.BCryptAlgorithmCache.GetCachedBCryptAlgorithmHandle(
325NTSTATUS ntStatus = Interop.BCrypt.BCryptCreateHash(
337throw Interop.BCrypt.CreateCryptographicException(ntStatus);
350NTSTATUS ntStatus = Interop.BCrypt.BCryptHashData(_hashHandle, data, data.Length, dwFlags: 0);
354throw Interop.BCrypt.CreateCryptographicException(ntStatus);
362NTSTATUS ntStatus = Interop.BCrypt.BCryptFinishHash(_hashHandle, destination, _hashSizeInBytes, dwFlags: 0);
366throw Interop.BCrypt.CreateCryptographicException(ntStatus);
391SafeBCryptAlgorithmHandle algorithmHandle = Interop.BCrypt.BCryptAlgorithmCache.GetCachedBCryptAlgorithmHandle(
398NTSTATUS ntStatus = Interop.BCrypt.BCryptCreateHash(
410throw Interop.BCrypt.CreateCryptographicException(ntStatus);
423NTSTATUS ntStatus = Interop.BCrypt.BCryptHashData(_hashHandle, data, data.Length, dwFlags: 0);
427throw Interop.BCrypt.CreateCryptographicException(ntStatus);
435NTSTATUS ntStatus = Interop.BCrypt.BCryptFinishHash(_hashHandle, destination, _hashSizeInBytes, dwFlags: 0);
439throw Interop.BCrypt.CreateCryptographicException(ntStatus);
System\Security\Cryptography\X509Certificates\X509Pal.Windows.PublicKey.cs (11)
10using NTSTATUS = Interop.BCrypt.NTSTATUS;
165return Interop.BCrypt.BCryptExportKey(bCryptKeyHandle, blobFormatString);
179Debug.Assert(ecBlob.Length >= sizeof(Interop.BCrypt.BCRYPT_ECCKEY_BLOB));
183Interop.BCrypt.BCRYPT_ECCKEY_BLOB* pBcryptBlob = (Interop.BCrypt.BCRYPT_ECCKEY_BLOB*)pEcBlob;
185int offset = sizeof(Interop.BCrypt.BCRYPT_ECCKEY_BLOB);
189X = Interop.BCrypt.Consume(ecBlob, ref offset, pBcryptBlob->cbKey),
190Y = Interop.BCrypt.Consume(ecBlob, ref offset, pBcryptBlob->cbKey)
195ecParams.D = Interop.BCrypt.Consume(ecBlob, ref offset, pBcryptBlob->cbKey);
353NTSTATUS errorCode = Interop.BCrypt.BCryptGetProperty(cryptHandle, propertyName, null, 0, out numBytesNeeded, 0);
360errorCode = Interop.BCrypt.BCryptGetProperty(cryptHandle, propertyName, pPropertyValue, propertyValue.Length, out numBytesNeeded, 0);