Skip to content

Commit

Permalink
ec/suite_b: Rename elem_less_than to elem_less_than_vartime.
Browse files Browse the repository at this point in the history
Make it clearer that it is a variable-time operation.
  • Loading branch information
briansmith committed Dec 10, 2024
1 parent cf510c4 commit 1b5c322
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ec/suite_b/ecdsa/verification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ impl EcdsaVerificationAlgorithm {
if sig_r_equals_x(self.ops, &r, &x, &z2) {
return Ok(());
}
if self.ops.elem_less_than(&r, &self.ops.q_minus_n) {
if self.ops.elem_less_than_vartime(&r, &self.ops.q_minus_n) {
let n = Elem::from(self.ops.n());
self.ops.scalar_ops.common.elem_add(&mut r, &n);
if sig_r_equals_x(self.ops, &r, &x, &z2) {
Expand Down
2 changes: 1 addition & 1 deletion src/ec/suite_b/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ impl PublicScalarOps {
a.limbs[..num_limbs] == b.limbs[..num_limbs]
}

pub fn elem_less_than(&self, a: &Elem<Unencoded>, b: &PublicElem<Unencoded>) -> bool {
pub fn elem_less_than_vartime(&self, a: &Elem<Unencoded>, b: &PublicElem<Unencoded>) -> bool {
let num_limbs = self.public_key_ops.common.num_limbs.into();
limbs_less_than_limbs_vartime(&a.limbs[..num_limbs], &b.limbs[..num_limbs])
}
Expand Down

0 comments on commit 1b5c322

Please sign in to comment.