Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jotabulacios committed Jan 8, 2025
1 parent 86f1a72 commit 89012ca
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions math/src/field/fields/fft_friendly/quartic_babybear_u32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ impl IsFFTField for Degree4BabyBearU32ExtensionField {
#[cfg(test)]
mod tests {
use super::*;
use crate::{field::element::FieldElement, traits::ByteConversion};
use crate::field::element::FieldElement;

type FpE = FieldElement<Babybear31PrimeField>;
type Fp4E = FieldElement<Degree4BabyBearU32ExtensionField>;
Expand Down Expand Up @@ -461,28 +461,28 @@ mod tests {
}

#[test]
#[cfg(feature = "alloc")]
#[cfg(all(feature = "alloc", feature = "lambdaworks-serde-binary"))]
fn to_bytes_from_bytes_be_is_the_identity() {
let x = Fp4E::new([FpE::from(2), FpE::from(4), FpE::from(6), FpE::from(8)]);
assert_eq!(Fp4E::from_bytes_be(&x.to_bytes_be()).unwrap(), x);
}

#[test]
#[cfg(feature = "alloc")]
#[cfg(all(feature = "alloc", feature = "lambdaworks-serde-binary"))]
fn from_bytes_to_bytes_be_is_the_identity() {
let bytes = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];
assert_eq!(Fp4E::from_bytes_be(&bytes).unwrap().to_bytes_be(), bytes);
}

#[test]
#[cfg(feature = "alloc")]
#[cfg(all(feature = "alloc", feature = "lambdaworks-serde-binary"))]
fn to_bytes_from_bytes_le_is_the_identity() {
let x = Fp4E::new([FpE::from(2), FpE::from(4), FpE::from(6), FpE::from(8)]);
assert_eq!(Fp4E::from_bytes_le(&x.to_bytes_le()).unwrap(), x);
}

#[test]
#[cfg(feature = "alloc")]
#[cfg(all(feature = "alloc", feature = "lambdaworks-serde-binary"))]
fn from_bytes_to_bytes_le_is_the_identity() {
let bytes = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];
assert_eq!(Fp4E::from_bytes_le(&bytes).unwrap().to_bytes_le(), bytes);
Expand Down

0 comments on commit 89012ca

Please sign in to comment.