From 28779002335b9758ef9a3bf23706f1b96c65f32d Mon Sep 17 00:00:00 2001 From: orignal Date: Thu, 5 Dec 2019 16:13:59 -0500 Subject: [PATCH] use 486662 for A --- libi2pd/Elligator.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/libi2pd/Elligator.cpp b/libi2pd/Elligator.cpp index cc38672a..213345b9 100644 --- a/libi2pd/Elligator.cpp +++ b/libi2pd/Elligator.cpp @@ -23,11 +23,6 @@ namespace crypto 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] = { @@ -35,17 +30,18 @@ namespace crypto 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 () { decode_bytes (p); decode_bytes (n1); - decode_bytes (n2); - decode_bytes (A); + decode_bytes (n2); decode_bytes (u); + A = BN_new (); BN_set_word (A, 486662); + 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); }