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

Function test_div2

bitvm/src/bn254/fr.rs:158–175  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

156
157 #[test]
158 fn test_div2() {
159 println!("Fr.div2: {} bytes", Fr::div2().len());
160 let mut prng = ChaCha20Rng::seed_from_u64(0);
161
162 for _ in 0..10 {
163 let a = ark_bn254::Fr::rand(&mut prng);
164 let c = a.double();
165
166 let script = script! {
167 { Fr::push_u32_le(&BigUint::from(c).to_u32_digits()) }
168 { Fr::div2() }
169 { Fr::push_u32_le(&BigUint::from(a).to_u32_digits()) }
170 { Fr::equalverify(1, 0) }
171 OP_TRUE
172 };
173 run(script);
174 }
175 }
176
177 #[test]
178 fn test_div3() {

Callers

nothing calls this directly

Calls 2

runFunction · 0.85
doubleMethod · 0.45

Tested by

no test coverage detected