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

Function set_bit

oblivious_transfer/src/util.rs:190–197  ·  view source on GitHub ↗
(dst: &mut [u8], i: usize, b: u8)

Source from the content-addressed store, hash-verified

188#[cfg(test)]
189#[inline]
190fn set_bit(dst: &mut [u8], i: usize, b: u8) {
191 let bit_pos = modulo_8(i);
192 if b == 1 {
193 dst[divide_by_8(i)] |= BITMASKS[bit_pos];
194 } else {
195 dst[divide_by_8(i)] &= BITMASKS_NOT[bit_pos];
196 }
197}
198
199#[inline(always)]
200#[cfg(target_arch = "x86_64")]

Callers 1

transpose_inplaceFunction · 0.85

Calls 2

modulo_8Function · 0.85
divide_by_8Function · 0.85

Tested by

no test coverage detected