ZenGo-X / curv

Rust language general purpose elliptic curve cryptography.
MIT License
264 stars 111 forks source link

Implement Try and Increment when converting hash to bigint #128

Closed elichai closed 3 years ago

elichai commented 3 years ago

This algorithm should improve performance in the regular case (no conversion to big int and serializing that), and should also improve security in curves where 2^n-q > ε.

Note that now if you try to convert a small hash into a bigger scalar this will panic, we could return an error instead but I think if this happens then it is a programmer error that requires fixing the code, you can't really "handle" an error like that. so I think a panic is the right thing.

elichai commented 3 years ago

@survived Your changes look great :)