dalek-cryptography / curve25519-dalek

A pure-Rust implementation of group operations on Ristretto and Curve25519
Other
850 stars 416 forks source link

Impl std::num_traits::{One, Zero} for Scalar types #648

Open Pythoner6 opened 3 months ago

Pythoner6 commented 3 months ago

I'm currently trying to use the ristretto Scalar type with nalgebra, but cannot do matrix multiplications, because nalgebra requires the type to implement One and Zero for that. Since we have Scalar::ONE and Scalar::ZERO already, it seems reasonable that maybe Scalar should implement the rust std traits for it (and I suppose maybe also std::num_traits::{ConstOne, ConstZero} too).