diff options
author | David Hook <dgh@bouncycastle.org> | 2017-03-07 10:24:47 +1100 |
---|---|---|
committer | David Hook <dgh@bouncycastle.org> | 2017-03-07 10:24:47 +1100 |
commit | d5444a1292a4b67dea5d0278e169abb7aaad7a3a (patch) | |
tree | 926a47aa629129c8b51a8cc760cb87ff9a1a5e46 /crypto/src | |
parent | Fix bug in SecT571KPoint.Add with order-2 points (lambda-projective). (diff) | |
download | BouncyCastle.NET-ed25519-d5444a1292a4b67dea5d0278e169abb7aaad7a3a.tar.xz |
Fixed N4 calculation issue - see BJA-655
Diffstat (limited to 'crypto/src')
-rw-r--r-- | crypto/src/crypto/modes/GOFBBlockCipher.cs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/crypto/src/crypto/modes/GOFBBlockCipher.cs b/crypto/src/crypto/modes/GOFBBlockCipher.cs index a91562549..4299f11a9 100644 --- a/crypto/src/crypto/modes/GOFBBlockCipher.cs +++ b/crypto/src/crypto/modes/GOFBBlockCipher.cs @@ -169,7 +169,11 @@ namespace Org.BouncyCastle.Crypto.Modes } N3 += C2; N4 += C1; - intTobytes(N3, ofbV, 0); + if (N4 < C1) // addition is mod (2**32 - 1) + { + N4++; + } + intTobytes(N3, ofbV, 0); intTobytes(N4, ofbV, 4); cipher.ProcessBlock(ofbV, 0, ofbOutV, 0); |