miden-precompiles-prover 0.33.0

Prover-side precompile implementations for the Miden VM deferred framework
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use miden_core::Felt;

use crate::utils::split_u64;

#[test]
fn split_u64_extracts_lo_hi_halves() {
    assert_eq!(split_u64(0), [Felt::ZERO, Felt::ZERO]);
    // 2^32 → lo = 0, hi = 1.
    assert_eq!(split_u64(0x1_0000_0000), [Felt::ZERO, Felt::new(1).unwrap()]);
    // Max u32 fits in lo.
    assert_eq!(split_u64(0xffff_ffff), [Felt::new(0xffff_ffff).unwrap(), Felt::ZERO],);
    assert_eq!(
        split_u64(0xdead_beef_cafe_babe),
        [Felt::new(0xcafe_babe).unwrap(), Felt::new(0xdead_beef).unwrap()],
    );
}