Skip to main content

ones_array

Function ones_array 

Source
const fn ones_array<const B: usize, const N: usize, U>() -> Array<Elem<BaseField>, U>
where U: ArraySize<ArrayType<Elem<BaseField>> = [Elem<BaseField>; N]>, Const<N>: ToUInt<Output = U>,
Expand description

To speed up CBD sampling, we pre-compute all the bit-manipulations:

  • Splitting a sampled integer into two parts
  • Counting the ones in each part
  • Taking the difference between the two counts mod q