()
| 508 | |
| 509 | #[test] |
| 510 | fn test_bn254_fq2_div3() { |
| 511 | println!("Fq2.div3: {} bytes", Fq2::div3().len()); |
| 512 | let mut prng = ChaCha20Rng::seed_from_u64(0); |
| 513 | |
| 514 | for _ in 0..1 { |
| 515 | let a = ark_bn254::Fq2::rand(&mut prng); |
| 516 | let b = a.double(); |
| 517 | let c = a.add(b); |
| 518 | |
| 519 | let script = script! { |
| 520 | { Fq2::push(c) } |
| 521 | { Fq2::div3() } |
| 522 | { Fq2::push(a) } |
| 523 | { Fq2::equalverify() } |
| 524 | OP_TRUE |
| 525 | }; |
| 526 | run(script); |
| 527 | } |
| 528 | } |
| 529 | |
| 530 | #[test] |
| 531 | fn test_bn254_fq2_hinted_mul() { |