I'd just like to note for the archives that the code I submitted is slightly wrong. As written it throws an exception; the correct version uses the sect, not secp, groups. See http://www.secg.org/collateral/sec2_final.pdf for more details. ASN1::sect233k1() is the group I have switched to.
Thank you for your confirmation on the syntax, Wei. ----- Original Message ----- From: "Wei Dai" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, July 07, 2003 3:39 PM Subject: Re: ECDSA Key Generation question > Yeah, this is fine. > > On Mon, Jul 07, 2003 at 01:46:27PM -0400, Guy Smith wrote: > > Hello. I'm using ECDSA for an authentication problem, but I'm unfamiliar with Elliptic Curves. The following code will compile (Crypto++ 5.1) and is supposed to generate a random keypair for ECDSA. My question is, is this code correct (that is, secure)? A monosyllabic answer will suffice in the positive case; for the negative case an explanation would be appreciated. Thanks. > > > > CryptoPP::AutoSeededRandomPool random_pool; > > > > // Create a random private key > > CryptoPP::ECDSA<CryptoPP::EC2N, CryptoPP::SHA>::PrivateKey privkey; > > privkey.Initialize(random_pool, CryptoPP::ASN1::secp224k1()); > > > > // Get the public key version > > CryptoPP::ECDSA<CryptoPP::EC2N, CryptoPP::SHA>::PublicKey pubkey; > > privkey.MakePublicKey(pubkey); > > > > > > Guy L. Smith > > [EMAIL PROTECTED] > > [EMAIL PROTECTED] > > > > I feel like I'm debugging a zen koan. >
