Skip to main content

pack_fused_output

Function pack_fused_output 

Source
pub fn pack_fused_output<P: Profile>(
    signature: &Signature<P>,
    public_key: &PublicKey<P>,
) -> FusedFrame<P>
Expand description

Packs signature || public_key into the canonical 35-beat output stream.

Beats 0 through 32 contain two 32-byte signature segments each. Beat 33 contains signature segment 66 followed by the public seed (the first half of the public key). Beat 34 contains the public-key hash in its low 32 byte lanes; its high lanes are zero and invalid.

The shared profile parameter prevents combining a signature from one profile with a public key from the other:

use hashsigs_types::{
    CHAIN_COUNT, HashSigsSha256GenericV1, LegacyKeccak, PublicKey, Signature,
};
use wots_rhdl::pack_fused_output;

let signature = Signature::<LegacyKeccak>::new([[0; 32]; CHAIN_COUNT]);
let public_key = PublicKey::<HashSigsSha256GenericV1>::new([0; 32], [0; 32]);
let _ = pack_fused_output(&signature, &public_key);