diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2017-06-10 21:48:14 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2017-06-10 21:48:14 +0700 |
commit | db0c88a3eae79a534ff1854089cff24fbf46c7e2 (patch) | |
tree | b73aad3bd3e699ad8af4e29626e3e5b2659d23c2 | |
parent | Misc. asn1 changes from Java API (diff) | |
download | BouncyCastle.NET-ed25519-db0c88a3eae79a534ff1854089cff24fbf46c7e2.tar.xz |
Additional fix to GOFB mode
-rw-r--r-- | crypto/src/crypto/modes/GOFBBlockCipher.cs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/crypto/src/crypto/modes/GOFBBlockCipher.cs b/crypto/src/crypto/modes/GOFBBlockCipher.cs index 4299f11a9..436b58a1d 100644 --- a/crypto/src/crypto/modes/GOFBBlockCipher.cs +++ b/crypto/src/crypto/modes/GOFBBlockCipher.cs @@ -171,7 +171,10 @@ namespace Org.BouncyCastle.Crypto.Modes N4 += C1; if (N4 < C1) // addition is mod (2**32 - 1) { - N4++; + if (N4 > 0) + { + N4++; + } } intTobytes(N3, ofbV, 0); intTobytes(N4, ofbV, 4); |