Hi Wei,

As far as I could get into the Source Code was (this is the failure)
bool pass = GetAbstractGroupParameters().Validate(rng, level); I could
Step Into GetAbstractGroupParameters(). However, I could not Step Into
Validate(). This is the second machine I tried, so I assume VC++ 6.0
is having problems with the template stuff during debugging. I wish I
could find my copy of VS 2003...

Jeff

template <class GP>
class DL_PrivateKeyImpl : public DL_PrivateKey<CPP_TYPENAME
GP::Element>, public DL_KeyImpl<PKCS8PrivateKey, GP>
{
public:

     bool Validate(RandomNumberGenerator &rng, unsigned int level) const
     {
        // FAILUERE HERE - EVEN AT LEVEL 0
        bool pass = GetAbstractGroupParameters().Validate(rng, level);
        ...
     }
...
};

On 11/16/06, Jeffrey Walton <[EMAIL PROTECTED]> wrote:
Hi All,

Below is the sample which demonstrates the failure. My one question is
in reference to cofactor S - it seems very large. If I interpreted the
document correctly, this may be an issue in the Library.

I attached Curve P192 Parameters from the NiIST document, "RECOMMENDED
ELLIPTIC CURVES FOR FEDERAL GOVERNMENT USE", July 1999.

Jeff

int main(int argc, char* argv[]) {

   try {

       CryptoPP::AutoSeededRandomPool rng;

       CryptoPP::Integer
p("6277101735386680763835789423207666416083908700390324961279");

       CryptoPP::Integer a("-3");
       CryptoPP::Integer
b("0x64210519e59c80e70fa7e9ab72243049feb8deecc146b9b1");

       CryptoPP::Integer
n("6277101735386680763835789423176059013767194773182842284081");
       CryptoPP::Integer
h("0x3045ae6fc8422f64ed579528d38120eae12196d5");

       CryptoPP::Integer
x("0x188da80eb03090f67cbf20eb43a18800f4ff0afd82ff101207192b95");
       CryptoPP::Integer
y("0x07192b95ffc8da78631011ed6b24cdd573f977a11e794811");

       CryptoPP::ECP ec( p, a, b );

       CryptoPP::ECIES< CryptoPP::ECP >::PrivateKey    PrivateKey;
       CryptoPP::ECIES< CryptoPP::ECP >::PublicKey     PublicKey;

       // Curve Initialization and Public Key Generation
       PrivateKey.Initialize( ec, CryptoPP::ECP::Point( x, y ), n, h );
       PrivateKey.MakePublicKey( PublicKey );

       // Key Validation
       if( false == PrivateKey.Validate( rng, 0 ) )
           { throw std::string( "Private Key Validation Failure" ); }
       if( false == PublicKey.Validate( rng, 0 ) )
           { throw std::string( "Public Key Validation Failure" ); }
   }

   catch( CryptoPP::Exception& e )
       { std::cerr << "Crypto++ Error: " << e.what() << std::endl; }


   return 0;
}

Reply via email to