summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--crypto/src/security/SecureRandom.cs2
-rw-r--r--crypto/src/tls/crypto/impl/bc/BcTlsCrypto.cs4
2 files changed, 3 insertions, 3 deletions
diff --git a/crypto/src/security/SecureRandom.cs b/crypto/src/security/SecureRandom.cs
index a9c062b4e..03552c38f 100644
--- a/crypto/src/security/SecureRandom.cs
+++ b/crypto/src/security/SecureRandom.cs
@@ -28,7 +28,7 @@ namespace Org.BouncyCastle.Security
             DigestRandomGenerator prng = new DigestRandomGenerator(digest);
             if (autoSeed)
             {
-                AutoSeed(prng, digest.GetDigestSize());
+                AutoSeed(prng, digest.GetByteLength());
             }
             return prng;
         }
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];