Skip to content

Commit

Permalink
fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
nulltea committed Jan 24, 2024
1 parent b4eaad2 commit a991c06
Show file tree
Hide file tree
Showing 12 changed files with 10 additions and 19 deletions.
1 change: 0 additions & 1 deletion src/bls12_381/fp.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//! This module provides an implementation of the BLS12-381 base field `GF(p)`
//! where `p = 0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab`
//!
//! Source: https://github.com/privacy-scaling-explorations/bls12_381

#![allow(clippy::needless_borrow)]
Expand Down
3 changes: 0 additions & 3 deletions src/bls12_381/fp2.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//! This module implements arithmetic over the quadratic extension field Fp2.
//!
//! Source: https://github.com/privacy-scaling-explorations/bls12_381

#![allow(clippy::needless_borrow)]
Expand Down Expand Up @@ -1271,7 +1270,5 @@ fn test_zeroize() {

#[test]
fn test_root_of_unity_inv() {
let two_inv = Fp::ZETA.square();
println!("two_inv = {:x?}", two_inv.0);
assert_eq!(Fp2::ROOT_OF_UNITY * Fp2::ROOT_OF_UNITY_INV, Fp2::ONE)
}
4 changes: 2 additions & 2 deletions src/bls12_381/g1.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//! This module provides an implementation of the $\mathbb{G}_1$ group of BLS12-381.
//!
//! Source: https://github.com/privacy-scaling-explorations/bls12_381

use core::borrow::Borrow;
Expand Down Expand Up @@ -528,7 +527,8 @@ impl G1Affine {
// We already know the point is on the curve because this is established
// by the y-coordinate recovery procedure in from_compressed_unchecked().

Self::from_compressed_unchecked_le(bytes).and_then(|p| CtOption::new(p, p.is_torsion_free()))
Self::from_compressed_unchecked_le(bytes)
.and_then(|p| CtOption::new(p, p.is_torsion_free()))
}

/// Returns true if this element is the identity (the point at infinity).
Expand Down
5 changes: 2 additions & 3 deletions src/bls12_381/g2.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//! This module provides an implementation of the $\mathbb{G}_2$ group of BLS12-381.
//!
//! Source: https://github.com/privacy-scaling-explorations/bls12_381

use core::borrow::Borrow;
Expand Down Expand Up @@ -622,10 +621,10 @@ impl G2Affine {
// We already know the point is on the curve because this is established
// by the y-coordinate recovery procedure in from_compressed_unchecked().

Self::from_compressed_unchecked_le(bytes).and_then(|p| CtOption::new(p, p.is_torsion_free()))
Self::from_compressed_unchecked_le(bytes)
.and_then(|p| CtOption::new(p, p.is_torsion_free()))
}


/// Returns true if this element is the identity (the point at infinity).
#[inline]
pub fn is_identity(&self) -> Choice {
Expand Down
2 changes: 1 addition & 1 deletion src/bls12_381/hash_to_curve/chain.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Addition chains for computing square roots.
//! chain_pm3div4: input x, output x^((p-3)//4).
//! chain_p2m9div16: input x, output x^((p**2 - 9) // 16).
//!
//!
//! Source: https://github.com/privacy-scaling-explorations/bls12_381

use core::ops::MulAssign;
Expand Down
2 changes: 1 addition & 1 deletion src/bls12_381/hash_to_curve/expand_msg.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! This module implements message expansion consistent with the
//! hash-to-curve RFC drafts 7 through 10
//!
//!
//! Source: https://github.com/privacy-scaling-explorations/bls12_381

use core::{
Expand Down
2 changes: 1 addition & 1 deletion src/bls12_381/hash_to_curve/map_g1.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! Implementation of hash-to-curve for the G1 group.
//!
//!
//! Source: https://github.com/privacy-scaling-explorations/bls12_381

use subtle::{Choice, ConditionallyNegatable, ConditionallySelectable, ConstantTimeEq};
Expand Down
2 changes: 1 addition & 1 deletion src/bls12_381/hash_to_curve/map_g2.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! Implementation of hash-to-curve for the G2 group
//!
//!
//! Source: https://github.com/privacy-scaling-explorations/bls12_381

use subtle::{Choice, ConditionallyNegatable, ConditionallySelectable, ConstantTimeEq};
Expand Down
3 changes: 1 addition & 2 deletions src/bls12_381/hash_to_curve/map_scalar.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
//! Implementation of hash-to-field for Scalar values
//!
//!
//! Source: https://github.com/privacy-scaling-explorations/bls12_381


use super::HashToField;
use crate::bls12_381::generic_array::{typenum::U48, GenericArray};
use crate::bls12_381::scalar::Scalar;
Expand Down
3 changes: 1 addition & 2 deletions src/bls12_381/hash_to_curve/mod.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
//! This module implements hash_to_curve, hash_to_field and related
//! hashing primitives for use with BLS signatures.
//!
//!
//! Source: https://github.com/privacy-scaling-explorations/bls12_381


use core::ops::Add;

use subtle::Choice;
Expand Down
1 change: 0 additions & 1 deletion src/bls12_381/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//! * This implementation targets Rust `1.36` or later.
//! * This implementation does not require the Rust standard library.
//! * All operations are constant time unless explicitly noted.
//!
//! Source: https://github.com/privacy-scaling-explorations/bls12_381

// Catch documentation errors caused by code changes.
Expand Down
1 change: 0 additions & 1 deletion src/bls12_381/scalar.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//! This module provides an implementation of the BLS12-381 scalar field $\mathbb{F}_q$
//! where `q = 0x73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001`
//!
//! Source: https://github.com/privacy-scaling-explorations/bls12_381

#![allow(clippy::needless_borrow)]
Expand Down

0 comments on commit a991c06

Please sign in to comment.