178 references to CryptoPool
System.Security.Cryptography (178)
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Encode.cs (2)
61
byte[] data =
CryptoPool
.Rent(size);
72
CryptoPool
.Return(data);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.EvpPkey.cs (2)
149
byte[] rented =
CryptoPool
.Rent(size);
200
byte[] rented =
CryptoPool
.Rent(size);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.PooledCrypto.cs (2)
26
byte[] bytes =
CryptoPool
.Rent(targetSize);
32
CryptoPool
.Return(bytes);
src\libraries\Common\src\System\Security\Cryptography\Asn1Reader\AsnValueReader.cs (1)
253
byte[] rented =
CryptoPool
.Rent(writer.GetEncodedLength());
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\libraries\Common\src\System\Security\Cryptography\CryptoPool.cs (2)
64
CryptoPool
.Return(_rented, clearSize);
83
byte[] rented =
CryptoPool
.Rent(length);
src\libraries\Common\src\System\Security\Cryptography\KeyFormatHelper.Encrypted.cs (10)
118
byte[] decrypted =
CryptoPool
.Rent(epki.EncryptedData.Length);
154
CryptoPool
.Return(decrypted, clearSize: 0);
203
byte[] encryptedRent =
CryptoPool
.Rent(
247
CryptoPool
.Return(encryptedRent, clearSize: 0);
302
CryptoPool
.Return(decrypted);
333
CryptoPool
.Return(decrypted);
361
byte[] decrypted =
CryptoPool
.Rent(epki.EncryptedData.Length);
378
CryptoPool
.Return(decrypted);
415
CryptoPool
.Return(decrypted);
451
CryptoPool
.Return(decrypted);
src\libraries\Common\src\System\Security\Cryptography\MLDsa.cs (8)
2084
byte[] rented =
CryptoPool
.Rent(publicKeySizeInBytes);
2113
CryptoPool
.Return(rented, clearSize: 0);
2183
byte[] buffer =
CryptoPool
.Rent(size);
2188
CryptoPool
.Return(buffer);
2190
buffer =
CryptoPool
.Rent(size);
2206
CryptoPool
.Return(buffer, written);
2247
byte[] rent =
CryptoPool
.Rent(privateKeySize);
2270
CryptoPool
.Return(rent, privateKeySize);
src\libraries\Common\src\System\Security\Cryptography\MLDsaImplementation.cs (2)
33
byte[] rented =
CryptoPool
.Rent(alg.PrivateKeySizeInBytes);
50
CryptoPool
.Return(rented);
src\libraries\Common\src\System\Security\Cryptography\MLDsaPkcs8.cs (3)
33
rented =
CryptoPool
.Rent(seedSize);
42
rented =
CryptoPool
.Rent(privateKeySize);
68
CryptoPool
.Return(rented, written);
src\libraries\Common\src\System\Security\Cryptography\MLKem.cs (12)
1668
byte[] encapsulationKeyBuffer =
CryptoPool
.Rent(encapsulationKeySize);
1695
CryptoPool
.Return(encapsulationKeyBuffer, clearSize: 0); // SPKI is public info, skip clear.
1759
byte[] rent =
CryptoPool
.Rent(decapsulationKeySize);
1782
CryptoPool
.Return(rent, decapsulationKeySize);
1804
byte[] rented =
CryptoPool
.Rent(initialSize);
1809
CryptoPool
.Return(rented, 0);
1810
rented =
CryptoPool
.Rent(rented.Length * 2);
1823
CryptoPool
.Return(rented, written);
1834
byte[] buffer =
CryptoPool
.Rent(size); // Only passed out as span, callees can't keep a reference to it
1839
CryptoPool
.Return(buffer);
1841
buffer =
CryptoPool
.Rent(size);
1852
CryptoPool
.Return(buffer, written);
src\libraries\Common\src\System\Security\Cryptography\MLKemImplementation.cs (2)
22
byte[] rented =
CryptoPool
.Rent(alg.DecapsulationKeySizeInBytes);
41
CryptoPool
.Return(rented, size);
src\libraries\Common\src\System\Security\Cryptography\MLKemPkcs8.cs (3)
33
rented =
CryptoPool
.Rent(seedSize);
42
rented =
CryptoPool
.Rent(decapsulationKeySize);
68
CryptoPool
.Return(rented, written);
src\libraries\Common\src\System\Security\Cryptography\PasswordBasedEncryption.cs (10)
188
rented =
CryptoPool
.Rent(byteCount);
223
CryptoPool
.Return(rented, clearSize: 0);
326
byte[] sourceRent =
CryptoPool
.Rent(sourceLength);
443
CryptoPool
.Return(sourceRent, sourceLength);
473
rented =
CryptoPool
.Rent(byteCount);
504
CryptoPool
.Return(rented, buf.Length);
925
byte[] rentedEncryptedData =
CryptoPool
.Rent(encryptedData.Length);
926
byte[] rentedDestination =
CryptoPool
.Rent(destination.Length);
971
CryptoPool
.Return(rentedEncryptedData, encryptedData.Length);
972
CryptoPool
.Return(rentedDestination, destination.Length);
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\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\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12SafeContents.cs (2)
371
byte[] encryptedRent =
CryptoPool
.Rent(contentsWriter.GetEncodedLength() + cipherBlockBytes);
426
CryptoPool
.Return(encryptedRent, clearSize: 0);
src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs8PrivateKeyInfo.cs (2)
200
CryptoPool
.Return(decrypted);
231
CryptoPool
.Return(decrypted);
src\libraries\Common\src\System\Security\Cryptography\Pkcs12Kdf.cs (2)
154
IRented =
CryptoPool
.Rent(ILen);
229
CryptoPool
.Return(IRented, clearSize: 0);
src\libraries\Common\src\System\Security\Cryptography\RSAKeyFormatHelper.cs (2)
145
byte[] rented =
CryptoPool
.Rent(pkcs1PublicKey.GetEncodedLength());
156
CryptoPool
.Return(rented, clearSize: 0);
src\libraries\Common\src\System\Security\Cryptography\RSAOpenSsl.cs (12)
91
byte[] buf =
CryptoPool
.Rent(rsaSize);
103
CryptoPool
.Return(buf, clearSize: 0);
131
rent =
CryptoPool
.Rent(keySizeBytes);
157
CryptoPool
.Return(rent, clearSize: 0);
296
CryptoPool
.Return(p8);
315
CryptoPool
.Return(p8);
332
CryptoPool
.Return(spki);
359
CryptoPool
.Return(spki);
464
CryptoPool
.Return(pkcs8);
478
CryptoPool
.Return(spki);
512
CryptoPool
.Return(spki);
628
CryptoPool
.Return(pkcs8);
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\libraries\Common\src\System\Security\Cryptography\SlhDsa.cs (4)
1958
byte[] buffer =
CryptoPool
.Rent(size);
1963
CryptoPool
.Return(buffer);
1965
buffer =
CryptoPool
.Rent(size);
1981
CryptoPool
.Return(buffer, written);
src\libraries\Common\src\System\Security\Cryptography\Utf8DataEncoding.cs (2)
20
(_rented =
CryptoPool
.Rent(maxLength));
34
CryptoPool
.Return(_rented, clearSize: 0);
src\libraries\Common\src\System\Security\Cryptography\X509Certificates\X509CertificateLoader.cs (2)
578
CryptoPool
.Return(rented, length);
650
byte[] rented =
CryptoPool
.Rent(totalLength);
src\libraries\Common\src\System\Security\Cryptography\X509Certificates\X509CertificateLoader.Pkcs12.cs (8)
936
CryptoPool
.Return(_decryptBuffer, _decryptBufferOffset);
941
CryptoPool
.Return(_keyDecryptBuffer, _keyDecryptBufferOffset);
972
_decryptBuffer =
CryptoPool
.Rent(upperBound);
1095
_keyDecryptBuffer =
CryptoPool
.Rent(spaceRequired);
1123
CryptoPool
.Return(decrypted);
1151
CryptoPool
.Return(decrypted);
1178
CryptoPool
.Return(decrypted);
1318
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(inputCount);
204
transformBuffer = transformBufferArray =
CryptoPool
.Rent(inputCount);
321
CryptoPool
.Return(array, clearSize);
System\Security\Cryptography\EccKeyFormatHelper.cs (4)
777
basePointBytes = rented =
CryptoPool
.Rent(basePointLength);
789
CryptoPool
.Return(rented, clearSize: 0);
805
publicKeyBytes = rented =
CryptoPool
.Rent(publicKeyLength);
817
CryptoPool
.Return(rented, clearSize: 0);
System\Security\Cryptography\Helpers.cs (2)
538
? (rented =
CryptoPool
.Rent(messageLength))
566
CryptoPool
.Return(rented);
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\OpenSslCipherLite.cs (4)
66
byte[] rented =
CryptoPool
.Rent(input.Length);
80
CryptoPool
.Return(rented, clearSize: written);
106
byte[] tmp =
CryptoPool
.Rent(input.Length);
118
CryptoPool
.Return(tmp, written);
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\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\X509Certificates\CertificateRequest.cs (3)
1103
CryptoPool
.Return(normalizedSerial);
1114
newSerialNumber =
CryptoPool
.Rent(serialNumber.Length + 1);
1128
newSerialNumber =
CryptoPool
.Rent(contentLength);
System\Security\Cryptography\X509Certificates\OpenSslCrlCache.cs (1)
377
CryptoPool
.Return(crlDistributionPoints.Array, clearSize: 0);
System\Security\Cryptography\X509Certificates\OpenSslX509ChainProcessor.cs (5)
258
CryptoPool
.Return(authorityInformationAccess.Array!, clearSize: 0);
290
tempChainRent =
CryptoPool
.Rent(targetSize);
329
CryptoPool
.Return(tempChainRent);
786
CryptoPool
.Return(encoded.Array!, clearSize: 0);
1214
CryptoPool
.Return(authorityInformationAccess.Array!, clearSize: 0);
System\Security\Cryptography\X509Certificates\X509Certificate2.cs (2)
1561
byte[] certBytes =
CryptoPool
.Rent(fields.DecodedDataLength);
1586
CryptoPool
.Return(certBytes, clearSize: 0);
System\Security\Cryptography\X509Certificates\X509CertificateLoader.Unix.cs (6)
176
CryptoPool
.Return(rented, length);
511
byte[] buf =
CryptoPool
.Rent(sizeHint);
517
CryptoPool
.Return(buf);
518
buf =
CryptoPool
.Rent(sizeHint);
591
internal void TrackArray(byte[]? rented, int clearSize =
CryptoPool
.ClearAll)
606
CryptoPool
.Return(rented, _clearSize);