oasis-core icon indicating copy to clipboard operation
oasis-core copied to clipboard

it's possible to change coefficients but not in a way to increase the degree of a polynomial

Open bennetyee opened this issue 1 year ago • 1 comments

https://github.com/oasisprotocol/oasis-core/blob/18da8bc49d92a543795246b8bb7fb574df070eec/secret-sharing/src/poly/univariate.rs#L71

not a bug, but an oddity. the API allows callers to change the coefficients of a polynomial, but not to increase its degree. callers can decrease the degree of a polynomial by setting higher degree coefficients to zero.

bennetyee avatar Aug 26 '24 23:08 bennetyee

callers can decrease the degree of a polynomial

True. This was intentional. The reason for this is that we want to have constant time operations on polynomials. Therefore, the function degree and its usage was removed and replaced with size. In general, the crate has no idea what a degree is.

peternose avatar Aug 27 '24 08:08 peternose