Pushes the table for calculating the quotient, i.e. floor(x / 16) for x < 48. i.e. 15 (max u4) * 3 (max # numbers to sum) + 2 (max carry)
(stack: &mut StackTracker)
| 31 | |
| 32 | /// Pushes the table for calculating the quotient, i.e. floor(x / 16) for x < 48. i.e. 15 (max u4) * 3 (max # numbers to sum) + 2 (max carry) |
| 33 | pub fn u4_push_quotient_for_blake(stack: &mut StackTracker) -> StackVariable { |
| 34 | stack.custom( |
| 35 | script! { |
| 36 | for i in (0..=2).rev() { |
| 37 | { i } |
| 38 | OP_DUP |
| 39 | OP_2DUP |
| 40 | OP_3DUP |
| 41 | OP_3DUP |
| 42 | OP_3DUP |
| 43 | OP_3DUP |
| 44 | } |
| 45 | }, |
| 46 | 0, |
| 47 | false, |
| 48 | 0, |
| 49 | "", |
| 50 | ); |
| 51 | stack.define(48, "quotient") |
| 52 | } |
| 53 | |
| 54 | /// Arranges (zips) the given numbers (locations given by the parameters bases) each consisting of nibble_count u4's so each group of nibbles can be proccessed disceretly |
| 55 | /// Does not preserve order as it's used with commutative operations |
no outgoing calls