ZenGo-X / curv

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

Add `lagrange_basis` function to `Polynomial` #130

Closed survived closed 3 years ago

survived commented 3 years ago

Adds Polynomial::lagrange_basis that calculates l_j(x):

image

There's similar method VerifiableSS::map_share_to_new_params that calculates lagrange basis too, but for x=0.

Since Polynomial::lagrange_basis generalises VerifiableSS::map_share_to_new_params, I'm going to deprecate the last one unless there are any objections (@omershlo ?) VerifiableSS::map_share_to_new_params uses Polynomial::lagrange_basis internally. No need to deprecate it.