Hi All,

It appears that Validate(...) will fail if not using one of the 31
predefined ASN curves (even at level 0).

class CryptoMaterial defines Validate(RNG, Level) as a virtual
function. Finding which implementation is being used is problematic
(VC++ 6.0 is not honoring 'Step Into').  CryptoPP::ECIES<
CryptoPP::ECP >::PrivateKey is eventually inheriting the implemented
function.

eccrypto.cpp shows the following (which is where _I think_ the failure
is originating):

template <class EC>
bool DL_GroupParameters_EC<EC>::ValidateGroup(RandomNumberGenerator
&rng, unsigned int level) const
{
        bool pass = GetCurve().ValidateParameters(rng, level);

        Integer q = GetCurve().FieldSize();
        pass = pass && m_n!=q;

        if (level >= 2)
        {
                Integer qSqrt = q.SquareRoot();
                pass = pass && m_n>4*qSqrt;
                pass = pass && VerifyPrime(rng, m_n, level-2);
                pass = pass && (m_k.IsZero() || m_k == (q+2*qSqrt+1)/m_n);
                pass = pass && CheckMOVCondition(q, m_n);
        }

        return pass;
}

As I said, VC++ is not honoring breakpoints.

Thanks,
Jeff
Jeffrey Walton

Reply via email to