ZenGo-X / curv

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

Add a cautionary assert to `share_at_indices` to prevent user from misusing the api and passing 0 as index #157

Closed elichai closed 2 years ago

elichai commented 2 years ago

VerifiableSS::share_at_indices is meant for users to share a secret at f(0), the caller of this API is required to check that the indexes aren't controlled by an attacker, as an attacker could say that their index is the same as some other party's index, or that it is zero, or even claim that it has multiple indices allowing it to have t points by its self.

Nonetheless after a report from Trail-Of-Bits we add a cautionary assert to make sure the indices don't contain any zeros, because this is the worst kind of API mistake the user can make (as it tells them the secret)