MCPcopy Create free account
hub / github.com/docknetwork/crypto / u8vec_to_boolvec

Function u8vec_to_boolvec

oblivious_transfer/src/util.rs:232–240  ·  view source on GitHub ↗
(v: &[u8])

Source from the content-addressed store, hash-verified

230}
231
232pub fn u8vec_to_boolvec(v: &[u8]) -> Vec<bool> {
233 let mut bv = Vec::with_capacity(multiply_by_8(v.len()));
234 for byte in v.iter() {
235 for i in 0..8 {
236 bv.push((1 << i) & byte != 0);
237 }
238 }
239 bv
240}
241
242#[inline]
243pub fn transpose(input: &[u8], nrows: usize, ncols: usize) -> Vec<u8> {

Callers 2

Calls 3

multiply_by_8Function · 0.85
lenMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected