-
Notifications
You must be signed in to change notification settings - Fork 187
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
weierstrass: initial crate #631
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tarcieri
commented
Aug 2, 2022
tarcieri
force-pushed
the
weierstrass
branch
8 times, most recently
from
August 3, 2022 00:09
3373308
to
c5fc82f
Compare
tarcieri
commented
Aug 3, 2022
tarcieri
commented
Aug 3, 2022
tarcieri
commented
Aug 3, 2022
tarcieri
commented
Aug 3, 2022
Comment on lines
+14
to
+29
/// Assert that the provided projective point matches the given test vector. | ||
// TODO(tarcieri): use coordinate APIs. See zkcrypto/group#30 | ||
macro_rules! assert_point_eq { | ||
($actual:expr, $expected:expr) => { | ||
let (expected_x, expected_y) = $expected; | ||
|
||
let point = $actual.to_affine().to_encoded_point(false); | ||
let (actual_x, actual_y) = match point.coordinates() { | ||
sec1::Coordinates::Uncompressed { x, y } => (x, y), | ||
_ => unreachable!(), | ||
}; | ||
|
||
assert_eq!(&expected_x, actual_x.as_slice()); | ||
assert_eq!(&expected_y, actual_y.as_slice()); | ||
}; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@str4d workaround I ended up with for comparing curve points to test vectors.
I suppose I can just change the structure of the test vectors to include SEC1-encoded points.
tarcieri
force-pushed
the
weierstrass
branch
2 times, most recently
from
August 3, 2022 03:13
d106c34
to
f077312
Compare
Implements `AffinePoint` and `ProjectivePoint` generically for both the `p256` and `p384` crates, with the potential to use it for `bp256`/`bp384`/`p521`.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implements
AffinePoint
andProjectivePoint
generically and uses it for both thep256
andp384
crates, with the potential to use it forbp256
/bp384
/p521
as well.TODO
serde
supportPrimeField
constantscc @jedisct1 @brycx