summaryrefslogtreecommitdiffstats
path: root/vendor/crypto-bigint/src/ct_choice.rs
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/crypto-bigint/src/ct_choice.rs')
-rw-r--r--vendor/crypto-bigint/src/ct_choice.rs10
1 files changed, 3 insertions, 7 deletions
diff --git a/vendor/crypto-bigint/src/ct_choice.rs b/vendor/crypto-bigint/src/ct_choice.rs
index 1308dd328..56bb79d82 100644
--- a/vendor/crypto-bigint/src/ct_choice.rs
+++ b/vendor/crypto-bigint/src/ct_choice.rs
@@ -9,10 +9,10 @@ use crate::Word;
pub struct CtChoice(Word);
impl CtChoice {
- /// The falsy vaue.
+ /// The falsy value.
pub const FALSE: Self = Self(0);
- /// The truthy vaue.
+ /// The truthy value.
pub const TRUE: Self = Self(Word::MAX);
/// Returns the truthy value if `value == Word::MAX`, and the falsy value if `value == 0`.
@@ -25,7 +25,7 @@ impl CtChoice {
/// Returns the truthy value if `value == 1`, and the falsy value if `value == 0`.
/// Panics for other values.
pub(crate) const fn from_lsb(value: Word) -> Self {
- debug_assert!(value == Self::FALSE.0 || value == 1);
+ debug_assert!(value == 0 || value == 1);
Self(value.wrapping_neg())
}
@@ -37,10 +37,6 @@ impl CtChoice {
Self(self.0 & other.0)
}
- pub(crate) const fn or(&self, other: Self) -> Self {
- Self(self.0 | other.0)
- }
-
/// Return `b` if `self` is truthy, otherwise return `a`.
pub(crate) const fn select(&self, a: Word, b: Word) -> Word {
a ^ (self.0 & (a ^ b))