dalek-cryptography / x25519-dalek

X25519 elliptic curve Diffie-Hellman key exchange in pure-Rust, using curve25519-dalek.
BSD 3-Clause "New" or "Revised" License
326 stars 132 forks source link

Update to new `Scalar` API #120

Closed rozbb closed 1 year ago

rozbb commented 1 year ago

This removes all uses of Scalar::[from_bits, from_bits_clamped}. Some comments inline.

I'll update the git dependency once https://github.com/dalek-cryptography/curve25519-dalek/pull/519 drops.

rozbb commented 1 year ago

@tarcieri Ok one last look. I changed all the constructors to not clamp the inputs (this is what age does). Clamping is always done when doing scalar-point multiplication.