summaryrefslogtreecommitdiffstats
path: root/vendor/crypto-bigint/src/uint/neg_mod.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 02:49:42 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 02:49:42 +0000
commit837b550238aa671a591ccf282dddeab29cadb206 (patch)
tree914b6b8862bace72bd3245ca184d374b08d8a672 /vendor/crypto-bigint/src/uint/neg_mod.rs
parentAdding debian version 1.70.0+dfsg2-1. (diff)
downloadrustc-837b550238aa671a591ccf282dddeab29cadb206.tar.xz
rustc-837b550238aa671a591ccf282dddeab29cadb206.zip
Merging upstream version 1.71.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/crypto-bigint/src/uint/neg_mod.rs')
-rw-r--r--vendor/crypto-bigint/src/uint/neg_mod.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/vendor/crypto-bigint/src/uint/neg_mod.rs b/vendor/crypto-bigint/src/uint/neg_mod.rs
index 0a1dc033a..aaed2768f 100644
--- a/vendor/crypto-bigint/src/uint/neg_mod.rs
+++ b/vendor/crypto-bigint/src/uint/neg_mod.rs
@@ -1,8 +1,8 @@
-//! [`UInt`] negation modulus operations.
+//! [`Uint`] negation modulus operations.
-use crate::{Limb, NegMod, UInt};
+use crate::{Limb, NegMod, Uint};
-impl<const LIMBS: usize> UInt<LIMBS> {
+impl<const LIMBS: usize> Uint<LIMBS> {
/// Computes `-a mod p` in constant time.
/// Assumes `self` is in `[0, p)`.
pub const fn neg_mod(&self, p: &Self) -> Self {
@@ -12,7 +12,7 @@ impl<const LIMBS: usize> UInt<LIMBS> {
while i < LIMBS {
// Set ret to 0 if the original value was 0, in which
// case ret would be p.
- ret.limbs[i].0 &= z;
+ ret.limbs[i].0 = z.if_true(ret.limbs[i].0);
i += 1;
}
ret
@@ -25,7 +25,7 @@ impl<const LIMBS: usize> UInt<LIMBS> {
}
}
-impl<const LIMBS: usize> NegMod for UInt<LIMBS> {
+impl<const LIMBS: usize> NegMod for Uint<LIMBS> {
type Output = Self;
fn neg_mod(&self, p: &Self) -> Self {