aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-12-03 06:20:55 -0500
committerJack Lloyd <[email protected]>2018-12-03 06:29:46 -0500
commit6c3eef4013e7da971ae884fd4dcb8318fbfcc05b (patch)
tree327227ef12df76adab90c7243e3c40b98039eab7
parente8262744f661f5373be7f8bb1ff175dcab3bf339 (diff)
Use ct_modulo in format preserving encryption
-rw-r--r--src/lib/misc/fpe_fe1/fpe_fe1.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/misc/fpe_fe1/fpe_fe1.cpp b/src/lib/misc/fpe_fe1/fpe_fe1.cpp
index 3bd01ce34..98ada495a 100644
--- a/src/lib/misc/fpe_fe1/fpe_fe1.cpp
+++ b/src/lib/misc/fpe_fe1/fpe_fe1.cpp
@@ -151,7 +151,7 @@ BigInt FPE_FE1::encrypt(const BigInt& input, const uint8_t tweak[], size_t tweak
BigInt L, R, Fi;
for(size_t i = 0; i != m_rounds; ++i)
{
- divide(X, m_b, L, R);
+ ct_divide(X, m_b, L, R);
Fi = F(R, i, tweak_mac, tmp);
X = m_a * R + mod_a->reduce(L + Fi);
}
@@ -169,7 +169,7 @@ BigInt FPE_FE1::decrypt(const BigInt& input, const uint8_t tweak[], size_t tweak
BigInt W, R, Fi;
for(size_t i = 0; i != m_rounds; ++i)
{
- divide(X, m_a, R, W);
+ ct_divide(X, m_a, R, W);
Fi = F(R, m_rounds-i-1, tweak_mac, tmp);
X = m_b * mod_a->reduce(W - Fi) + R;