diff --git a/src/bls12_381/fp.rs b/src/bls12_381/fp.rs index 12f0104d..de9ff766 100644 --- a/src/bls12_381/fp.rs +++ b/src/bls12_381/fp.rs @@ -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)] diff --git a/src/bls12_381/fp2.rs b/src/bls12_381/fp2.rs index a8eaa4b1..787249df 100644 --- a/src/bls12_381/fp2.rs +++ b/src/bls12_381/fp2.rs @@ -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)] @@ -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) } diff --git a/src/bls12_381/g1.rs b/src/bls12_381/g1.rs index cb8bdd20..5c23c439 100644 --- a/src/bls12_381/g1.rs +++ b/src/bls12_381/g1.rs @@ -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; @@ -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). diff --git a/src/bls12_381/g2.rs b/src/bls12_381/g2.rs index 2857317e..dd6b3551 100644 --- a/src/bls12_381/g2.rs +++ b/src/bls12_381/g2.rs @@ -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; @@ -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 { diff --git a/src/bls12_381/hash_to_curve/chain.rs b/src/bls12_381/hash_to_curve/chain.rs index 83eead8e..b75c85c5 100644 --- a/src/bls12_381/hash_to_curve/chain.rs +++ b/src/bls12_381/hash_to_curve/chain.rs @@ -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; diff --git a/src/bls12_381/hash_to_curve/expand_msg.rs b/src/bls12_381/hash_to_curve/expand_msg.rs index e273a630..2dc11ba0 100644 --- a/src/bls12_381/hash_to_curve/expand_msg.rs +++ b/src/bls12_381/hash_to_curve/expand_msg.rs @@ -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::{ diff --git a/src/bls12_381/hash_to_curve/map_g1.rs b/src/bls12_381/hash_to_curve/map_g1.rs index 868a3237..270f398e 100644 --- a/src/bls12_381/hash_to_curve/map_g1.rs +++ b/src/bls12_381/hash_to_curve/map_g1.rs @@ -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}; diff --git a/src/bls12_381/hash_to_curve/map_g2.rs b/src/bls12_381/hash_to_curve/map_g2.rs index eea59b35..110c1155 100644 --- a/src/bls12_381/hash_to_curve/map_g2.rs +++ b/src/bls12_381/hash_to_curve/map_g2.rs @@ -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}; diff --git a/src/bls12_381/hash_to_curve/map_scalar.rs b/src/bls12_381/hash_to_curve/map_scalar.rs index dc28e707..8c839aaa 100644 --- a/src/bls12_381/hash_to_curve/map_scalar.rs +++ b/src/bls12_381/hash_to_curve/map_scalar.rs @@ -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; diff --git a/src/bls12_381/hash_to_curve/mod.rs b/src/bls12_381/hash_to_curve/mod.rs index d1cdf9ce..91db16ca 100644 --- a/src/bls12_381/hash_to_curve/mod.rs +++ b/src/bls12_381/hash_to_curve/mod.rs @@ -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; diff --git a/src/bls12_381/mod.rs b/src/bls12_381/mod.rs index dead707d..ce9d5a7f 100644 --- a/src/bls12_381/mod.rs +++ b/src/bls12_381/mod.rs @@ -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. diff --git a/src/bls12_381/scalar.rs b/src/bls12_381/scalar.rs index a0add505..4269d0c0 100644 --- a/src/bls12_381/scalar.rs +++ b/src/bls12_381/scalar.rs @@ -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)]