mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-02-13 00:07:39 +01:00
short exponent for non-x64
This commit is contained in:
parent
1c507a47d2
commit
405aa906c5
1 changed files with 5 additions and 2 deletions
|
@ -200,8 +200,11 @@ namespace crypto
|
||||||
ctx = BN_CTX_new ();
|
ctx = BN_CTX_new ();
|
||||||
// select random k
|
// select random k
|
||||||
BIGNUM * k = BN_new ();
|
BIGNUM * k = BN_new ();
|
||||||
BN_rand_range (k, elgp);
|
#if defined(__x86_64__)
|
||||||
if (BN_is_zero (k)) BN_one (k);
|
BN_rand (k, 2048, -1, 1); // full exponent for x64
|
||||||
|
#else
|
||||||
|
BN_rand (k, 226, -1, 1); // short exponent of 226 bits
|
||||||
|
#endif
|
||||||
// caulculate a
|
// caulculate a
|
||||||
a = BN_new ();
|
a = BN_new ();
|
||||||
BN_mod_exp (a, elgg, k, elgp, ctx);
|
BN_mod_exp (a, elgg, k, elgp, ctx);
|
||||||
|
|
Loading…
Add table
Reference in a new issue