206 references to CryptoPool
System.Security.Cryptography (206)
src\runtime\src\libraries\Common\src\Interop\Windows\BCrypt\Interop.BCryptExportKey.cs (4)
35
byte[] rented =
CryptoPool
.Rent(numBytesNeeded);
40
CryptoPool
.Return(rented);
91
byte[] rented =
CryptoPool
.Rent(numBytesNeeded);
110
CryptoPool
.Return(rented, clearSize: 0);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CngHelpers.cs (2)
156
byte[] buffer =
CryptoPool
.Rent(numBytesNeeded);
174
CryptoPool
.Return(buffer, clearSize: 0);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CngPkcs8.cs (12)
141
byte[] tmp =
CryptoPool
.Rent(pkcs8Writer.GetEncodedLength());
150
CryptoPool
.Return(tmp, written);
194
CryptoPool
.Return(decrypted);
262
CryptoPool
.Return(decrypted);
295
byte[] rented =
CryptoPool
.Rent(key.KeySize);
313
rented =
CryptoPool
.Rent(checked(size * 2));
314
CryptoPool
.Return(current, rentWritten);
326
CryptoPool
.Return(rented, rentWritten);
337
byte[] rented =
CryptoPool
.Rent(key.KeySize);
350
rented =
CryptoPool
.Rent(checked(size * 2));
351
CryptoPool
.Return(current, rentWritten);
362
CryptoPool
.Return(rented, rentWritten);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CompositeMLDsa.cs (4)
1885
byte[] buffer =
CryptoPool
.Rent(size);
1891
CryptoPool
.Return(buffer);
1893
buffer =
CryptoPool
.Rent(size);
1909
CryptoPool
.Return(buffer, written);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CryptoPool.cs (2)
64
CryptoPool
.Return(_rented, clearSize);
83
byte[] rented =
CryptoPool
.Rent(length);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\KeyFormatHelper.Encrypted.cs (10)
148
byte[] decrypted =
CryptoPool
.Rent(epki.EncryptedData.Length);
185
CryptoPool
.Return(decrypted, clearSize: 0);
234
byte[] encryptedRent =
CryptoPool
.Rent(
278
CryptoPool
.Return(encryptedRent, clearSize: 0);
329
CryptoPool
.Return(decrypted);
354
CryptoPool
.Return(decrypted);
380
byte[] decrypted =
CryptoPool
.Rent(epki.EncryptedData.Length);
397
CryptoPool
.Return(decrypted);
434
CryptoPool
.Return(decrypted);
470
CryptoPool
.Return(decrypted);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\MLDsa.cs (8)
2049
byte[] rented =
CryptoPool
.Rent(publicKeySizeInBytes);
2078
CryptoPool
.Return(rented, clearSize: 0);
2148
byte[] buffer =
CryptoPool
.Rent(size);
2154
CryptoPool
.Return(buffer);
2156
buffer =
CryptoPool
.Rent(size);
2172
CryptoPool
.Return(buffer, written);
2213
byte[] rent =
CryptoPool
.Rent(privateKeySize);
2236
CryptoPool
.Return(rent, privateKeySize);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\MLDsaCng.Windows.cs (2)
246
CryptoPool
.Return(pkcs8);
513
CryptoPool
.Return(pkcs8);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\MLDsaImplementation.cs (2)
33
byte[] rented =
CryptoPool
.Rent(alg.PrivateKeySizeInBytes);
50
CryptoPool
.Return(rented);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\MLDsaImplementation.Windows.cs (1)
251
CryptoPool
.Return(keyBlob);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\MLDsaPkcs8.cs (3)
32
rented =
CryptoPool
.Rent(seedSize);
41
rented =
CryptoPool
.Rent(privateKeySize);
67
CryptoPool
.Return(rented, written);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\MLKem.cs (12)
1638
byte[] encapsulationKeyBuffer =
CryptoPool
.Rent(encapsulationKeySize);
1665
CryptoPool
.Return(encapsulationKeyBuffer, clearSize: 0); // SPKI is public info, skip clear.
1727
byte[] rent =
CryptoPool
.Rent(decapsulationKeySize);
1750
CryptoPool
.Return(rent, decapsulationKeySize);
1772
byte[] rented =
CryptoPool
.Rent(initialSize);
1777
CryptoPool
.Return(rented, 0);
1778
rented =
CryptoPool
.Rent(rented.Length * 2);
1791
CryptoPool
.Return(rented, written);
1802
byte[] buffer =
CryptoPool
.Rent(size); // Only passed out as span, callees can't keep a reference to it
1808
CryptoPool
.Return(buffer);
1810
buffer =
CryptoPool
.Rent(size);
1821
CryptoPool
.Return(buffer, written);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\MLKemCng.Windows.cs (2)
262
byte[] buffer =
CryptoPool
.Rent(bufferSize);
288
CryptoPool
.Return(buffer, clearSize: 0); // Manually cleared above.
src\runtime\src\libraries\Common\src\System\Security\Cryptography\MLKemImplementation.cs (2)
22
byte[] rented =
CryptoPool
.Rent(alg.DecapsulationKeySizeInBytes);
41
CryptoPool
.Return(rented, size);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\MLKemImplementation.Windows.cs (2)
177
CryptoPool
.Return(key, clearSize: 0);
181
CryptoPool
.Return(key);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\MLKemPkcs8.cs (3)
32
rented =
CryptoPool
.Rent(seedSize);
41
rented =
CryptoPool
.Rent(decapsulationKeySize);
67
CryptoPool
.Return(rented, written);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\PasswordBasedEncryption.cs (10)
215
rented =
CryptoPool
.Rent(byteCount);
250
CryptoPool
.Return(rented, clearSize: 0);
353
byte[] sourceRent =
CryptoPool
.Rent(sourceLength);
470
CryptoPool
.Return(sourceRent, sourceLength);
500
rented =
CryptoPool
.Rent(byteCount);
531
CryptoPool
.Return(rented, buf.Length);
966
byte[] rentedEncryptedData =
CryptoPool
.Rent(encryptedData.Length);
967
byte[] rentedDestination =
CryptoPool
.Rent(destination.Length);
1012
CryptoPool
.Return(rentedEncryptedData, encryptedData.Length);
1013
CryptoPool
.Return(rentedDestination, destination.Length);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\PemKeyHelpers.Factory.cs (4)
71
byte[] decodeBuffer =
CryptoPool
.Rent(base64size);
91
CryptoPool
.Return(decodeBuffer, clearSize: bytesWritten);
136
byte[] decodeBuffer =
CryptoPool
.Rent(base64size);
156
CryptoPool
.Return(decodeBuffer, clearSize: bytesWritten);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12Builder.cs (4)
180
rentedAuthSafe =
CryptoPool
.Rent(contentsWriter.GetEncodedLength());
192
rentedMac =
CryptoPool
.Rent(macKey.Length);
293
CryptoPool
.Return(rentedMac, clearSize: 0);
299
CryptoPool
.Return(rentedAuthSafe, clearSize: 0);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12SafeContents.cs (2)
432
byte[] encryptedRent =
CryptoPool
.Rent(contentsWriter.GetEncodedLength() + cipherBlockBytes);
487
CryptoPool
.Return(encryptedRent, clearSize: 0);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs8PrivateKeyInfo.cs (2)
200
CryptoPool
.Return(decrypted);
231
CryptoPool
.Return(decrypted);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Pkcs12Kdf.cs (2)
154
IRented =
CryptoPool
.Rent(ILen);
229
CryptoPool
.Return(IRented, clearSize: 0);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\PqcBlobHelpers.cs (4)
122
: (rented =
CryptoPool
.Rent(blobSize));
154
CryptoPool
.Return(rented, blobSize);
243
(rented =
CryptoPool
.Rent(blobSize));
271
CryptoPool
.Return(rented, 0);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\RSACng.EncryptDecrypt.cs (4)
60
byte[] rented =
CryptoPool
.Rent(modulusSizeInBytes);
83
CryptoPool
.Return(rented, clearSize: 0);
142
byte[] rented =
CryptoPool
.Rent(modulusSizeInBytes);
165
CryptoPool
.Return(rented, clearSize: 0);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\RSACng.ImportExport.cs (1)
35
CryptoPool
.Return(keyBlob);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\RSAKeyFormatHelper.cs (2)
108
byte[] rented =
CryptoPool
.Rent(pkcs1PublicKey.GetEncodedLength());
119
CryptoPool
.Return(rented, clearSize: 0);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\RsaPaddingProcessor.cs (6)
349
dbMask =
CryptoPool
.Rent(db.Length);
378
CryptoPool
.Return(dbMask, clearSize: 0);
421
byte[] dbMaskRented =
CryptoPool
.Rent(dbLen);
469
CryptoPool
.Return(dbMaskRented, clearSize: 0);
519
byte[] dbMaskRented =
CryptoPool
.Rent(maskedDb.Length);
583
CryptoPool
.Return(dbMaskRented, clearSize: 0);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\SlhDsa.cs (4)
1957
byte[] buffer =
CryptoPool
.Rent(size);
1963
CryptoPool
.Return(buffer);
1965
buffer =
CryptoPool
.Rent(size);
1981
CryptoPool
.Return(buffer, written);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Utf8DataEncoding.cs (2)
20
(_rented =
CryptoPool
.Rent(maxLength));
34
CryptoPool
.Return(_rented, clearSize: 0);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\X509Certificates\X509CertificateLoader.cs (2)
578
CryptoPool
.Return(rented, length);
650
byte[] rented =
CryptoPool
.Rent(totalLength);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\X509Certificates\X509CertificateLoader.Pkcs12.cs (8)
939
CryptoPool
.Return(_decryptBuffer, _decryptBufferOffset);
944
CryptoPool
.Return(_keyDecryptBuffer, _keyDecryptBufferOffset);
975
_decryptBuffer =
CryptoPool
.Rent(upperBound);
1098
_keyDecryptBuffer =
CryptoPool
.Rent(spaceRequired);
1126
CryptoPool
.Return(decrypted);
1154
CryptoPool
.Return(decrypted);
1181
CryptoPool
.Return(decrypted);
1317
byte[] ret =
CryptoPool
.Rent(writer.GetEncodedLength());
System\Security\Cryptography\AsymmetricAlgorithm.cs (4)
788
byte[] buf =
CryptoPool
.Rent(bufSize);
804
CryptoPool
.Return(buf, bytesWritten);
818
byte[] buf =
CryptoPool
.Rent(bufSize);
834
CryptoPool
.Return(buf, bytesWritten);
System\Security\Cryptography\Base64Transforms.cs (3)
158
transformBuffer = transformBufferArray =
CryptoPool
.Rent(bytesToTransform);
205
transformBuffer = transformBufferArray =
CryptoPool
.Rent(bytesToTransform);
326
CryptoPool
.Return(array, clearSize);
System\Security\Cryptography\BasicSymmetricCipherLiteBCrypt.cs (2)
56
byte[] rented =
CryptoPool
.Rent(output.Length);
65
CryptoPool
.Return(rented, clearSize: numBytesWritten);
System\Security\Cryptography\BasicSymmetricCipherLiteNCrypt.cs (2)
66
byte[] rented =
CryptoPool
.Rent(output.Length);
75
CryptoPool
.Return(rented, clearSize: numBytesWritten);
System\Security\Cryptography\CngHelpers.cs (1)
185
byte[] rsaBlob =
CryptoPool
.Rent(blobSize);
System\Security\Cryptography\EccKeyFormatHelper.cs (4)
756
basePointBytes = rented =
CryptoPool
.Rent(basePointLength);
768
CryptoPool
.Return(rented, clearSize: 0);
784
publicKeyBytes = rented =
CryptoPool
.Rent(publicKeyLength);
796
CryptoPool
.Return(rented, clearSize: 0);
System\Security\Cryptography\Helpers.cs (2)
538
? (rented =
CryptoPool
.Rent(messageLength))
566
CryptoPool
.Return(rented);
System\Security\Cryptography\HKDF.Windows.cs (2)
133
rented =
CryptoPool
.Rent(info.Length);
232
CryptoPool
.Return(rented, clearSize: 0); // Info is not considered secret.
System\Security\Cryptography\HKDFManagedImplementation.cs (2)
36
rentedTempInfoBuffer =
CryptoPool
.Rent(info.Length);
81
CryptoPool
.Return(rentedTempInfoBuffer, clearSize: info.Length);
System\Security\Cryptography\LiteHashProvider.cs (4)
116
byte[] rented =
CryptoPool
.Rent(4096);
133
CryptoPool
.Return(rented, clearSize: maxRead);
147
byte[] rented =
CryptoPool
.Rent(4096);
164
CryptoPool
.Return(rented, clearSize: maxRead);
System\Security\Cryptography\LiteHashProvider.Xof.cs (2)
132
byte[] rented =
CryptoPool
.Rent(4096);
149
CryptoPool
.Return(rented, clearSize: maxRead);
System\Security\Cryptography\PemKeyHelpers.cs (8)
32
byte[] buffer =
CryptoPool
.Rent(bufferSize);
49
CryptoPool
.Return(buffer, bytesWritten);
68
byte[] buffer =
CryptoPool
.Rent(bufferSize);
85
CryptoPool
.Return(buffer, bytesWritten);
137
byte[] decodeBuffer =
CryptoPool
.Rent(base64size);
159
CryptoPool
.Return(decodeBuffer, clearSize: bytesWritten);
223
byte[] decodeBuffer =
CryptoPool
.Rent(base64size);
245
CryptoPool
.Return(decodeBuffer, clearSize: bytesWritten);
System\Security\Cryptography\Rfc2898DeriveBytes.OneShot.cs (2)
282
(rentedPasswordBuffer =
CryptoPool
.Rent(maxEncodedSize)) :
298
CryptoPool
.Return(rentedPasswordBuffer, clearSize: 0); // manually cleared above.
System\Security\Cryptography\RSA.cs (6)
684
byte[] hash =
CryptoPool
.Rent(i);
694
CryptoPool
.Return(hash, hashLength);
734
byte[] rented =
CryptoPool
.Rent(rentSize);
753
CryptoPool
.Return(rented, pkcs1Size);
777
byte[] rented =
CryptoPool
.Rent(rentSize);
795
CryptoPool
.Return(rented, pkcs1Size);
System\Security\Cryptography\RSABCrypt.cs (2)
89
CryptoPool
.Return(keyBlob);
114
CryptoPool
.Return(keyBlob);
System\Security\Cryptography\UniversalCryptoDecryptor.cs (5)
89
rentedCiphertext =
CryptoPool
.Rent(inputBuffer.Length);
96
rentedCiphertext =
CryptoPool
.Rent(rentedCiphertextSize);
128
CryptoPool
.Return(rentedCiphertext, clearSize: rentedCiphertextSize);
137
byte[] rented =
CryptoPool
.Rent(inputCount + InputBlockSize);
149
CryptoPool
.Return(rented, clearSize: written);
System\Security\Cryptography\UniversalCryptoOneShot.cs (2)
167
byte[] rentedBuffer =
CryptoPool
.Rent(input.Length);
198
CryptoPool
.Return(rentedBuffer, clearSize: 0); // ZeroMemory clears the part of the buffer that was written to.
System\Security\Cryptography\X25519DiffieHellman.cs (8)
1459
byte[] buffer =
CryptoPool
.Rent(size);
1465
CryptoPool
.Return(buffer);
1467
buffer =
CryptoPool
.Rent(size);
1477
CryptoPool
.Return(buffer, written);
1525
byte[] rented =
CryptoPool
.Rent(initialSize);
1530
CryptoPool
.Return(rented, 0);
1531
rented =
CryptoPool
.Rent(rented.Length * 2);
1544
CryptoPool
.Return(rented, written);
System\Security\Cryptography\X25519DiffieHellmanImplementation.Windows.cs (2)
208
CryptoPool
.Return(key);
212
CryptoPool
.Return(key, clearSize: 0);
System\Security\Cryptography\X509Certificates\CertificateRequest.cs (3)
1103
CryptoPool
.Return(normalizedSerial);
1114
newSerialNumber =
CryptoPool
.Rent(serialNumber.Length + 1);
1128
newSerialNumber =
CryptoPool
.Rent(contentLength);
System\Security\Cryptography\X509Certificates\X509Certificate2.cs (9)
1533
byte[] certBytes =
CryptoPool
.Rent(fields.DecodedDataLength);
1558
CryptoPool
.Return(certBytes, clearSize: 0);
2010
byte[] base64Buffer =
CryptoPool
.Rent(fields.DecodedDataLength);
2011
int base64ClearSize =
CryptoPool
.ClearAll;
2048
CryptoPool
.Return(base64Buffer, base64ClearSize);
2052
CryptoPool
.Return(decryptedPkcs8.Value);
2102
byte[] base64Buffer =
CryptoPool
.Rent(fields.DecodedDataLength);
2103
int clearSize =
CryptoPool
.ClearAll;
2131
CryptoPool
.Return(base64Buffer, clearSize);
System\Security\Cryptography\X509Certificates\X509CertificateLoader.Windows.cs (1)
228
CryptoPool
.Return(reassembled);
System\Security\Cryptography\X509Certificates\X509Pal.Windows.PublicKey.cs (2)
106
CryptoPool
.Return(keyBlob);
115
CryptoPool
.Return(keyBlob);