Open bennetyee opened 3 weeks ago
size does not return one more than the degree of the polynomial.
True. Size returns the size of the underlying vector, which is the same as the number of (zero and non-zero) coefficients in the polynomial. Again avoiding degree to have constant time operations.
/// Returns the number of coefficients in the polynomial.
pub fn size(&self) -> usize {
https://github.com/oasisprotocol/oasis-core/blob/18da8bc49d92a543795246b8bb7fb574df070eec/secret-sharing/src/poly/univariate.rs#L89
because we don't trim high degree zeros,
size
does not return one more than the degree of the polynomial.while this is not a bug, it feels like a potential foot gun for careless future users of this code.