()
| 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() { |