diff options
| author | gingerBill <bill@gingerbill.org> | 2023-10-02 20:59:43 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2023-10-02 20:59:43 +0100 |
| commit | d27109640e6c6d86419d2a419a2d5ec3a0cfd1d9 (patch) | |
| tree | 0cb8bfe5e06766fc2c48aeb5b93342f718e7f811 | |
| parent | f9c6f6856bf23cc10b9344d2741943077bbb8036 (diff) | |
Partial pseudo-revert
| -rw-r--r-- | core/math/big/prime.odin | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/core/math/big/prime.odin b/core/math/big/prime.odin index 8403d5315..110c10239 100644 --- a/core/math/big/prime.odin +++ b/core/math/big/prime.odin @@ -1250,7 +1250,10 @@ internal_random_prime :: proc(a: ^Int, size_in_bits: int, trials: int, flags := /* Is it prime? */ - internal_int_is_prime(a, trials) or_return or_continue + res := internal_int_is_prime(a, trials) or_return + if !res { + continue + } if .Safe in flags { /* @@ -1262,9 +1265,10 @@ internal_random_prime :: proc(a: ^Int, size_in_bits: int, trials: int, flags := /* Is it prime? */ - if internal_int_is_prime(a, trials) or_return { - break - } + res = internal_int_is_prime(a, trials) or_return + } + if res { + break } } |