Hi xourlingkahn,
> Could anyone throw any light on this? any advice, hints, sample code
> or similar will be highly appreciated.
just simple ECDH example:
void ecdh_test ()
{
CryptoPP::AutoSeededRandomPool rng;
typedef CryptoPP::ECDH < CryptoPP::ECP >::Domain ECDHDomain;
const CryptoPP::OID CURVE = CryptoPP::ASN1::secp521r1();
//alice
ECDHDomain alice = ECDHDomain( CURVE );
byte alice_privKey[1024];
byte alice_pubKey[1024];
alice.GenerateKeyPair (rng, alice_privKey, alice_pubKey);
//bob
ECDHDomain bob = ECDHDomain( CURVE );
byte bob_privKey[1024];
byte bob_pubKey[1024];
bob.GenerateKeyPair (rng, bob_privKey, bob_pubKey);
byte bob_agreedValue[1024];
byte alice_agreedValue[1024];
// agree key material
bob.Agree (bob_agreedValue, bob_privKey, alice_pubKey);
alice.Agree (alice_agreedValue, alice_privKey, bob_pubKey);
if ( (alice.AgreedValueLength() != bob.AgreedValueLength()) ||
(memcmp (bob_agreedValue, alice_agreedValue,
alice.AgreedValueLength()) != 0) )
std::cout<<"something wrong\n";
}
Please note that I found some problems(?) with curves over 2^n field
(http://groups.google.com/group/cryptopp-users/browse_thread/thread/
93931621f7c52447)
With best regards, Andrei.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the "Crypto++ Users"
Google Group.
To unsubscribe, send an email to [EMAIL PROTECTED]
More information about Crypto++ and this group is available at
http://www.cryptopp.com.
-~----------~----~----~----~------~----~------~--~---