39 references to Cng
System.Security.Cryptography (39)
src\runtime\src\libraries\Common\src\Interop\Windows\BCrypt\AesBCryptModes.cs (7)
12private static readonly Lazy<SafeAlgorithmHandle> s_hAlgCbc = OpenAesAlgorithm(Cng.BCRYPT_CHAIN_MODE_CBC); 13private static readonly Lazy<SafeAlgorithmHandle> s_hAlgEcb = OpenAesAlgorithm(Cng.BCRYPT_CHAIN_MODE_ECB); 14private static readonly Lazy<SafeAlgorithmHandle> s_hAlgCfb128 = OpenAesAlgorithm(Cng.BCRYPT_CHAIN_MODE_CFB, 16); 15private static readonly Lazy<SafeAlgorithmHandle> s_hAlgCfb8 = OpenAesAlgorithm(Cng.BCRYPT_CHAIN_MODE_CFB, 1); 33SafeAlgorithmHandle hAlg = Cng.BCryptOpenAlgorithmProvider(Cng.BCRYPT_AES_ALGORITHM, null, 34Cng.OpenAlgorithmProviderFlags.NONE);
src\runtime\src\libraries\Common\src\Interop\Windows\BCrypt\BCryptAeadHandleCache.cs (7)
19internal static SafeAlgorithmHandle ChaCha20Poly1305 => GetCachedAlgorithmHandle(ref s_chaCha20Poly1305, Cng.BCRYPT_CHACHA20_POLY1305_ALGORITHM); 20internal static SafeAlgorithmHandle AesCcm => GetCachedAlgorithmHandle(ref s_aesCcm, Cng.BCRYPT_AES_ALGORITHM, Cng.BCRYPT_CHAIN_MODE_CCM); 23internal static SafeAlgorithmHandle AesGcm => GetCachedAlgorithmHandle(ref s_aesGcm, Cng.BCRYPT_AES_ALGORITHM, Cng.BCRYPT_CHAIN_MODE_GCM); 36SafeAlgorithmHandle newHandle = Cng.BCryptOpenAlgorithmProvider(algId, null, Cng.OpenAlgorithmProviderFlags.NONE);
src\runtime\src\libraries\Common\src\Interop\Windows\BCrypt\DESBCryptModes.cs (6)
12private static readonly Lazy<SafeAlgorithmHandle> s_hAlgCbc = OpenDesAlgorithm(Cng.BCRYPT_CHAIN_MODE_CBC); 13private static readonly Lazy<SafeAlgorithmHandle> s_hAlgEcb = OpenDesAlgorithm(Cng.BCRYPT_CHAIN_MODE_ECB); 14private static readonly Lazy<SafeAlgorithmHandle> s_hAlgCfb8 = OpenDesAlgorithm(Cng.BCRYPT_CHAIN_MODE_CFB); 31SafeAlgorithmHandle hAlg = Cng.BCryptOpenAlgorithmProvider( 32Cng.BCRYPT_DES_ALGORITHM, 34Cng.OpenAlgorithmProviderFlags.NONE);
src\runtime\src\libraries\Common\src\Interop\Windows\BCrypt\RC2BCryptModes.cs (6)
20CipherMode.CBC => OpenRC2Algorithm(Cng.BCRYPT_CHAIN_MODE_CBC, effectiveKeyLength), 21CipherMode.ECB => OpenRC2Algorithm(Cng.BCRYPT_CHAIN_MODE_ECB, effectiveKeyLength), 27SafeAlgorithmHandle hAlg = Cng.BCryptOpenAlgorithmProvider(Cng.BCRYPT_RC2_ALGORITHM, null, Cng.OpenAlgorithmProviderFlags.NONE); 31Cng.SetEffectiveKeyLength(hAlg, effectiveKeyLength);
src\runtime\src\libraries\Common\src\Interop\Windows\BCrypt\TripleDesBCryptModes.cs (7)
13private static readonly Lazy<SafeAlgorithmHandle> s_hAlgCbc = Open3DesAlgorithm(Cng.BCRYPT_CHAIN_MODE_CBC); 15private static readonly Lazy<SafeAlgorithmHandle> s_hAlgEcb = Open3DesAlgorithm(Cng.BCRYPT_CHAIN_MODE_ECB); 17private static readonly Lazy<SafeAlgorithmHandle> s_hAlgCfb8 = Open3DesAlgorithm(Cng.BCRYPT_CHAIN_MODE_CFB, 1); 19private static readonly Lazy<SafeAlgorithmHandle> s_hAlgCfb64 = Open3DesAlgorithm(Cng.BCRYPT_CHAIN_MODE_CFB, 8); 37SafeAlgorithmHandle hAlg = Cng.BCryptOpenAlgorithmProvider(Cng.BCRYPT_3DES_ALGORITHM, null, 38Cng.OpenAlgorithmProviderFlags.NONE);
System\Security\Cryptography\AesCng.Windows.cs (1)
285return Cng.BCRYPT_AES_ALGORITHM;
System\Security\Cryptography\BasicSymmetricCipherLiteNCrypt.cs (3)
19new CngProperty(KeyPropertyName.ChainingMode, Encoding.Unicode.GetBytes(Cng.BCRYPT_CHAIN_MODE_ECB + "\0"), CngPropertyOptions.None); 21new CngProperty(KeyPropertyName.ChainingMode, Encoding.Unicode.GetBytes(Cng.BCRYPT_CHAIN_MODE_CBC + "\0"), CngPropertyOptions.None); 23new CngProperty(KeyPropertyName.ChainingMode, Encoding.Unicode.GetBytes(Cng.BCRYPT_CHAIN_MODE_CFB + "\0"), CngPropertyOptions.None);
System\Security\Cryptography\LiteHash.Windows.cs (1)
72ntStatus = Internal.NativeCrypto.Cng.Interop.BCryptSetProperty(
System\Security\Cryptography\TripleDESCng.Windows.cs (1)
240return Cng.BCRYPT_3DES_ALGORITHM;