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