Skip to main content

sample_poly_cbd

Function sample_poly_cbd 

Source
pub(crate) fn sample_poly_cbd<Eta>(
    B: &EncodedPolynomial<<Eta as CbdSamplingSize>::SampleSize>,
) -> Polynomial<BaseField>
where Eta: CbdSamplingSize,
Expand description

Algorithm 8: SamplePolyCBD_eta(B)

To avoid all the bitwise manipulation in the algorithm as written, we reuse the logic in ByteDecode. We decode the PRF output into integers with eta bits, then use count_ones to perform the summation described in the algorithm.