diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2022-09-30 16:53:12 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2022-09-30 16:53:12 +0700 |
commit | a09c375662ea7d74caa790ad9cf3dfed1f748934 (patch) | |
tree | 2d0232025123031ec4a8fe7448f1c3871dc9a597 | |
parent | Refactoring (diff) | |
download | BouncyCastle.NET-ed25519-a09c375662ea7d74caa790ad9cf3dfed1f748934.tar.xz |
Fix parameter name
-rw-r--r-- | crypto/src/crypto/generators/HKdfBytesGenerator.cs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/crypto/src/crypto/generators/HKdfBytesGenerator.cs b/crypto/src/crypto/generators/HKdfBytesGenerator.cs index e5c122049..43cd66525 100644 --- a/crypto/src/crypto/generators/HKdfBytesGenerator.cs +++ b/crypto/src/crypto/generators/HKdfBytesGenerator.cs @@ -144,9 +144,9 @@ namespace Org.BouncyCastle.Crypto.Generators } #if NETCOREAPP2_1_OR_GREATER || NETSTANDARD2_1_OR_GREATER - public int GenerateBytes(Span<byte> outputX) + public int GenerateBytes(Span<byte> output) { - int length = outputX.Length; + int length = output.Length; if (generatedBytes > 255 * hashLen - length) throw new DataLengthException("HKDF may only be used for 255 * HashLen bytes of output"); @@ -154,19 +154,19 @@ namespace Org.BouncyCastle.Crypto.Generators if (posInT != 0) { // copy what is left in the currentT (1..hash - int toCopy = System.Math.Min(hashLen - posInT, outputX.Length); - currentT.AsSpan(posInT, toCopy).CopyTo(outputX); + int toCopy = System.Math.Min(hashLen - posInT, output.Length); + currentT.AsSpan(posInT, toCopy).CopyTo(output); generatedBytes += toCopy; - outputX = outputX[toCopy..]; + output = output[toCopy..]; } - while (!outputX.IsEmpty) + while (!output.IsEmpty) { ExpandNext(); - int toCopy = System.Math.Min(hashLen, outputX.Length); - currentT.AsSpan(0, toCopy).CopyTo(outputX); + int toCopy = System.Math.Min(hashLen, output.Length); + currentT.AsSpan(0, toCopy).CopyTo(output); generatedBytes += toCopy; - outputX = outputX[toCopy..]; + output = output[toCopy..]; } return length; |