summary refs log tree commit diff
path: root/crypto/src/crypto/modes/GOFBBlockCipher.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/crypto/modes/GOFBBlockCipher.cs')
-rw-r--r--crypto/src/crypto/modes/GOFBBlockCipher.cs6
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);