Skip to content

Commit 62e3a77

Browse files
authored
Fix broken docs (#185)
* chore: fmt * fix: docs * chore: clippy
1 parent aa50568 commit 62e3a77

File tree

8 files changed

+19
-20
lines changed

8 files changed

+19
-20
lines changed

benches/curve.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,10 @@
88
use criterion::{black_box, criterion_group, criterion_main, Criterion, Throughput};
99
use ff::Field;
1010
use group::prime::PrimeCurveAffine;
11-
use halo2curves::bn256::G1;
11+
use halo2curves::{bn256::G1, CurveExt};
1212
use rand::SeedableRng;
1313
use rand_xorshift::XorShiftRng;
1414

15-
use halo2curves::CurveExt;
16-
1715
fn bench_curve_ops<G: CurveExt>(c: &mut Criterion, name: &'static str) {
1816
{
1917
let mut rng = XorShiftRng::seed_from_u64(3141519u64);

benches/hash_to_curve.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
use std::iter;
99

1010
use criterion::{black_box, criterion_group, criterion_main, Criterion, Throughput};
11-
use halo2curves::bn256::G1;
12-
use halo2curves::CurveExt;
11+
use halo2curves::{bn256::G1, CurveExt};
1312
use rand::SeedableRng;
1413
use rand_core::RngCore;
1514
use rand_xorshift::XorShiftRng;

src/bn256/fq12.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ use crate::ff_ext::{
44
ExtField,
55
};
66

7-
/// -GAMMA is a quadratic non-residue in Fp6. Fp12 = Fp6[X]/(X^2 + GAMMA)
8-
/// We introduce the variable w such that w^2 = -GAMMA
9-
// GAMMA = - v
7+
// -GAMMA is a quadratic non-residue in Fp6. Fp12 = Fp6[X] / (X^2 + GAMMA)
8+
// We introduce the variable w such that w^2 = -GAMMA
9+
// GAMMA = -v
1010
/// An element of Fq12, represented by c0 + c1 * w.
1111
pub type Fq12 = QuadExtField<Fq6>;
1212

src/curve.rs

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ pub trait CurveExt:
4242
/// distributed elements in the group, given domain prefix `domain_prefix`.
4343
///
4444
/// This method is suitable for use as a random oracle.
45+
#[allow(clippy::type_complexity)]
4546
fn hash_to_curve<'a>(domain_prefix: &'a str) -> Box<dyn Fn(&[u8]) -> Self + 'a>;
4647

4748
/// Returns whether or not this element is on the curve; should

src/ff_ext/inverse.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,9 @@ impl<const B: usize, const L: usize> Mul<CInt<B, L>> for i64 {
244244
/// recommended:
245245
/// - D. Bernstein, B.-Y. Yang, "Fast constant-time gcd computation and modular
246246
/// inversion",
247-
/// https://gcd.cr.yp.to/safegcd-20190413.pdf
247+
/// <https://gcd.cr.yp.to/safegcd-20190413.pdf>
248248
/// - P. Wuille, "The safegcd implementation in libsecp256k1 explained",
249-
/// https://github.com/bitcoin-core/secp256k1/blob/master/doc/safegcd_implementation.md
249+
/// <https://github.com/bitcoin-core/secp256k1/blob/master/doc/safegcd_implementation.md>
250250
pub struct BYInverter<const L: usize> {
251251
/// Modulus
252252
modulus: CInt<62, L>,
@@ -395,7 +395,7 @@ impl<const L: usize> BYInverter<L> {
395395
/// multiplicative inverse modulo a power of two. For better
396396
/// understanding the implementation, the following paper is recommended:
397397
/// J. Hurchalla, "An Improved Integer Multiplicative Inverse (modulo 2^w)",
398-
/// https://arxiv.org/pdf/2204.04342.pdf
398+
/// <https://arxiv.org/pdf/2204.04342.pdf>
399399
const fn inv(value: u64) -> i64 {
400400
let x = value.wrapping_mul(3) ^ 2;
401401
let y = 1u64.wrapping_sub(x.wrapping_mul(value));

src/ff_ext/jacobi.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ impl<const L: usize> LInt<L> {
4444
#[inline]
4545
fn sum(first: u64, second: u64, carry: bool) -> (u64, bool) {
4646
// The implementation is inspired with the "carrying_add" function from this
47-
// source: https://github.com/rust-lang/rust/blob/master/library/core/src/num/uint_macros.rs
47+
// source: <https://github.com/rust-lang/rust/blob/master/library/core/src/num/uint_macros.rs>
4848
let (second, carry) = second.overflowing_add(carry as u64);
4949
let (first, high) = first.overflowing_add(second);
5050
(first, carry || high)
@@ -330,9 +330,9 @@ fn jacobinary(mut n: u64, mut d: u64, mut t: u64) -> i64 {
330330
/// differences have been commented; the aforesaid Pornin's method and the used
331331
/// ideas of M. Hamburg were given here:
332332
/// - T. Pornin, "Optimized Binary GCD for Modular Inversion",
333-
/// https://eprint.iacr.org/2020/972.pdf
333+
/// <https://eprint.iacr.org/2020/972.pdf>
334334
/// - M. Hamburg, "Computing the Jacobi symbol using Bernstein-Yang",
335-
/// https://eprint.iacr.org/2021/1271.pdf
335+
/// <https://eprint.iacr.org/2021/1271.pdf>
336336
pub fn jacobi<const L: usize>(n: &[u64], d: &[u64]) -> i64 {
337337
// Instead of the variable "j" taking the values from {-1, 1} and satisfying
338338
// at the end of the outer loop iteration the equation J = "j" * ("n" / |"d"|)

src/pluto_eris/fp12.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ use crate::ff_ext::{
66
ExtField,
77
};
88

9-
/// -GAMMA is a quadratic non-residue in Fp6. Fp12 = Fp6[X]/(X^2 + GAMMA)
10-
/// We introduce the variable w such that w^2 = -GAMMA
11-
/// GAMMA = - v
9+
// -GAMMA is a quadratic non-residue in Fp6. Fp12 = Fp6[X]/(X^2 + GAMMA)
10+
// We introduce the variable w such that w^2 = -GAMMA
11+
// GAMMA = - v
12+
/// An element of Fp12, represented by c0 + c1 * v.
1213
pub type Fp12 = QuadExtField<Fp6>;
1314

1415
impl QuadExtFieldArith for Fp12 {

src/pluto_eris/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
//! Implementation of the Pluto / Eris half-pairing cycle of prime order
44
//! elliptic curves.
55
//!
6-
//! Supporting evidence: https://github.com/daira/pluto-eris
7-
//! Field constant derivation: https://github.com/davidnevadoc/ec-constants/tree/main/pluto_eris
8-
//! Pairing constants derivation: https://github.com/John-Gong-Math/pluto_eris/blob/main/pluto_pairing.ipynb
6+
//! Supporting evidence: <https://github.com/daira/pluto-eris>
7+
//! Field constant derivation: <https://github.com/davidnevadoc/ec-constants/tree/main/pluto_eris>
8+
//! Pairing constants derivation: <https://github.com/John-Gong-Math/pluto_eris/blob/main/pluto_pairing.ipynb>
99
mod curve;
1010
mod engine;
1111
mod fp;

0 commit comments

Comments
 (0)