aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorlloyd <[email protected]>2009-11-13 14:59:29 +0000
committerlloyd <[email protected]>2009-11-13 14:59:29 +0000
commit4a68c67cc526a2223344ed12c3dc4728d6de3455 (patch)
tree5582fc16495b3416e134ec2d4cfce25013b05ac5 /src
parente0f6da3b507cfb4004e9e31b529e09795741a620 (diff)
Fix FPE decryption; off by one in the round numbers
Diffstat (limited to 'src')
-rw-r--r--src/fpe/fpe.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/fpe/fpe.cpp b/src/fpe/fpe.cpp
index b2dbf7eb1..e3be34ef0 100644
--- a/src/fpe/fpe.cpp
+++ b/src/fpe/fpe.cpp
@@ -156,8 +156,8 @@ BigInt fpe_decrypt(const BigInt& n, const BigInt& X0,
BigInt W = X % a;
BigInt R = X / a;
- BigInt L = (W - F(r-i, R)) % a;
- X = b*L + R;
+ BigInt L = (W - F(r-i-1, R)) % a;
+ X = b * L + R;
}
return X;