From d07b0dfa3658653cb9cbdbe5c7847a447b265093 Mon Sep 17 00:00:00 2001 From: weidai Date: Mon, 24 Sep 2007 02:54:22 +0000 Subject: update CheckMOVCondition() according to http://eprint.iacr.org/2007/343 git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@402 57ff6487-cd31-0410-9ec3-f628ee90f5f0 --- eccrypto.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'eccrypto.cpp') diff --git a/eccrypto.cpp b/eccrypto.cpp index 91ec54f..f0ff9ee 100644 --- a/eccrypto.cpp +++ b/eccrypto.cpp @@ -46,12 +46,16 @@ static inline Integer ConvertToInteger(const Integer &x) static bool CheckMOVCondition(const Integer &q, const Integer &r) { - Integer t=1; - unsigned int n=q.BitCount(), m=r.BitCount(); + // see "Updated standards for validating elliptic curves", http://eprint.iacr.org/2007/343 + Integer t = 1; + unsigned int n = q.IsEven() ? 1 : q.BitCount(), m = r.BitCount(); for (unsigned int i=n; DiscreteLogWorkFactor(i)