MCPcopy Create free account
hub / github.com/BitVM/BitVM / u4_2_nib_shift_blake

Function u4_2_nib_shift_blake

bitvm/src/u4/u4_shift_stack.rs:96–102  ·  view source on GitHub ↗

Assuming the u4 numbers X and Y are on top of the stack, calculates (16 * Y + X) >> 3 modulo 16

(stack: &mut StackTracker, tables: StackVariable)

Source from the content-addressed store, hash-verified

94
95/// Assuming the u4 numbers X and Y are on top of the stack, calculates (16 * Y + X) >> 3 modulo 16
96pub fn u4_2_nib_shift_blake(stack: &mut StackTracker, tables: StackVariable) -> StackVariable {
97 stack.number(8);
98 stack.op_greaterthanorequal();
99 stack.op_swap();
100 stack.get_value_from_table(tables, None);
101 stack.op_add()
102}
103
104#[cfg(test)]
105mod tests {

Callers 2

test_2_nib_shift_blakeFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_2_nib_shift_blakeFunction · 0.68