Skip to content

Commit

Permalink
fix (#547)
Browse files Browse the repository at this point in the history
  • Loading branch information
weikengchen authored Dec 17, 2022
1 parent 768fa1d commit d5f00ca
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 2 additions & 0 deletions test-curves/src/bls12_381/fr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ use ark_ff::fields::{Fp256, MontBackend, MontConfig};
#[derive(MontConfig)]
#[modulus = "52435875175126190479447740508185965837690552500527637822603658699938581184513"]
#[generator = "7"]
#[small_subgroup_base = "3"]
#[small_subgroup_power = "1"]
pub struct FrConfig;
pub type Fr = Fp256<MontBackend<FrConfig, 4>>;

Expand Down
10 changes: 4 additions & 6 deletions test-templates/src/fields.rs
Original file line number Diff line number Diff line change
Expand Up @@ -365,17 +365,15 @@ macro_rules! __test_field {
(1 << <$field>::TWO_ADICITY) * (small_subgroup_base as u64).pow(small_subgroup_base_adicity);
assert_eq!(large_subgroup_root_of_unity.pow([pow]), <$field>::one());

for i in 0..<$field>::TWO_ADICITY {
for j in 0..small_subgroup_base_adicity {
use core::convert::TryFrom;
let size = usize::try_from(1 << i as usize).unwrap()
* usize::try_from((small_subgroup_base as u64).pow(j)).unwrap();
for i in 0..=<$field>::TWO_ADICITY {
for j in 0..=small_subgroup_base_adicity {
let size = (1u64 << i) * (small_subgroup_base as u64).pow(j);
let root = <$field>::get_root_of_unity(size as u64).unwrap();
assert_eq!(root.pow([size as u64]), <$field>::one());
}
}
} else {
for i in 0..<$field>::TWO_ADICITY {
for i in 0..=<$field>::TWO_ADICITY {
let size = 1 << i;
let root = <$field>::get_root_of_unity(size).unwrap();
assert_eq!(root.pow([size as u64]), <$field>::one());
Expand Down

0 comments on commit d5f00ca

Please sign in to comment.