Skip to content

Conversation

@tarcieri
Copy link
Member

Adds support for encoding elliptic curve points according to the following algorithms defined in SEC1:

  • Elliptic-Curve-Point-to-Octet-String
  • Octet-String-to-Elliptic-Curve-Point

These encodings use a tag byte (0x02/0x03 for compressed, 0x04 for uncompressed) followed by one or two big endian-serialized field elements representing the x/y coordinates of a curve point.

This is an extraction of the implementation from the elliptic-curve crate, decoupled from the types in that crate and thus generally useful for any crate which wishes to implement SEC1 support.

Adds support for encoding elliptic curve points according to the
following algorithms defined in SEC1:

- `Elliptic-Curve-Point-to-Octet-String`
- `Octet-String-to-Elliptic-Curve-Point`

These encodings use a tag byte (0x02/0x03 for compressed, 0x04 for
uncompressed) followed by one or two big endian-serialized field
elements representing the x/y coordinates of a curve point.

This is an extraction of the implementation from the `elliptic-curve`
crate, decoupled from the types in that crate and thus generally useful
for any crate which wishes to implement SEC1 support.
@tarcieri tarcieri merged commit ba7e713 into master Sep 18, 2021
@tarcieri tarcieri deleted the sec1/elliptic-curve-point-encoding branch September 18, 2021 16:58
tarcieri added a commit to RustCrypto/traits that referenced this pull request Sep 19, 2021
The `EncodedPoint` type was extracted to the `sec1` crate in:

RustCrypto/formats#45

This switches the `elliptic-curve` to using the newly extracted
implementation.

This was a bit tricky/invasive as now `EncodedPoint` now only knows a
size and not the rest of the details of the curve.

APIs that were previously heavily leveraging `EncodedPoint` should
probably switch to the `PublicKey` type instead unless they are
specifically intending to work with SEC1-encoded points.
tarcieri added a commit to RustCrypto/traits that referenced this pull request Sep 19, 2021
The `EncodedPoint` type was extracted to the `sec1` crate in:

RustCrypto/formats#45

This switches the `elliptic-curve` to using the newly extracted
implementation.

This was a bit tricky/invasive as now `EncodedPoint` now only knows a
size and not the rest of the details of the curve.

APIs that were previously heavily leveraging `EncodedPoint` should
probably switch to the `PublicKey` type instead unless they are
specifically intending to work with SEC1-encoded points.
tarcieri added a commit to RustCrypto/traits that referenced this pull request Sep 19, 2021
The `EncodedPoint` type was extracted to the `sec1` crate in:

RustCrypto/formats#45

This switches the `elliptic-curve` to using the newly extracted
implementation.

This was a bit tricky/invasive as now `EncodedPoint` now only knows a
size and not the rest of the details of the curve.

APIs that were previously heavily leveraging `EncodedPoint` should
probably switch to the `PublicKey` type instead unless they are
specifically intending to work with SEC1-encoded points.
tarcieri added a commit to RustCrypto/traits that referenced this pull request Sep 19, 2021
The `EncodedPoint` type was extracted to the `sec1` crate in:

RustCrypto/formats#45

This switches the `elliptic-curve` to using the newly extracted
implementation.

This was a bit tricky/invasive as now `EncodedPoint` now only knows a
size and not the rest of the details of the curve.

APIs that were previously heavily leveraging `EncodedPoint` should
probably switch to the `PublicKey` type instead unless they are
specifically intending to work with SEC1-encoded points.
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