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

Add `getrandom` feature that enables builtin `new_random` constructors (see issue #85) #103

Closed cipriancraciun closed 1 year ago

cipriancraciun commented 1 year ago

This pull request is trivial and just adds a helper function new_random for EphemeralSecret, StaticSecret and ReusableSecret that just delegates to Self::new(&mut rand_core::OsRng), thus solving #85.

This feature is hidden behind the getrandom feature (that enables rand_core/getrandom).

There are no added tests, because the implementation is trivial.

pinkforest commented 1 year ago

This was in the wrong branch so #113 supercedes this - I added co-authored-by so you get the credit ;)

cipriancraciun commented 1 year ago

@pinkforest no problem, thanks for the credit.

I'll close this pull request then.