Skip to content

Commit

Permalink
Cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
volhovm committed Oct 29, 2024
1 parent 9721695 commit a771be1
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 19 deletions.
Empty file.
4 changes: 2 additions & 2 deletions utils/src/foreign_field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use std::{
ops::{Index, IndexMut},
};


/// Represents a foreign field element
#[derive(Clone, PartialEq, Eq)]
/// Represents a foreign field element
Expand Down Expand Up @@ -191,7 +190,8 @@ impl<F: Field, const B: usize, const N: usize> ForeignFieldHelpers<F, B>
F::from(2u64).pow([2 * B as u64])
}

fn two_to_3limb() -> F { // Self?
fn two_to_3limb() -> F {
// Self?
F::from(2u64).pow([3 * B as u64])
}
}
2 changes: 1 addition & 1 deletion utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub use chunked_evaluations::ChunkedEvaluations;
pub use dense_polynomial::ExtendedDensePolynomial;
pub use evaluations::ExtendedEvaluations;
pub use field_helpers::{BigUintFieldHelpers, FieldHelpers, RandomField, Two};
pub use foreign_field::{ForeignElement};
pub use foreign_field::ForeignElement;

/// Utils only for testing
pub mod tests {
Expand Down
1 change: 0 additions & 1 deletion utils/src/serialization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ where
}
}


/// A generic regression serialization test for serialization via
/// `CanonicalSerialize` and `CanonicalDeserialize`.
pub fn test_generic_serialization_regression_canonical<
Expand Down
29 changes: 14 additions & 15 deletions utils/tests/serialization.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
use o1_utils::serialization::{
test_generic_serialization_regression_canonical,
test_generic_serialization_regression_serde,
};
use ark_ec::short_weierstrass::SWCurveConfig;
use mina_curves::pasta::{Pallas, PallasParameters, Vesta, VestaParameters};
use o1_utils::serialization::{
test_generic_serialization_regression_canonical, test_generic_serialization_regression_serde,
};
use serde::{Deserialize, Serialize};
use serde_with::serde_as;

Expand All @@ -16,31 +15,31 @@ pub fn ser_regression_canonical_bigint() {
(
Fp::from(5u64),
vec![
5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0,
],
),
(
Fp::from((1u64 << 62) + 7u64),
vec![
7, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
7, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
],
),
(
Fp::from((1u64 << 30) * 13u64 * 7u64 * 5u64 * 3u64 + 7u64),
vec![
7, 0, 0, 64, 85, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
7, 0, 0, 64, 85, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
],
),
(
Fp::from((1u64 << 63) + 7u64)
* Fp::from((1u64 << 63) + 13u64)
* Fp::from((1u64 << 63) + 17u64),
vec![
11, 6, 0, 0, 0, 0, 0, 128, 215, 0, 0, 0, 0, 0, 0, 64, 9, 0, 0, 0, 0, 0, 0, 32,
0, 0, 0, 0, 0, 0, 0, 0,
11, 6, 0, 0, 0, 0, 0, 128, 215, 0, 0, 0, 0, 0, 0, 64, 9, 0, 0, 0, 0, 0, 0, 32, 0,
0, 0, 0, 0, 0, 0, 0,
],
),
];
Expand Down Expand Up @@ -68,9 +67,9 @@ pub fn ser_regression_canonical_pasta() {

// Generated with commit 1494cf973d40fb276465929eb7db1952c5de7bdc
let buf_expected: Vec<u8> = vec![
146, 196, 33, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 196, 33, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
146, 196, 33, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 196, 33, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
];

test_generic_serialization_regression_serde(data_expected, buf_expected);
Expand Down

0 comments on commit a771be1

Please sign in to comment.