Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ use std::{
Sub, SubAssign,
},
};
use subtle::{Choice, ConditionallyNegatable, ConditionallySelectable, ConstantTimeEq};
use subtle::{
Choice, ConditionallyNegatable, ConditionallySelectable, ConstantTimeEq, ConstantTimeLess,
};

#[cfg(feature = "experimental")]
mod field255;
Expand Down Expand Up @@ -219,7 +221,12 @@ pub trait Integer:
/// use of the associated integer type.
pub trait FieldElementWithInteger: FieldElement + From<Self::Integer> {
/// The integer representation of a field element.
type Integer: Integer + From<Self> + Copy;
type Integer: Integer
+ From<Self>
+ Copy
+ ConstantTimeEq
+ ConstantTimeLess
+ ConditionallySelectable;

/// Modular exponentation, i.e., `self^exp (mod p)`.
fn pow(&self, exp: Self::Integer) -> Self;
Expand Down
Loading