Auto merge of #41 - str4d:23-debug-trait, r=ebfull
Force public structures to implement Debug Closes #23.
This commit is contained in:
commit
9b6fb37533
@ -584,6 +584,7 @@ macro_rules! curve_impl {
|
||||
|
||||
pub mod g1 {
|
||||
use rand::{Rand, Rng};
|
||||
use std::fmt;
|
||||
use super::g2::G2Affine;
|
||||
use super::super::{Bls12, Fq, Fr, FrRepr, FqRepr, Fq12};
|
||||
use ::{CurveProjective, CurveAffine, PrimeField, SqrtField, PrimeFieldRepr, Field, BitIterator, EncodedPoint, GroupDecodingError, Engine};
|
||||
@ -611,6 +612,12 @@ pub mod g1 {
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for G1Uncompressed {
|
||||
fn fmt(&self, formatter: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
||||
self.0[..].fmt(formatter)
|
||||
}
|
||||
}
|
||||
|
||||
impl EncodedPoint for G1Uncompressed {
|
||||
type Affine = G1Affine;
|
||||
|
||||
@ -713,6 +720,12 @@ pub mod g1 {
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for G1Compressed {
|
||||
fn fmt(&self, formatter: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
||||
self.0[..].fmt(formatter)
|
||||
}
|
||||
}
|
||||
|
||||
impl EncodedPoint for G1Compressed {
|
||||
type Affine = G1Affine;
|
||||
|
||||
@ -879,7 +892,7 @@ pub mod g1 {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct G1Prepared(pub(crate) G1Affine);
|
||||
|
||||
impl G1Prepared {
|
||||
@ -1137,6 +1150,7 @@ pub mod g1 {
|
||||
|
||||
pub mod g2 {
|
||||
use rand::{Rand, Rng};
|
||||
use std::fmt;
|
||||
use super::super::{Bls12, Fq2, Fr, Fq, FrRepr, FqRepr, Fq12};
|
||||
use super::g1::G1Affine;
|
||||
use ::{CurveProjective, CurveAffine, PrimeField, SqrtField, PrimeFieldRepr, Field, BitIterator, EncodedPoint, GroupDecodingError, Engine};
|
||||
@ -1164,6 +1178,12 @@ pub mod g2 {
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for G2Uncompressed {
|
||||
fn fmt(&self, formatter: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
||||
self.0[..].fmt(formatter)
|
||||
}
|
||||
}
|
||||
|
||||
impl EncodedPoint for G2Uncompressed {
|
||||
type Affine = G2Affine;
|
||||
|
||||
@ -1278,6 +1298,12 @@ pub mod g2 {
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for G2Compressed {
|
||||
fn fmt(&self, formatter: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
||||
self.0[..].fmt(formatter)
|
||||
}
|
||||
}
|
||||
|
||||
impl EncodedPoint for G2Compressed {
|
||||
type Affine = G2Affine;
|
||||
|
||||
@ -1459,7 +1485,7 @@ pub mod g2 {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct G2Prepared {
|
||||
pub(crate) coeffs: Vec<(Fq2, Fq2, Fq2)>,
|
||||
pub(crate) infinity: bool
|
||||
|
@ -21,6 +21,7 @@ use super::{Engine, CurveAffine, Field, BitIterator};
|
||||
const BLS_X: u64 = 0xd201000000010000;
|
||||
const BLS_X_IS_NEGATIVE: bool = true;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Bls12;
|
||||
|
||||
impl Engine for Bls12 {
|
||||
|
@ -13,6 +13,9 @@
|
||||
#![cfg_attr(feature = "clippy", allow(too_many_arguments))]
|
||||
#![cfg_attr(feature = "clippy", allow(unreadable_literal))]
|
||||
|
||||
// Force public structures to implement Debug
|
||||
#![deny(missing_debug_implementations)]
|
||||
|
||||
// The compiler provides `test` (on nightly) for benchmarking tools, but
|
||||
// it's hidden behind a feature flag. Enable it if we're testing.
|
||||
#![cfg_attr(test, feature(test))]
|
||||
@ -563,6 +566,7 @@ pub trait PrimeField: Field
|
||||
fn root_of_unity() -> Self;
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct BitIterator<E> {
|
||||
t: E,
|
||||
n: usize
|
||||
|
Loading…
Reference in New Issue
Block a user