crypto: fast fe_batch_invert using Montgomery's trick

https://iacr.org/archive/pkc2004/29470042/29470042.pdf 2.2

Also includes:
- fe_equals function
- breaks out fe_from_bytes_vartime function

Co-authored-by: Jeffro <jeffro256@tutanota.com>
This commit is contained in:
j-berman
2026-06-29 12:41:39 -07:00
co-authored by Jeffro
parent 286a7c9c77
commit 4f2a8a4270
6 changed files with 263 additions and 31 deletions
+3
View File
@@ -43,6 +43,7 @@
#include "derive_public_key.h"
#include "derive_secret_key.h"
#include "derive_view_tag.h"
#include "fe_batch_invert.h"
#include "ge_frombytes_vartime.h"
#include "ge_tobytes.h"
#include "generate_key_derivation.h"
@@ -198,6 +199,8 @@ int main(int argc, char** argv)
TEST_PERFORMANCE0(filter, p, test_generate_key_image);
TEST_PERFORMANCE0(filter, p, test_derive_public_key);
TEST_PERFORMANCE0(filter, p, test_derive_secret_key);
TEST_PERFORMANCE1(filter, p, test_fe_batch_invert, true); // batched
TEST_PERFORMANCE1(filter, p, test_fe_batch_invert, false); // individual inversions
TEST_PERFORMANCE0(filter, p, test_ge_frombytes_vartime);
TEST_PERFORMANCE0(filter, p, test_ge_tobytes);
TEST_PERFORMANCE0(filter, p, test_generate_keypair);