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

Function u4_push_shift_for_blake

bitvm/src/u4/u4_shift_stack.rs:54–80  ·  view source on GitHub ↗

Table for multiplication by two

(stack: &mut StackTracker)

Source from the content-addressed store, hash-verified

52
53/// Table for multiplication by two
54pub fn u4_push_shift_for_blake(stack: &mut StackTracker) -> StackVariable {
55 stack.custom(
56 script! {
57 OP_14
58 OP_12
59 OP_10
60 OP_8
61 OP_6
62 OP_4
63 OP_2
64 OP_0
65 OP_14
66 OP_12
67 OP_10
68 OP_8
69 OP_6
70 OP_4
71 OP_2
72 OP_0
73 },
74 0,
75 false,
76 0,
77 "",
78 );
79 stack.define(16, "lshift1")
80}
81
82/// Assuming the u4 numbers X and Y are on top of the stack, calculates (16 * Y + X) >> n modulo 16
83pub fn u4_2_nib_shift_stack(

Callers 2

test_2_nib_shift_blakeFunction · 0.85
newMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_2_nib_shift_blakeFunction · 0.68