Skip to content

Commit 11d2820

Browse files
committed
Rename ConstantTime{Greater,Less}Than to ConstantTime{Greater,Less}.
1 parent 265cf37 commit 11d2820

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

src/lib.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ impl<T: ConstantTimeEq> ConstantTimeEq for CtOption<T> {
670670

671671
/// A type which can be compared in some manner and be determined to be greater
672672
/// than another of the same type.
673-
pub trait ConstantTimeGreaterThan {
673+
pub trait ConstantTimeGreater {
674674
/// Determine whether `self > other`.
675675
///
676676
/// The bitwise-NOT of the return value of this function should be usable to
@@ -687,7 +687,7 @@ pub trait ConstantTimeGreaterThan {
687687
///
688688
/// ```
689689
/// # extern crate subtle;
690-
/// use subtle::ConstantTimeGreaterThan;
690+
/// use subtle::ConstantTimeGreater;
691691
///
692692
/// let x: u8 = 13;
693693
/// let y: u8 = 42;
@@ -707,9 +707,9 @@ pub trait ConstantTimeGreaterThan {
707707
fn ct_gt(&self, other: &Self) -> Choice;
708708
}
709709

710-
macro_rules! generate_unsigned_integer_greater_than {
710+
macro_rules! generate_unsigned_integer_greater {
711711
($t_u: ty, $bit_width: expr) => {
712-
impl ConstantTimeGreaterThan for $t_u {
712+
impl ConstantTimeGreater for $t_u {
713713
/// Returns Choice::from(1) iff x > y, and Choice::from(0) iff x <= y.
714714
///
715715
/// # Note
@@ -742,16 +742,16 @@ macro_rules! generate_unsigned_integer_greater_than {
742742
}
743743
}
744744

745-
generate_unsigned_integer_greater_than!(u8, 8);
746-
generate_unsigned_integer_greater_than!(u16, 16);
747-
generate_unsigned_integer_greater_than!(u32, 32);
748-
generate_unsigned_integer_greater_than!(u64, 64);
745+
generate_unsigned_integer_greater!(u8, 8);
746+
generate_unsigned_integer_greater!(u16, 16);
747+
generate_unsigned_integer_greater!(u32, 32);
748+
generate_unsigned_integer_greater!(u64, 64);
749749
#[cfg(feature = "i128")]
750-
generate_unsigned_integer_greater_than!(u128, 128);
750+
generate_unsigned_integer_greater!(u128, 128);
751751

752752
/// A type which can be compared in some manner and be determined to be less
753753
/// than another of the same type.
754-
pub trait ConstantTimeLessThan: ConstantTimeEq + ConstantTimeGreaterThan {
754+
pub trait ConstantTimeLess: ConstantTimeEq + ConstantTimeGreater {
755755
/// Determine whether `self < other`.
756756
///
757757
/// The bitwise-NOT of the return value of this function should be usable to
@@ -771,7 +771,7 @@ pub trait ConstantTimeLessThan: ConstantTimeEq + ConstantTimeGreaterThan {
771771
///
772772
/// ```
773773
/// # extern crate subtle;
774-
/// use subtle::ConstantTimeLessThan;
774+
/// use subtle::ConstantTimeLess;
775775
///
776776
/// let x: u8 = 13;
777777
/// let y: u8 = 42;
@@ -794,9 +794,9 @@ pub trait ConstantTimeLessThan: ConstantTimeEq + ConstantTimeGreaterThan {
794794
}
795795
}
796796

797-
impl ConstantTimeLessThan for u8 {}
798-
impl ConstantTimeLessThan for u16 {}
799-
impl ConstantTimeLessThan for u32 {}
800-
impl ConstantTimeLessThan for u64 {}
797+
impl ConstantTimeLess for u8 {}
798+
impl ConstantTimeLess for u16 {}
799+
impl ConstantTimeLess for u32 {}
800+
impl ConstantTimeLess for u64 {}
801801
#[cfg(feature = "i128")]
802-
impl ConstantTimeLessThan for u128 {}
802+
impl ConstantTimeLess for u128 {}

0 commit comments

Comments
 (0)