Neptune-Crypto / twenty-first

Collection of mathematics routines and cryptography for the twenty-first century
GNU General Public License v2.0
74 stars 22 forks source link

Implement `BFieldCodec` for `Polynomial<T>` #200

Closed Sword-Smith closed 7 months ago

Sword-Smith commented 7 months ago

Following https://github.com/TritonVM/triton-vm/issues/268, we have realized that it would be very convenient to be able to b-field encode a polynomial, as the conversion from a polynomial to a Vec<T> of its coefficients leaves the possibility of trailing zeros. Therefore, we should implement BFieldCodec for Polynomial<T> where T: BFieldCodec with the main purpose of avoiding any trailing zeros.