diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2020-07-07 20:02:33 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2020-07-07 20:02:33 +0700 |
commit | a95851033775d6608f0dacaa30802f2f969add1f (patch) | |
tree | 8b5352c0bcf6b0350bcc26160f31baf8ee5557e0 | |
parent | Rewrite enumeration of BEROctetString (diff) | |
download | BouncyCastle.NET-ed25519-a95851033775d6608f0dacaa30802f2f969add1f.tar.xz |
Extract common expression
-rw-r--r-- | crypto/src/crypto/digests/KeccakDigest.cs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/src/crypto/digests/KeccakDigest.cs b/crypto/src/crypto/digests/KeccakDigest.cs index 5db13886a..62a9e03b6 100644 --- a/crypto/src/crypto/digests/KeccakDigest.cs +++ b/crypto/src/crypto/digests/KeccakDigest.cs @@ -172,7 +172,8 @@ namespace Org.BouncyCastle.Crypto.Digests int bytesInQueue = bitsInQueue >> 3; int rateBytes = rate >> 3; - if (len < (rateBytes - bytesInQueue)) + int available = rateBytes - bytesInQueue; + if (len < available) { Array.Copy(data, off, dataQueue, bytesInQueue, len); this.bitsInQueue += len << 3; @@ -182,7 +183,6 @@ namespace Org.BouncyCastle.Crypto.Digests int count = 0; if (bytesInQueue > 0) { - int available = rateBytes - bytesInQueue; Array.Copy(data, off, dataQueue, bytesInQueue, available); count += available; KeccakAbsorb(dataQueue, 0); |