INNER CODE UNIT · Rust

fuzz_strict_sample_returns_number_exactly_n_bits_length

ZenGo-X/curv · src/arithmetic/mod.rs:195

    fn fuzz_strict_sample_returns_number_exactly_n_bits_length() {
        const BITS: usize = 100;

        for _ in 0..100 {
            let n = BigInt::strict_sample(BITS);
            assert_eq!(
                n.bit_length(),
                BITS,
                "returned {} bits length number",
                n.bit_length()
            );
        }
    }

    #[test]
    fn fuzz_sample_range() {
        let a = BigInt::from(500);
        let b = &a * &a;

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…