diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2023-02-10 20:15:43 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2023-02-10 20:15:43 +0700 |
commit | 73fd71e229b01f2d794225aa4a51c2eea2be1a2a (patch) | |
tree | 4bc089b857cb9a295d14b363eb959e3548a4e2c8 /crypto/src/tls | |
parent | Refactor Haraka (diff) | |
download | BouncyCastle.NET-ed25519-73fd71e229b01f2d794225aa4a51c2eea2be1a2a.tar.xz |
Increase seed size for DigestRandomGenerator uses
Diffstat (limited to 'crypto/src/tls')
-rw-r--r-- | crypto/src/tls/crypto/impl/bc/BcTlsCrypto.cs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/src/tls/crypto/impl/bc/BcTlsCrypto.cs b/crypto/src/tls/crypto/impl/bc/BcTlsCrypto.cs index 8e193f187..81a29fb08 100644 --- a/crypto/src/tls/crypto/impl/bc/BcTlsCrypto.cs +++ b/crypto/src/tls/crypto/impl/bc/BcTlsCrypto.cs @@ -162,7 +162,7 @@ namespace Org.BouncyCastle.Tls.Crypto.Impl.BC int cryptoHashAlgorithm = CryptoHashAlgorithm.sha256; IDigest digest = CreateDigest(cryptoHashAlgorithm); - int seedLength = TlsCryptoUtilities.GetHashOutputSize(cryptoHashAlgorithm); + int seedLength = TlsCryptoUtilities.GetHashInternalSize(cryptoHashAlgorithm); byte[] seed = new byte[seedLength]; SecureRandom.NextBytes(seed); @@ -180,7 +180,7 @@ namespace Org.BouncyCastle.Tls.Crypto.Impl.BC int cryptoHashAlgorithm = CryptoHashAlgorithm.sha256; IDigest digest = CreateDigest(cryptoHashAlgorithm); - int seedLength = TlsCryptoUtilities.GetHashOutputSize(cryptoHashAlgorithm); + int seedLength = TlsCryptoUtilities.GetHashInternalSize(cryptoHashAlgorithm); Span<byte> seed = seedLength <= 128 ? stackalloc byte[seedLength] : new byte[seedLength]; |