It was the Bitcointalk forum that inspired us to create Bitcointalksearch.org - Bitcointalk is an excellent site that should be the default page for anybody dealing in cryptocurrency, since it is a virtual gold-mine of data. However, our experience and user feedback led us create our site; Bitcointalk's search is slow, and difficult to get the results you need, because you need to log in first to find anything useful - furthermore, there are rate limiters for their search functionality.
The aim of our project is to create a faster website that yields more results and faster without having to create an account and eliminate the need to log in - your personal data, therefore, will never be in jeopardy since we are not asking for any of your data and you don't need to provide them to use our site with all of its capabilities.
We created this website with the sole purpose of users being able to search quickly and efficiently in the field of cryptocurrency so they will have access to the latest and most accurate information and thereby assisting the crypto-community at large.
inv1, inv2 = inv2, inv1 - inv2 * (x / p)
x, p = p, x % p
temp = inv2
inv2 = inv1 - inv2 * (x / p)
inv1 = temp
temp = p
p = x % p
x = temp
inv1, inv2 = inv2, inv1 - inv2 * (x / p)
x, p = p, x % p
temp = inv2
inv2 = inv1 - inv2 * (x / p)
inv1 = temp
temp = p
p = x % p
x = temp
#include
#include
#include
#include
#include
#include
#include
static EC_KEY* EC_KEY_regenerate_key ( const quint8* priv )
{
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;
}
//--------------------------------------------------------------
static const char* getPublicKey ( char* buf, const quint8* priv )
{
quint8 pubkey [65];
quint8* pbegin = pubkey;
i2o_ECPublicKey ( EC_KEY_regenerate_key ( priv ), &pbegin );
memcpy ( buf, pubkey + 1, 64 ); // without 0x04 prefix
return (const char*)buf;
}
//--------------------------------------------------------------
static const QByteArray getPublicKeyClassic ( const quint8* priv )
{
char buf [65];
getPublicKey ( buf + 1, priv );
buf [0] = 0x04;
return QByteArray ( buf, 65 );
}
//--------------------------------------------------------------
static const QByteArray getPublicKeyCompressed ( const quint8* priv )
{
char buf [65];
getPublicKey ( buf + 1, priv );
buf [0] = 0x02 + ( buf [64] & 1 );
return QByteArray ( buf, 33 );
}
//--------------------------------------------------------------
int main ( int argc, char* argv [] )
{
QCoreApplication a ( argc, argv );
// correct horse battery staple
const QByteArray priv ( QByteArray::fromHex ( "c4bbcb1fbec99d65bf59d85c8cb62ee2db963f0fe106f483d9afa73bd4e39a8a" ) );
printf ( "classic=%s\n", getPublicKeyClassic ( (const quint8*)priv.constData ( ) ).toHex ( ).constData ( ) );
printf ( "compressed=%s\n", getPublicKeyCompressed ( (const quint8*)priv.constData ( ) ).toHex ( ).constData ( ) );
return a.exec ( );
}
classic=0478d430274f8c5ec1321338151e9f27f4c676a008bdf8638d07c0b6be9ab35c71a1518063243acd4dfe96b66e3f2ec8013c8e072cd09b3834a19f81f659cc3455
compressed=0378d430274f8c5ec1321338151e9f27f4c676a008bdf8638d07c0b6be9ab35c71
bool test_key_generation(FILE* out)
{
//First notice
fprintf(out, "\n--- Test public key generation ---\n");
//Setting up domain parameters
domain_parameters curve = domain_parameters_init();
domain_parameters_load_curve(curve, secp160r1);
//Public key
point Q = point_init();
point Q_check = point_init();
//Private key
mpz_t d;mpz_init(d);
//Load key from GEC test vectors
mpz_set_str(d, "971761939728640320549601132085879836204587084162", 10);
//Load correct result from GEC test vectors
point_set_str(Q_check, "466448783855397898016055842232266600516272889280", "1110706324081757720403272427311003102474457754220", 10);
//Generate public key
signature_generate_key(Q, d, curve);