MCPcopy Create free account
hub / github.com/BitVM/BitVM / test_div2

Function test_div2

bitvm/src/bn254/fq.rs:940–957  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

938
939 #[test]
940 fn test_div2() {
941 println!("Fq.div2: {} bytes", Fq::div2().len());
942 let mut prng = ChaCha20Rng::seed_from_u64(0);
943
944 for _ in 0..10 {
945 let a = ark_bn254::Fq::rand(&mut prng);
946 let c = a.double();
947
948 let script = script! {
949 { Fq::push_u32_le(&BigUint::from(c).to_u32_digits()) }
950 { Fq::div2() }
951 { Fq::push_u32_le(&BigUint::from(a).to_u32_digits()) }
952 { Fq::equalverify(1, 0) }
953 OP_TRUE
954 };
955 run(script);
956 }
957 }
958
959 #[test]
960 fn test_div3() {

Callers

nothing calls this directly

Calls 2

runFunction · 0.85
doubleMethod · 0.45

Tested by

no test coverage detected