This test is not extensive and definitely misses corner cases
(ps: &Parameters, _message: &[u8], verifier: &str)
| 717 | |
| 718 | // This test is not extensive and definitely misses corner cases |
| 719 | fn try_malicious(ps: &Parameters, _message: &[u8], verifier: &str) -> Script { |
| 720 | let mut rng = MALICIOUS_RNG.lock().unwrap(); |
| 721 | let ind = rng.gen_range(0..ps.total_digit_len()); |
| 722 | if verifier == get_type_name::<BruteforceVerifier>() { |
| 723 | script! { |
| 724 | for _ in 0..ind { |
| 725 | OP_TOALTSTACK |
| 726 | } |
| 727 | for _ in 0..(rng.gen_range(1..20)) { |
| 728 | OP_HASH160 |
| 729 | } for _ in 0..ind { |
| 730 | OP_FROMALTSTACK |
| 731 | } |
| 732 | } |
| 733 | } else { |
| 734 | let type_of_action = rng.gen_range(0..2); |
| 735 | script! { |
| 736 | for _ in 0..ind { |
| 737 | OP_TOALTSTACK OP_TOALTSTACK |
| 738 | } |
| 739 | if type_of_action == 0 { |
| 740 | OP_DROP {-1} |
| 741 | } else { |
| 742 | OP_TOALTSTACK |
| 743 | for _ in 0..(rng.gen_range(1..20)) { |
| 744 | OP_HASH160 |
| 745 | } |
| 746 | OP_FROMALTSTACK |
| 747 | } |
| 748 | for _ in 0..ind { |
| 749 | OP_FROMALTSTACK OP_FROMALTSTACK |
| 750 | } |
| 751 | } |
| 752 | } |
| 753 | } |
| 754 | |
| 755 | fn test_script( |
| 756 | ps: &Parameters, |
nothing calls this directly
no test coverage detected