pub fn encode_masked<F, P, NTT, A>(
params: &FRIParams<F>,
oracle_index: usize,
ntt: &NTT,
message: FieldBuffer<P, FieldSliceData<'_, P>>,
rng: impl CryptoRng,
alloc: &A,
) -> MaskedCodeword<P, <A as Allocator>::Vec<P>>Expand description
Generates a random mask, interleaves it with the message, and Reed-Solomon encodes.
This is used for zero-knowledge FRI commitments. The function generates a random mask of
equal length to the input message, concatenates message || mask as the interleaved message
(with log_batch_size = 1), and performs Reed-Solomon encoding. The returned codeword is
committed by sending it over a Merkle channel, like encode_interleaved’s.
§Arguments
params- the (possibly batched) FRI parameters.oracle_index- the index intoFRIParams::input_oraclesof the oracle being encoded; its spec must havelog_batch_size == 1andlog_msg_len - 1 == message.log_len().ntt- the additive NTT for Reed-Solomon encodingmessage- the raw message to encode (not doubled)rng- cryptographic RNG for mask generationalloc- the allocator the mask, the codeword, and the concatenation temporary are drawn from