Skip to main content

dot_product

Function dot_product 

Source
pub fn dot_product(a: &[u8], b: &[u8], bits: usize) -> Elem
Expand description

The GF(2) inner product of two packed vectors: the parity of popcount(a & b) over the live bits.

Returned as a gf2::Elem; use is_one to test it. Padding bits contribute nothing.

ยงPanics

Panics if the slices differ in length or are shorter than bytes_for(bits).