From a3c79a6d401824beb98069e529cccd397ec23097 Mon Sep 17 00:00:00 2001 From: TomTaehoonKim Date: Tue, 3 Oct 2023 22:31:50 +0900 Subject: [PATCH] feat(math): introduce bn384_small_two_adicity Fr To test `GeneralEvaluationDomain`, bn384_small_two_adicity Fr is added. --- .../bn/bn384_small_two_adicity/BUILD.bazel | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tachyon/math/elliptic_curves/bn/bn384_small_two_adicity/BUILD.bazel b/tachyon/math/elliptic_curves/bn/bn384_small_two_adicity/BUILD.bazel index 92b0e7625c..f40e7e9acf 100644 --- a/tachyon/math/elliptic_curves/bn/bn384_small_two_adicity/BUILD.bazel +++ b/tachyon/math/elliptic_curves/bn/bn384_small_two_adicity/BUILD.bazel @@ -11,6 +11,15 @@ FQ_SMALL_SUBGROUP_BASE = "3" FQ_SMALL_SUBGROUP_ADICITY = "2" +# Parameters are from https://github.com/arkworks-rs/algebra/blob/master/test-curves/src/bn384_small_two_adicity/fr.rs +FR_MODULUS = "5945877603251831796258517492029536515488649313567122628445038208291596545947608789992834434053176523624102324539393" + +FR_SUBGROUP_GENERATOR = "5" + +FR_SMALL_SUBGROUP_BASE = "3" + +FR_SMALL_SUBGROUP_ADICITY = "2" + generate_prime_fields( name = "fq", class_name = "Fq", @@ -20,3 +29,13 @@ generate_prime_fields( small_subgroup_base = FQ_SMALL_SUBGROUP_BASE, subgroup_generator = FQ_SUBGROUP_GENERATOR, ) + +generate_prime_fields( + name = "fr", + class_name = "Fr", + modulus = FR_MODULUS, + namespace = "tachyon::math::bn384_small_two_adicity", + small_subgroup_adicity = FR_SMALL_SUBGROUP_ADICITY, + small_subgroup_base = FR_SMALL_SUBGROUP_BASE, + subgroup_generator = FR_SUBGROUP_GENERATOR, +)