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

p256: properly handle neutral element & add AffineCoordinates struct #8718

Merged
merged 1 commit into from
May 9, 2021

Conversation

jedisct1
Copy link
Contributor

@jedisct1 jedisct1 commented May 8, 2021

Instead of multiple references to an anonymous structure to represent affine coordinates, add an actual AffineCoordinates structure.

Also properly handle the neutral element during coordinate conversion and fix mixed addition.

And comptime the small precomputation table for basepoint multiplication.

Instead of multiple references to an anonymous structure to represent
affine coordinates, add an actual `AffineCoordinates` structure.

Also properly handle the neutral element during coordinate conversion
and fix mixed addition.

And comptime the small precomputation table for basepoint multiplication.
@@ -49,21 +49,26 @@ pub const P256 = struct {
}

/// Create a point from affine coordinates after checking that they match the curve equation.
pub fn fromAffineCoordinates(x: Fe, y: Fe) EncodingError!P256 {
pub fn fromAffineCoordinates(p: AffineCoordinates) EncodingError!P256 {
Copy link

@Mouvedia Mouvedia May 8, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI
this should not really be considered breaking because p256.zig was added very recently (#8627)

@jedisct1 jedisct1 merged commit 2d11967 into ziglang:master May 9, 2021
@jedisct1 jedisct1 deleted the p256-update2 branch May 9, 2021 16:20
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.

2 participants