Type Alias Challenger

Source
pub type Challenger = DuplexChallenger<F, Poseidon2BabyBear<WIDTH>, WIDTH, RATE>;

Aliased Type§

pub struct Challenger {
    pub sponge_state: [MontyField31<BabyBearParameters>; 16],
    pub input_buffer: Vec<MontyField31<BabyBearParameters>>,
    pub output_buffer: Vec<MontyField31<BabyBearParameters>>,
    pub permutation: Poseidon2<MontyField31<BabyBearParameters>, Poseidon2ExternalLayerMonty31<BabyBearParameters, 16>, Poseidon2InternalLayerMonty31<BabyBearParameters, 16, BabyBearInternalLayerParameters>, 16, 7>,
}

Fields§

§sponge_state: [MontyField31<BabyBearParameters>; 16]

The internal sponge state, consisting of WIDTH field elements.

The first RATE elements form the rate section, where input values are absorbed and output values are squeezed. The remaining WIDTH - RATE elements form the capacity, which provides hidden entropy and security against attacks.

§input_buffer: Vec<MontyField31<BabyBearParameters>>

A buffer holding field elements that have been observed but not yet absorbed.

Inputs added via observe are collected here. Once the buffer reaches RATE elements, the sponge performs a duplexing step: it absorbs the inputs into the state and applies the permutation.

§output_buffer: Vec<MontyField31<BabyBearParameters>>

A buffer holding field elements that have been squeezed from the sponge state.

Outputs are produced by duplexing and stored here. Calls to sample or sample_bits pop values from this buffer. When the buffer is empty (or new inputs were absorbed), a new duplexing step is triggered.

§permutation: Poseidon2<MontyField31<BabyBearParameters>, Poseidon2ExternalLayerMonty31<BabyBearParameters, 16>, Poseidon2InternalLayerMonty31<BabyBearParameters, 16, BabyBearInternalLayerParameters>, 16, 7>

The cryptographic permutation applied to the sponge state.

This permutation must provide strong pseudorandomness and collision resistance, ensuring that squeezed outputs are indistinguishable from random and securely bound to the absorbed inputs.