summaryrefslogtreecommitdiff
path: root/rsa.cpp
diff options
context:
space:
mode:
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 979a61d..1f29f36 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