diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2023-02-13 00:21:54 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2023-02-13 00:21:54 +0700 |
commit | 0cc90bd796fe6b7330f95dbd77903cea89b95dc2 (patch) | |
tree | 50f469647c2831121d58c0453a0f373c5312d07a /crypto/src/tls | |
parent | Refactor Wnaf (diff) | |
download | BouncyCastle.NET-ed25519-0cc90bd796fe6b7330f95dbd77903cea89b95dc2.tar.xz |
Use 2 * output length for seed size
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 81a29fb08..0cad3e10d 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.GetHashInternalSize(cryptoHashAlgorithm); + int seedLength = 2 * TlsCryptoUtilities.GetHashOutputSize(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.GetHashInternalSize(cryptoHashAlgorithm); + int seedLength = 2 * TlsCryptoUtilities.GetHashOutputSize(cryptoHashAlgorithm); Span<byte> seed = seedLength <= 128 ? stackalloc byte[seedLength] : new byte[seedLength]; |