Skip to content

Commit

Permalink
cargo clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
mdvillagra committed Oct 24, 2023
1 parent 7b5861d commit f24fa53
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions math/src/field/fields/fft_friendly/quartic_babybear.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,29 +22,29 @@ mod tests {
use super::*;

type FE = FieldElement<Babybear31PrimeField>;
type FEE = QuadraticBabybearFieldElement;
type Fee = QuadraticBabybearFieldElement;

#[test]
fn test_add_quadratic() {
let a = FEE::new([FE::from(0), FE::from(3)]);
let b = FEE::new([-FE::from(2), FE::from(8)]);
let expected_result = FEE::new([FE::from(0) - FE::from(2), FE::from(3) + FE::from(8)]);
let a = Fee::new([FE::from(0), FE::from(3)]);
let b = Fee::new([-FE::from(2), FE::from(8)]);
let expected_result = Fee::new([FE::from(0) - FE::from(2), FE::from(3) + FE::from(8)]);
assert_eq!(a + b, expected_result);
}

#[test]
fn test_sub_quadratic() {
let a = FEE::new([FE::from(0), FE::from(3)]);
let b = FEE::new([-FE::from(2), FE::from(8)]);
let expected_result = FEE::new([FE::from(0) + FE::from(2), FE::from(3) - FE::from(8)]);
let a = Fee::new([FE::from(0), FE::from(3)]);
let b = Fee::new([-FE::from(2), FE::from(8)]);
let expected_result = Fee::new([FE::from(0) + FE::from(2), FE::from(3) - FE::from(8)]);
assert_eq!(a - b, expected_result);
}

#[test]
fn test_mul_quadratic() {
let a = FEE::new([FE::from(12), FE::from(5)]);
let b = FEE::new([-FE::from(4), FE::from(2)]);
let expected_result = FEE::new([
let a = Fee::new([FE::from(12), FE::from(5)]);
let b = Fee::new([-FE::from(4), FE::from(2)]);
let expected_result = Fee::new([
FE::from(12) * (-FE::from(4))
+ FE::from(5) * FE::from(2) * QuadraticBabybearField::residue(),
FE::from(12) * FE::from(2) + FE::from(5) * (-FE::from(4)),
Expand All @@ -54,12 +54,12 @@ mod tests {

#[test]
fn test_inv() {
let a = FEE::new([FE::from(12), FE::from(5)]);
let a = Fee::new([FE::from(12), FE::from(5)]);
let inv_norm = (FE::from(12).pow(2_u64)
- QuadraticBabybearField::residue() * FE::from(5).pow(2_u64))
.inv()
.unwrap();
let expected_result = FEE::new([FE::from(12) * &inv_norm, -&FE::from(5) * inv_norm]);
let expected_result = Fee::new([FE::from(12) * &inv_norm, -&FE::from(5) * inv_norm]);
assert_eq!(a.inv().unwrap(), expected_result);
}
}

0 comments on commit f24fa53

Please sign in to comment.