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::ecdsa_k256_keccak::verify procedure.

  1. The compressed secp256k1 public key encoded as 9 packed-u32 felts (33 bytes total).
  2. The ECDSA signature encoded as 17 packed-u32 felts (66 bytes total).

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