xor_vec and hash_bytes are never used separately, and the API of xor_vec is a bit dangerous since it silently stops at the minimum of the two arguments' lengths.
A polynomial has degree + 1 coefficients, so creating one with degree usize::max_value() panics.
BivarPoly and BivarCommitment have an invariant (coeff.len() == coeff_pos(degree, degree) + 1), which isn't verified on creation and deserialization.
Fix a few issues pointed out in the code audit:
xor_vec
andhash_bytes
are never used separately, and the API ofxor_vec
is a bit dangerous since it silently stops at the minimum of the two arguments' lengths.degree + 1
coefficients, so creating one with degreeusize::max_value()
panics.BivarPoly
andBivarCommitment
have an invariant (coeff.len() == coeff_pos(degree, degree) + 1
), which isn't verified on creation and deserialization.