mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-10 09:21:08 +00:00
use 486662 for A
This commit is contained in:
parent
df1aa52e08
commit
2877900233
@ -23,11 +23,6 @@ namespace crypto
|
|||||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f
|
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f
|
||||||
};
|
};
|
||||||
|
|
||||||
static const uint8_t A_[32] =
|
|
||||||
{
|
|
||||||
0x06, 0x6d, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
|
||||||
};
|
|
||||||
|
|
||||||
static const uint8_t u_[32] =
|
static const uint8_t u_[32] =
|
||||||
{
|
{
|
||||||
@ -35,17 +30,18 @@ namespace crypto
|
|||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||||
};
|
};
|
||||||
|
|
||||||
#define decode_bytes(x) { x = BN_new (); BN_bin2bn (x##_, 32, x); }
|
#define decode_bytes(x) { x = BN_new (); BN_bin2bn (x##_, 32, x); } // TODO: endianess
|
||||||
Elligator2::Elligator2 ()
|
Elligator2::Elligator2 ()
|
||||||
{
|
{
|
||||||
decode_bytes (p);
|
decode_bytes (p);
|
||||||
decode_bytes (n1);
|
decode_bytes (n1);
|
||||||
decode_bytes (n2);
|
decode_bytes (n2);
|
||||||
decode_bytes (A);
|
|
||||||
decode_bytes (u);
|
decode_bytes (u);
|
||||||
|
|
||||||
|
A = BN_new (); BN_set_word (A, 486662);
|
||||||
|
|
||||||
BN_CTX * ctx = BN_CTX_new ();
|
BN_CTX * ctx = BN_CTX_new ();
|
||||||
BN_mod_inverse (iu, u, p, ctx);
|
iu = BN_new (); BN_mod_inverse (iu, u, p, ctx);
|
||||||
BN_CTX_free (ctx);
|
BN_CTX_free (ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user