Skip to content

Conversation

@tarcieri
Copy link
Member

FixedBaseScalarMul was a hack around the lack of an associated Scalar type on a curve and generic way of converting a SecretKey to a Scalar.

We have both of those things, so this commit replaces it with an ops::MulBase trait intended to be impl'd on Scalar types.

Further, it bounds the Arithmetic::Scalar associated type on this, which allows it to be used for generic SecretKey -> PublicKey conversions.

It also means the Arithmetic trait now has a(n implicit) way of representing the generator point, making it genuinely useful for generic arithmetic operations. This would also be useful for e.g. a generic implementation of Diffie-Hellman.

`FixedBaseScalarMul` was a hack around the lack of an associated
`Scalar` type on a curve and generic way of converting a `SecretKey` to
a `Scalar`.

We have both of those things, so this commit replaces it with
an `ops::MulBase` trait intended to be impl'd on `Scalar` types.

Further, it bounds the `Arithmetic::Scalar` associated type on this,
which allows it to be used for generic `SecretKey` -> `PublicKey`
conversions.

It also means the `Arithmetic` trait now has a(n implicit) way of
representing the generator point, making it genuinely useful for generic
arithmetic operations. This would also be useful for e.g. a generic
implementation of Diffie-Hellman.
@tarcieri tarcieri force-pushed the elliptic-curve/mul-base-op branch from 9806c1b to 96b8e44 Compare July 29, 2020 17:16
@tarcieri tarcieri merged commit 1292054 into master Jul 29, 2020
@tarcieri tarcieri deleted the elliptic-curve/mul-base-op branch July 29, 2020 17:18
tarcieri added a commit to RustCrypto/elliptic-curves that referenced this pull request Jul 29, 2020
...and remove the now legacy `FixedBaseScalarMul` trait.

This commit impls the changes from RustCrypto/traits#229 and
RustCrypto/traits#230:

- Adds a `FromSecretKey` impl on `Scalar`
- Adds a `FromPublicKey` impl on `AffinePoint`
- Adds `MulBase` impl on `Scalar`
tarcieri added a commit to RustCrypto/elliptic-curves that referenced this pull request Jul 29, 2020
...and remove the now legacy `FixedBaseScalarMul` trait.

This commit impls the changes from RustCrypto/traits#229 and
RustCrypto/traits#230:

- Adds a `FromSecretKey` impl on `Scalar`
- Adds a `FromPublicKey` impl on `AffinePoint`
- Adds `MulBase` impl on `Scalar`
tarcieri added a commit to RustCrypto/elliptic-curves that referenced this pull request Jul 29, 2020
...and remove the now legacy `FixedBaseScalarMul` trait.

This commit impls the changes from RustCrypto/traits#229 and
RustCrypto/traits#230:

- Adds a `FromSecretKey` impl on `Scalar`
- Adds a `FromPublicKey` impl on `AffinePoint`
- Adds `MulBase` impl on `Scalar`
dns2utf8 pushed a commit to dns2utf8/traits that referenced this pull request Jan 24, 2023
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