Skip to content

Commit

Permalink
Merge commit '63127f69b0f43a828b5f35d466085debe1e11e8c' into axiom/fa…
Browse files Browse the repository at this point in the history
…ster-witness-generation
  • Loading branch information
jonathanpwang committed Dec 22, 2022
1 parent 9c7b343 commit 7079eeb
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/bn256/assembly.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ macro_rules! assembly_field {

impl $crate::serde::SerdeObject for $field {
fn from_raw_bytes_unchecked(bytes: &[u8]) -> Self {
assert_eq!(bytes.len(), 32);
debug_assert_eq!(bytes.len(), 32);
let inner =
[0, 8, 16, 24].map(|i| u64::from_le_bytes(bytes[i..i + 8].try_into().unwrap()));
Self(inner)
Expand Down
2 changes: 1 addition & 1 deletion src/bn256/fq2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ impl ff::PrimeField for Fq2 {

impl crate::serde::SerdeObject for Fq2 {
fn from_raw_bytes_unchecked(bytes: &[u8]) -> Self {
assert_eq!(bytes.len(), 64);
debug_assert_eq!(bytes.len(), 64);
let [c0, c1] = [0, 32].map(|i| Fq::from_raw_bytes_unchecked(&bytes[i..i + 32]));
Self { c0, c1 }
}
Expand Down
2 changes: 1 addition & 1 deletion src/bn256/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub use fq2::*;
pub use fq6::*;
pub use fr::*;

#[derive(Debug, PartialEq)]
#[derive(Debug, PartialEq, Eq)]
pub enum LegendreSymbol {
Zero = 0,
QuadraticResidue = 1,
Expand Down
6 changes: 3 additions & 3 deletions src/derive/curve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ macro_rules! new_curve_impl {

impl $crate::serde::SerdeObject for $name {
fn from_raw_bytes_unchecked(bytes: &[u8]) -> Self {
assert_eq!(bytes.len(), 3 * $base::size());
debug_assert_eq!(bytes.len(), 3 * $base::size());
let [x, y, z] = [0, 1, 2]
.map(|i| $base::from_raw_bytes_unchecked(&bytes[i * $base::size()..(i + 1) * $base::size()]));
Self { x, y, z }
Expand Down Expand Up @@ -646,9 +646,9 @@ macro_rules! new_curve_impl {
}
}

impl crate::serde::SerdeObject for $name_affine {
impl $crate::serde::SerdeObject for $name_affine {
fn from_raw_bytes_unchecked(bytes: &[u8]) -> Self {
assert_eq!(bytes.len(), 2 * $base::size());
debug_assert_eq!(bytes.len(), 2 * $base::size());
let [x, y] =
[0, $base::size()].map(|i| $base::from_raw_bytes_unchecked(&bytes[i..i + $base::size()]));
Self { x, y }
Expand Down
2 changes: 1 addition & 1 deletion src/derive/field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ macro_rules! field_common {

impl $crate::serde::SerdeObject for $field {
fn from_raw_bytes_unchecked(bytes: &[u8]) -> Self {
assert_eq!(bytes.len(), 32);
debug_assert_eq!(bytes.len(), 32);
let inner =
[0, 8, 16, 24].map(|i| u64::from_le_bytes(bytes[i..i + 8].try_into().unwrap()));
Self(inner)
Expand Down

0 comments on commit 7079eeb

Please sign in to comment.