summaryrefslogtreecommitdiff
path: root/rsa.cpp
diff options
context:
space:
mode:
authorweidai <weidai11@users.noreply.github.com>2005-01-20 04:19:35 +0000
committerweidai <weidai11@users.noreply.github.com>2005-01-20 04:19:35 +0000
commitb3924f2108c0b0825060e91f6fde8202ce35624d (patch)
tree1f61e8bf59450a028415e5a3f08565a6ceb86afe /rsa.cpp
parent79e29d0de49969af44474cc890cffd7b1d6b1a4b (diff)
downloadcryptopp-git-b3924f2108c0b0825060e91f6fde8202ce35624d.tar.gz
changes done for FIPS-140 lab code drop
Diffstat (limited to 'rsa.cpp')
-rw-r--r--rsa.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/rsa.cpp b/rsa.cpp
index 979a61d3..1f29f363 100644
--- a/rsa.cpp
+++ b/rsa.cpp
@@ -285,6 +285,20 @@ void InvertibleRSAFunction::AssignFrom(const NameValuePairs &source)
;
}
+// *****************************************************************************
+
+Integer RSAFunction_ISO::ApplyFunction(const Integer &x) const
+{
+ Integer t = RSAFunction::ApplyFunction(x);
+ return t % 16 == 12 ? t : m_n - t;
+}
+
+Integer InvertibleRSAFunction_ISO::CalculateInverse(RandomNumberGenerator &rng, const Integer &x) const
+{
+ Integer t = InvertibleRSAFunction::CalculateInverse(rng, x);
+ return STDMIN(t, m_n-t);
+}
+
NAMESPACE_END
#endif