()
| 447 | |
| 448 | #[test] |
| 449 | fn test_bn254_fq2_double() { |
| 450 | println!("Fq2.double: {} bytes", Fq2::double(0).len()); |
| 451 | let mut prng = ChaCha20Rng::seed_from_u64(0); |
| 452 | |
| 453 | for _ in 0..50 { |
| 454 | let a = ark_bn254::Fq2::rand(&mut prng); |
| 455 | let c = a.double(); |
| 456 | |
| 457 | let script = script! { |
| 458 | { Fq2::push(a) } |
| 459 | { Fq2::double(0) } |
| 460 | { Fq2::push(c) } |
| 461 | { Fq2::equalverify() } |
| 462 | OP_TRUE |
| 463 | }; |
| 464 | run(script); |
| 465 | } |
| 466 | } |
| 467 | |
| 468 | #[test] |
| 469 | fn test_bn254_fq2_triple() { |