elliptic-curve: consolidate AffineCoordinates
trait
#1237
Merged
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.
See RustCrypto/elliptic-curves#50 for some historic context.
After being able to get by on
AffineXCoordinate
for generic ECDH and ECDSA, #1199 added anAffineYIsOdd
trait which was needed to enable the generic ECDSA implementation in theecdsa
crate to compute the "recovery ID" for signatures (which is effectively point compression for theR
curve point).This commit consolidates
AffineXCoordinate
andAffineYIsOdd
into anAffineCoordinates
trait.Some observations since prior discussion in
RustCrypto/elliptic-curves#50:
FieldBytes
. This is so as to avoid exposing a crate's field element type. This approach isn't type safe (base field elements and scalar field elements share the same serialization) but does make ECDSA's weird reduction of a base field element into the scalar field straightforward in generic code.This trait can hopefully be replaced by a coordinate access API provided by the
group
crate in the future. See zkcrypto/group#30