Returns a script that computes the BLAKE3 hash of the message on the stack. The script processes compact message blocks and only unpacks them when needed, resulting in higher stack efficiency and support for larger messages. ## Parameters - `msg_len`: Length of the message. (excluding the padding, number of bytes) - `limb_len`: Limb length (number of bits per element) that the input in the stac
(message_len: usize, limb_len: u8)
| 347 | /// - Temporarily uses the alternate stack for intermediate results and hash computation tables. |
| 348 | /// - Final result is left on the main stack as a BLAKE3 hash value. (in nibbles) |
| 349 | pub fn blake3_compute_script_with_limb(message_len: usize, limb_len: u8) -> Script { |
| 350 | assert!( |
| 351 | message_len <= 1024, |
| 352 | "This BLAKE3 implementation doesn't support messages longer than 1024 bytes" |
| 353 | ); |
| 354 | let mut stack = StackTracker::new(); |
| 355 | let use_full_tables = true; |
| 356 | let message_len = message_len as u32; // safety: message_len <= 1024 << u32::MAX |
| 357 | blake3(&mut stack, message_len, true, use_full_tables, limb_len); |
| 358 | stack.get_script() |
| 359 | } |
| 360 | |
| 361 | /// Uses [`blake3_compute_script_with_limb`].with limb length 29, see the documentation of it for more details |
| 362 | pub fn blake3_compute_script(message_len: usize) -> Script { |