Skip to main content

encode_signature

Function encode_signature 

Source
pub fn encode_signature(pk: &PublicKey, sig: &Signature) -> Vec<Felt>
Expand description

Encodes the provided Falcon public key and signature into a vector of field elements in the format expected by miden::core::crypto::dsa::falcon512_poseidon2::verify procedure.

The encoding format is (in reverse order on the advice stack):

  1. The challenge point, a tuple of elements representing an element in the quadratic extension field, at which we evaluate the polynomials in the subsequent three points to check the product relationship.
  2. The expanded public key represented as the coefficients of a polynomial of degree < 512.
  3. The signature represented as the coefficients of a polynomial of degree < 512.
  4. The product of the above two polynomials in the ring of polynomials with coefficients in the Miden field.
  5. The nonce represented as 8 field elements.

The result can be streamed straight to the advice provider before invoking falcon512_poseidon2::verify.