Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EC_AffinePoint API improvements #4446

Merged
merged 1 commit into from
Nov 27, 2024
Merged

EC_AffinePoint API improvements #4446

merged 1 commit into from
Nov 27, 2024

Conversation

randombit
Copy link
Owner

This adds point negation and point addition.

Point addition is not particularly efficient since it converts the result immediately to an affine coordinate, as we do not currently expose projective points at all. That said it is more than sufficient for simple protocols that just need to add a few points together.

This also corrects the return result of EC_AffinePoint::mul_px_qy, which would previously crash if the resulting point was the identity element. Instead it should return nullopt.

Discussion in #4027

@randombit randombit requested a review from reneme November 25, 2024 22:59
@randombit randombit added this to the Botan 3.7.0 milestone Nov 25, 2024
@coveralls
Copy link

coveralls commented Nov 25, 2024

Coverage Status

coverage: 91.257% (+0.01%) from 91.245%
when pulling 28bf67c on jack/add-pt-addition
into e54502e on master.

src/lib/pubkey/ec_group/ec_apoint.cpp Show resolved Hide resolved
src/lib/pubkey/ec_group/ec_apoint.h Outdated Show resolved Hide resolved
@randombit randombit mentioned this pull request Nov 27, 2024
This adds point negation and point addition.

Point addition is not particularly efficient since it converts the
result immediately to an affine coordinate, as we do not currently
expose projective points at all. That said it is more than sufficient
for simple protocols that just need to add a few points together.

This also corrects the return result of EC_AffinePoint::mul_px_qy,
which would previously crash if the resulting point was the identity
element. Instead it should return nullopt.

Discussion in #4027
@randombit randombit force-pushed the jack/add-pt-addition branch from e6e4c7a to 28bf67c Compare November 27, 2024 15:44
@randombit randombit merged commit 09a7a98 into master Nov 27, 2024
38 checks passed
@randombit randombit deleted the jack/add-pt-addition branch November 27, 2024 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants