43 references to Constants
Microsoft.AspNetCore.Cryptography.Internal (20)
Cng\CachedAlgorithmHandles.cs (13)
15
private static CachedAlgorithmInfo _aesCbc = new CachedAlgorithmInfo(() => GetAesAlgorithm(chainingMode:
Constants
.BCRYPT_CHAIN_MODE_CBC));
16
private static CachedAlgorithmInfo _aesGcm = new CachedAlgorithmInfo(() => GetAesAlgorithm(chainingMode:
Constants
.BCRYPT_CHAIN_MODE_GCM));
17
private static CachedAlgorithmInfo _hmacSha1 = new CachedAlgorithmInfo(() => GetHmacAlgorithm(algorithm:
Constants
.BCRYPT_SHA1_ALGORITHM));
18
private static CachedAlgorithmInfo _hmacSha256 = new CachedAlgorithmInfo(() => GetHmacAlgorithm(algorithm:
Constants
.BCRYPT_SHA256_ALGORITHM));
19
private static CachedAlgorithmInfo _hmacSha512 = new CachedAlgorithmInfo(() => GetHmacAlgorithm(algorithm:
Constants
.BCRYPT_SHA512_ALGORITHM));
21
private static CachedAlgorithmInfo _sha1 = new CachedAlgorithmInfo(() => GetHashAlgorithm(algorithm:
Constants
.BCRYPT_SHA1_ALGORITHM));
22
private static CachedAlgorithmInfo _sha256 = new CachedAlgorithmInfo(() => GetHashAlgorithm(algorithm:
Constants
.BCRYPT_SHA256_ALGORITHM));
23
private static CachedAlgorithmInfo _sha512 = new CachedAlgorithmInfo(() => GetHashAlgorithm(algorithm:
Constants
.BCRYPT_SHA512_ALGORITHM));
50
var algHandle = BCryptAlgorithmHandle.OpenAlgorithmHandle(
Constants
.BCRYPT_AES_ALGORITHM);
67
return BCryptAlgorithmHandle.OpenAlgorithmHandle(
Constants
.BCRYPT_PBKDF2_ALGORITHM, implementation:
Constants
.MS_PRIMITIVE_PROVIDER);
72
return BCryptAlgorithmHandle.OpenAlgorithmHandle(
Constants
.BCRYPT_SP800108_CTR_HMAC_ALGORITHM, implementation:
Constants
.MS_PRIMITIVE_PROVIDER);
SafeHandles\BCryptAlgorithmHandle.cs (7)
71
uint byteLengthOfNameWithTerminatingNull = GetProperty(
Constants
.BCRYPT_ALGORITHM_NAME, null, 0);
81
uint numBytesCopied = GetProperty(
Constants
.BCRYPT_ALGORITHM_NAME, pBuffer, byteLengthOfNameWithTerminatingNull);
92
uint numBytesCopied = GetProperty(
Constants
.BCRYPT_BLOCK_LENGTH, &cipherBlockLength, sizeof(uint));
103
uint numBytesCopied = GetProperty(
Constants
.BCRYPT_HASH_BLOCK_LENGTH, &hashBlockLength, sizeof(uint));
114
uint numBytesCopied = GetProperty(
Constants
.BCRYPT_KEY_LENGTHS, &supportedKeyLengths, (uint)sizeof(BCRYPT_KEY_LENGTHS_STRUCT));
125
uint numBytesCopied = GetProperty(
Constants
.BCRYPT_HASH_LENGTH, &digestLength, sizeof(uint));
163
SetProperty(
Constants
.BCRYPT_CHAINING_MODE, pszChainingMode, checked((uint)(chainingMode.Length + 1 /* null terminator */) * sizeof(char)));
Microsoft.AspNetCore.Cryptography.KeyDerivation (5)
PBKDF2\Win7Pbkdf2Provider.cs (1)
31
fixed (byte* pbHeapAllocatedPasswordBuffer = (cbPasswordBuffer >
Constants
.MAX_STACKALLOC_BYTES) ? new byte[cbPasswordBuffer] : null)
PBKDF2\Win8Pbkdf2Provider.cs (4)
65
fixed (byte* pbHeapAllocatedPasswordBuffer = (cbPasswordBuffer >
Constants
.MAX_STACKALLOC_BYTES) ? new byte[cbPasswordBuffer] : null)
201
return
Constants
.BCRYPT_SHA1_ALGORITHM;
203
return
Constants
.BCRYPT_SHA256_ALGORITHM;
205
return
Constants
.BCRYPT_SHA512_ALGORITHM;
Microsoft.AspNetCore.DataProtection (15)
AuthenticatedEncryption\AlgorithmAssert.cs (1)
22
private const uint MAX_SIZE_IN_BITS =
Constants
.MAX_STACKALLOC_BYTES * 8;
AuthenticatedEncryption\AuthenticatedEncryptorFactory.cs (3)
144
return
Constants
.BCRYPT_AES_ALGORITHM;
156
return
Constants
.BCRYPT_SHA256_ALGORITHM;
159
return
Constants
.BCRYPT_SHA512_ALGORITHM;
AuthenticatedEncryption\CngCbcAuthenticatedEncryptorFactory.cs (5)
81
if (configuration.HashAlgorithm ==
Constants
.BCRYPT_SHA1_ALGORITHM) { algorithmHandle = CachedAlgorithmHandles.HMAC_SHA1; }
82
else if (configuration.HashAlgorithm ==
Constants
.BCRYPT_SHA256_ALGORITHM) { algorithmHandle = CachedAlgorithmHandles.HMAC_SHA256; }
83
else if (configuration.HashAlgorithm ==
Constants
.BCRYPT_SHA512_ALGORITHM) { algorithmHandle = CachedAlgorithmHandles.HMAC_SHA512; }
120
if (configuration.EncryptionAlgorithm ==
Constants
.BCRYPT_AES_ALGORITHM) { algorithmHandle = CachedAlgorithmHandles.AES_CBC; }
127
algorithmHandle.SetChainingMode(
Constants
.BCRYPT_CHAIN_MODE_CBC);
AuthenticatedEncryption\CngGcmAuthenticatedEncryptorFactory.cs (2)
86
if (configuration.EncryptionAlgorithm ==
Constants
.BCRYPT_AES_ALGORITHM) { algorithmHandle = CachedAlgorithmHandles.AES_GCM; }
93
algorithmHandle.SetChainingMode(
Constants
.BCRYPT_CHAIN_MODE_GCM);
AuthenticatedEncryption\ConfigurationModel\CngCbcAuthenticatedEncryptorConfiguration.cs (2)
28
public string EncryptionAlgorithm { get; set; } =
Constants
.BCRYPT_AES_ALGORITHM;
63
public string HashAlgorithm { get; set; } =
Constants
.BCRYPT_SHA256_ALGORITHM;
AuthenticatedEncryption\ConfigurationModel\CngGcmAuthenticatedEncryptorConfiguration.cs (1)
28
public string EncryptionAlgorithm { get; set; } =
Constants
.BCRYPT_AES_ALGORITHM;
SP800_108\SP800_108_CTR_HMACSHA512Extensions.cs (1)
15
byte[]? heapAllocatedCombinedContext = (cbCombinedContext >
Constants
.MAX_STACKALLOC_BYTES) ? new byte[cbCombinedContext] : null;
Microsoft.AspNetCore.DataProtection.Tests (3)
AuthenticatedEncryption\ConfigurationModel\CngCbcAuthenticatedEncryptorDescriptorDeserializerTests.cs (2)
25
EncryptionAlgorithm =
Constants
.BCRYPT_AES_ALGORITHM,
28
HashAlgorithm =
Constants
.BCRYPT_SHA512_ALGORITHM,
AuthenticatedEncryption\ConfigurationModel\CngGcmAuthenticatedEncryptorDescriptorDeserializerTests.cs (1)
25
EncryptionAlgorithm =
Constants
.BCRYPT_AES_ALGORITHM,