[offtopic]
Do not wonder. You can calc them yourself. About 18k are already seen in the blockchain.
Read this reddit article http://www.reddit.com/r/Bitcoin/comments/1zti1p/17956_hacked_brainwallet_passwords/
and visit http://chbs.esy.es
[/offtopic]
Answering the subject question.
Here is my code for Qt/C++/openssl (rewritten from original bitcoin-qt)
{
static EC_KEY* eckey = EC_KEY_new_by_curve_name ( NID_secp256k1 );
static const EC_GROUP* group = EC_KEY_get0_group ( eckey );
BIGNUM* privkey = BN_bin2bn ( priv, 32, BN_new ( ) );
BN_CTX* ctx = BN_CTX_new ( );
EC_POINT* pubkey = EC_POINT_new ( group );
EC_POINT_mul ( group, pubkey, privkey, 0, 0, ctx );
EC_KEY_set_private_key ( eckey, privkey );
EC_KEY_set_public_key ( eckey, pubkey );
EC_POINT_free ( pubkey );
BN_CTX_free ( ctx );
BN_clear_free ( privkey );
return eckey;
}
//--------------------------------------------------------------
const char* MyKey32::getPublicKey ( char* buf ) const
{
quint8 pubkey [65];
quint8* pbegin = pubkey;
i2o_ECPublicKey ( EC_KEY_regenerate_key ( constPtr ( ) ), &pbegin );
fassert ( pubkey [0] == 0x04 );
memcpy ( buf, pubkey + 1, 64 ); // without 0x04 prefix
return (const char*)buf;
}
//--------------------------------------------------------------
const QByteArray MyKey32::getPublicKeyClassic ( ) const
{
char buf [65];
getPublicKey ( buf + 1 );
buf [0] = 0x04;
return QByteArray ( buf, 65 );
}
//--------------------------------------------------------------
const QByteArray MyKey32::getPublicKeyCompressed ( ) const
{
char buf [65];
getPublicKey ( buf + 1 );
buf [0] = 0x02 + ( buf [64] & 1 );
return QByteArray ( buf, 33 );
}