Skip to content

Commit

Permalink
feat(math): introduce bn384_small_two_adicity Fr
Browse files Browse the repository at this point in the history
To test `GeneralEvaluationDomain`, bn384_small_two_adicity Fr is added.
  • Loading branch information
fakedev9999 committed Oct 3, 2023
1 parent fbe8a73 commit a3c79a6
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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,
)

0 comments on commit a3c79a6

Please sign in to comment.