From 242d67fb17619670d9b757c442dcf2e26d8478a1 Mon Sep 17 00:00:00 2001 From: weidai Date: Thu, 20 Jan 2005 04:19:35 +0000 Subject: changes done for FIPS-140 lab code drop git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@195 57ff6487-cd31-0410-9ec3-f628ee90f5f0 --- rsa.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'rsa.cpp') 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 -- cgit v1.2.1