Assuming the u4 numbers X and Y are on top of the stack, calculates (16 * Y + X) >> n modulo 16
(
stack: &mut StackTracker,
tables: StackVariable,
n: u32,
)
| 81 | |
| 82 | /// Assuming the u4 numbers X and Y are on top of the stack, calculates (16 * Y + X) >> n modulo 16 |
| 83 | pub fn u4_2_nib_shift_stack( |
| 84 | stack: &mut StackTracker, |
| 85 | tables: StackVariable, |
| 86 | n: u32, |
| 87 | ) -> StackVariable { |
| 88 | assert!((1..4).contains(&n)); |
| 89 | u4_lshift_stack(stack, tables, 4 - n); |
| 90 | stack.op_swap(); |
| 91 | u4_rshift_stack(stack, tables, n); |
| 92 | stack.op_add() |
| 93 | } |
| 94 | |
| 95 | /// Assuming the u4 numbers X and Y are on top of the stack, calculates (16 * Y + X) >> 3 modulo 16 |
| 96 | pub fn u4_2_nib_shift_blake(stack: &mut StackTracker, tables: StackVariable) -> StackVariable { |