Using compression my public keys are still one byte bigger than the
private ones. Is there anything I can do to make them smaller? I had a
look at D.J. Bernstein's page and his curve 25519 algorithm generates
32byte public and private keys using his compression. Isn't he using
256bit ECC as well? His implementation isn't an option for me since it
is totally unportable. Of course one byte isn't a big deal so I'm just
curious.

Thanks in advance
Elias


Code:
CryptoPP::AutoSeededRandomPool rng;
typedef CryptoPP::ECDH < CryptoPP::ECP >::Domain ECDHDomain;
const CryptoPP::OID CURVE = CryptoPP::ASN1::secp256r1();

ECDHDomain alice = ECDHDomain( CURVE );
alice.AccessGroupParameters().SetPointCompression(true);
string alice_privKey(alice.PrivateKeyLength(), 0);
string alice_pubKey(alice.PublicKeyLength(), 0);
alice.GenerateKeyPair (rng, (byte*)alice_privKey.data(),
(byte*)alice_pubKey.data());

Output:
Alice public key length: 33
Alice private key length: 32

-- 
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.

Reply via email to