mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-27 11:17:49 +02:00
ECICS gerenarate keys
This commit is contained in:
parent
5271cdacf2
commit
00bbb81375
2 changed files with 14 additions and 0 deletions
|
@ -460,6 +460,19 @@ namespace crypto
|
|||
return ret;
|
||||
}
|
||||
|
||||
void GenerateECICSKeyPair (const EC_GROUP * curve, BIGNUM *& priv, EC_POINT *& pub)
|
||||
{
|
||||
BN_CTX * ctx = BN_CTX_new ();
|
||||
BIGNUM * q = BN_new ();
|
||||
EC_GROUP_get_order(curve, q, ctx);
|
||||
priv = BN_new ();
|
||||
BN_rand_range (priv, q);
|
||||
pub = EC_POINT_new (curve);
|
||||
EC_POINT_mul (curve, pub, priv, nullptr, nullptr, ctx);
|
||||
BN_free (q);
|
||||
BN_CTX_free (ctx);
|
||||
}
|
||||
|
||||
// HMAC
|
||||
const uint64_t IPAD = 0x3636363636363636;
|
||||
const uint64_t OPAD = 0x5C5C5C5C5C5C5C5C;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue