Skip to content

Commit

Permalink
Correct comment that p{256,384}_montjadd are complete
Browse files Browse the repository at this point in the history
  • Loading branch information
ctz committed Feb 23, 2025
1 parent 4a13b2a commit fd84f5f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion graviola/src/mid/p256.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ impl PublicKey {
let rhs = JacobianMontPoint::public_multiply_w5(&u2, &self.precomp_w5);

// nb. if lhs == rhs, then we need a doubling rather than addition
// (even complete point addition formula is only defined for P != Q)
// (because `p256_montjadd` doesn't handle P + P.)
let point = if lhs.public_eq(&rhs) {
lhs.double()
} else {
Expand Down
2 changes: 1 addition & 1 deletion graviola/src/mid/p384.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ impl PublicKey {
let rhs = JacobianMontPoint::public_multiply_w5(&u2, &self.precomp_w5);

// nb. if lhs == rhs, then we need a doubling rather than addition
// (even complete point addition formula is only defined for P != Q)
// (because `p384_montjadd` doesn't handle P + P.)
let point = if lhs.public_eq(&rhs) {
lhs.double()
} else {
Expand Down

0 comments on commit fd84f5f

Please sign in to comment.