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 public key and signature into a vector of field elements in the format expected by miden::core::crypto::dsa::eddsa_ed25519::verify procedure.

The encoding format is:

  1. The Ed25519 public key encoded as 8 packed-u32 felts (32 bytes total).
  2. The EdDSA signature encoded as 16 packed-u32 felts (64 bytes total).

The two chunks are concatenated as [PK[8] || SIG[16]] so they can be streamed straight to the advice provider before invoking eddsa_ed25519::verify.