Apply newer rustfmt rules.
This commit is contained in:
parent
fcaddaa356
commit
2d12b9a858
@ -2135,8 +2135,7 @@ fn test_fq_repr_sub_noborrow() {
|
||||
0x7c0577a26f59d5,
|
||||
]));
|
||||
assert!(
|
||||
t
|
||||
== FqRepr([
|
||||
t == FqRepr([
|
||||
0x40a12b8967c54bae,
|
||||
0xdeae37a0837d0d7b,
|
||||
0xe592c487bae374e,
|
||||
@ -2223,8 +2222,7 @@ fn test_fq_repr_add_nocarry() {
|
||||
0x7c0577a26f59d5,
|
||||
]));
|
||||
assert!(
|
||||
t
|
||||
== FqRepr([
|
||||
t == FqRepr([
|
||||
0xcfae1db798be8c04,
|
||||
0x999906db15a10d5a,
|
||||
0x270fa8d9defc6f79,
|
||||
@ -2575,8 +2573,7 @@ fn test_fq_mul_assign() {
|
||||
0x1162b680fb8e9566,
|
||||
])));
|
||||
assert!(
|
||||
tmp
|
||||
== Fq(FqRepr([
|
||||
tmp == Fq(FqRepr([
|
||||
0x9dc4000001ebfe14,
|
||||
0x2850078997b00193,
|
||||
0xa8197f1abb4d7bf,
|
||||
|
@ -849,8 +849,7 @@ fn test_fr_repr_sub_noborrow() {
|
||||
0x298a30c744b31acf,
|
||||
]));
|
||||
assert!(
|
||||
t
|
||||
== FrRepr([
|
||||
t == FrRepr([
|
||||
0xb813415048991c1f,
|
||||
0x10ad07ae88725d92,
|
||||
0x5a7b851271759961,
|
||||
@ -1252,8 +1251,7 @@ fn test_fr_mul_assign() {
|
||||
0x5ae3f03b561a841d,
|
||||
])));
|
||||
assert!(
|
||||
tmp
|
||||
== Fr(FrRepr([
|
||||
tmp == Fr(FrRepr([
|
||||
0x23717213ce710f71,
|
||||
0xdbee1fe53a16e1af,
|
||||
0xf565d3e1c2a48000,
|
||||
|
27
src/lib.rs
27
src/lib.rs
@ -110,8 +110,8 @@ pub trait Engine: Sized + 'static + Clone {
|
||||
|
||||
/// Projective representation of an elliptic curve point guaranteed to be
|
||||
/// in the correct prime order subgroup.
|
||||
pub trait CurveProjective
|
||||
: PartialEq
|
||||
pub trait CurveProjective:
|
||||
PartialEq
|
||||
+ Eq
|
||||
+ Sized
|
||||
+ Copy
|
||||
@ -121,7 +121,8 @@ pub trait CurveProjective
|
||||
+ fmt::Debug
|
||||
+ fmt::Display
|
||||
+ rand::Rand
|
||||
+ 'static {
|
||||
+ 'static
|
||||
{
|
||||
type Engine: Engine<Fr = Self::Scalar>;
|
||||
type Scalar: PrimeField + SqrtField;
|
||||
type Base: SqrtField;
|
||||
@ -180,8 +181,8 @@ pub trait CurveProjective
|
||||
|
||||
/// Affine representation of an elliptic curve point guaranteed to be
|
||||
/// in the correct prime order subgroup.
|
||||
pub trait CurveAffine
|
||||
: Copy + Clone + Sized + Send + Sync + fmt::Debug + fmt::Display + PartialEq + Eq + 'static
|
||||
pub trait CurveAffine:
|
||||
Copy + Clone + Sized + Send + Sync + fmt::Debug + fmt::Display + PartialEq + Eq + 'static
|
||||
{
|
||||
type Engine: Engine<Fr = Self::Scalar>;
|
||||
type Scalar: PrimeField + SqrtField;
|
||||
@ -232,8 +233,9 @@ pub trait CurveAffine
|
||||
}
|
||||
|
||||
/// An encoded elliptic curve point, which should essentially wrap a `[u8; N]`.
|
||||
pub trait EncodedPoint
|
||||
: Sized + Send + Sync + AsRef<[u8]> + AsMut<[u8]> + Clone + Copy + 'static {
|
||||
pub trait EncodedPoint:
|
||||
Sized + Send + Sync + AsRef<[u8]> + AsMut<[u8]> + Clone + Copy + 'static
|
||||
{
|
||||
type Affine: CurveAffine;
|
||||
|
||||
/// Creates an empty representation.
|
||||
@ -261,8 +263,8 @@ pub trait EncodedPoint
|
||||
}
|
||||
|
||||
/// This trait represents an element of a field.
|
||||
pub trait Field
|
||||
: Sized + Eq + Copy + Clone + Send + Sync + fmt::Debug + fmt::Display + 'static + rand::Rand
|
||||
pub trait Field:
|
||||
Sized + Eq + Copy + Clone + Send + Sync + fmt::Debug + fmt::Display + 'static + rand::Rand
|
||||
{
|
||||
/// Returns the zero element of the field, the additive identity.
|
||||
fn zero() -> Self;
|
||||
@ -334,8 +336,8 @@ pub trait SqrtField: Field {
|
||||
/// This trait represents a wrapper around a biginteger which can encode any element of a particular
|
||||
/// prime field. It is a smart wrapper around a sequence of `u64` limbs, least-significant digit
|
||||
/// first.
|
||||
pub trait PrimeFieldRepr
|
||||
: Sized
|
||||
pub trait PrimeFieldRepr:
|
||||
Sized
|
||||
+ Copy
|
||||
+ Clone
|
||||
+ Eq
|
||||
@ -349,7 +351,8 @@ pub trait PrimeFieldRepr
|
||||
+ rand::Rand
|
||||
+ AsRef<[u64]>
|
||||
+ AsMut<[u64]>
|
||||
+ From<u64> {
|
||||
+ From<u64>
|
||||
{
|
||||
/// Subtract another represetation from this one.
|
||||
fn sub_noborrow(&mut self, other: &Self);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user