| 25 | ]; |
| 26 | |
| 27 | fn scheduling_64_padding() -> [u32; 64] { |
| 28 | const PADDING_64_BYTES: [u32; 16] = [ |
| 29 | 0x80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, |
| 30 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, |
| 31 | 0x00000000, 0x00000200, |
| 32 | ]; |
| 33 | let mut result = [0; 64]; |
| 34 | result[..16].clone_from_slice(PADDING_64_BYTES.as_ref()); |
| 35 | |
| 36 | for i in 16..64 { |
| 37 | let s0 = result[i - 15].rotate_right(7) |
| 38 | ^ result[i - 15].rotate_right(18) |
| 39 | ^ (result[i - 15] >> 3); |
| 40 | let s1 = |
| 41 | result[i - 2].rotate_right(17) ^ result[i - 2].rotate_right(19) ^ (result[i - 2] >> 10); |
| 42 | result[i] = result[i - 16] |
| 43 | .wrapping_add(s0) |
| 44 | .wrapping_add(result[i - 7]) |
| 45 | .wrapping_add(s1); |
| 46 | } |
| 47 | result |
| 48 | } |
| 49 | |
| 50 | pub fn u4_number_to_nibble(n: u32) -> Script { |
| 51 | //constant number used during "compile" time |