OpenCoverage

bn_prime.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/bn/bn_prime.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8static int witness(BIGNUM *w, const BIGNUM *a, const BIGNUM *a1,-
9 const BIGNUM *a1_odd, int k, BN_CTX *ctx,-
10 BN_MONT_CTX *mont);-
11static int probable_prime(BIGNUM *rnd, int bits, prime_t *mods);-
12static int probable_prime_dh_safe(BIGNUM *rnd, int bits,-
13 const BIGNUM *add, const BIGNUM *rem,-
14 BN_CTX *ctx);-
15-
16int BN_GENCB_call(BN_GENCB *cb, int a, int b)-
17{-
18-
19 if (!cb
!cbDescription
TRUEevaluated 646 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4096 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
646-4096
20 return
executed 646 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 646 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
646
21 switch (cb->ver) {-
22 case
never executed: case 1:
1:
never executed: case 1:
0
23-
24 if (!cb->cb.cb_1
!cb->cb.cb_1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
25 return
never executed: return 1;
1;
never executed: return 1;
0
26 cb->cb.cb_1(a, b, cb->arg);-
27 return
never executed: return 1;
1;
never executed: return 1;
0
28 case
executed 4096 times by 1 test: case 2:
Executed by:
  • libcrypto.so.1.1
2:
executed 4096 times by 1 test: case 2:
Executed by:
  • libcrypto.so.1.1
4096
29-
30 return
executed 4096 times by 1 test: return cb->cb.cb_2(a, b, cb);
Executed by:
  • libcrypto.so.1.1
cb->cb.cb_2(a, b, cb);
executed 4096 times by 1 test: return cb->cb.cb_2(a, b, cb);
Executed by:
  • libcrypto.so.1.1
4096
31 default
never executed: default:
:
never executed: default:
0
32 break;
never executed: break;
0
33 }-
34-
35 return
never executed: return 0;
0;
never executed: return 0;
0
36}-
37-
38int BN_generate_prime_ex(BIGNUM *ret, int bits, int safe,-
39 const BIGNUM *add, const BIGNUM *rem, BN_GENCB *cb)-
40{-
41 BIGNUM *t;-
42 int found = 0;-
43 int i, j, c1 = 0;-
44 BN_CTX *ctx = -
45 ((void *)0)-
46 ;-
47 prime_t *mods = -
48 ((void *)0)-
49 ;-
50 int checks = ((
(bits) >= 3747Description
TRUEnever evaluated
FALSEevaluated 67 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
bits) >= 3747
(bits) >= 3747Description
TRUEnever evaluated
FALSEevaluated 67 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
? 3 : (
(bits) >= 1345Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 47 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
bits) >= 1345
(bits) >= 1345Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 47 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
? 4 : (
(bits) >= 476Description
TRUEevaluated 39 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
bits) >= 476
(bits) >= 476Description
TRUEevaluated 39 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
? 5 : (
(bits) >= 400Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
bits) >= 400
(bits) >= 400Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
? 6 : (
(bits) >= 347Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
bits) >= 347
(bits) >= 347Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
? 7 : (
(bits) >= 308Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
bits) >= 308
(bits) >= 308Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
? 8 : (
(bits) >= 55Description
TRUEevaluated 7 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
bits) >= 55
(bits) >= 55Description
TRUEevaluated 7 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
? 27 : 34);
0-67
51-
52 if (bits < 2
bits < 2Description
TRUEnever evaluated
FALSEevaluated 67 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-67
53-
54 ERR_put_error(3,(141),(118),__FILE__,64);-
55 return
never executed: return 0;
0;
never executed: return 0;
0
56 } else if (bits == 2
bits == 2Description
TRUEnever evaluated
FALSEevaluated 67 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& safe
safeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0-67
57-
58 ERR_put_error(3,(141),(118),__FILE__,68);-
59 return
never executed: return 0;
0;
never executed: return 0;
0
60 }-
61-
62 mods = CRYPTO_zalloc(sizeof(*mods) * 2048, __FILE__, 72);-
63 if (mods ==
mods == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 67 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-67
64 ((void *)0)
mods == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 67 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-67
65 )-
66 goto
never executed: goto err;
err;
never executed: goto err;
0
67-
68 ctx = BN_CTX_new();-
69 if (ctx ==
ctx == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 67 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-67
70 ((void *)0)
ctx == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 67 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-67
71 )-
72 goto
never executed: goto err;
err;
never executed: goto err;
0
73 BN_CTX_start(ctx);-
74 t = BN_CTX_get(ctx);-
75 if (t ==
t == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 67 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-67
76 ((void *)0)
t == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 67 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-67
77 )-
78 goto
never executed: goto err;
err;
never executed: goto err;
0
79 loop:
code before this statement executed 67 times by 1 test: loop:
Executed by:
  • libcrypto.so.1.1
67
80-
81 if (add ==
add == ((void *)0)Description
TRUEevaluated 3382 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 14 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
14-3382
82 ((void *)0)
add == ((void *)0)Description
TRUEevaluated 3382 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 14 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
14-3382
83 ) {-
84 if (!probable_prime(ret, bits, mods)
!probable_prim...t, bits, mods)Description
TRUEnever evaluated
FALSEevaluated 3382 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-3382
85 goto
never executed: goto err;
err;
never executed: goto err;
0
86 }
executed 3382 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
3382
87 if (safe
safeDescription
TRUEevaluated 14 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-14
88 if (!probable_prime_dh_safe(ret, bits, add, rem, ctx)
!probable_prim...add, rem, ctx)Description
TRUEnever evaluated
FALSEevaluated 14 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-14
89 goto
never executed: goto err;
err;
never executed: goto err;
0
90 }
executed 14 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
14
91 if (!bn_probable_prime_dh(ret, bits, add, rem, ctx)
!bn_probable_p...add, rem, ctx)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
92 goto
never executed: goto err;
err;
never executed: goto err;
0
93 }
never executed: end of block
0
94 }-
95-
96 if (!BN_GENCB_call(cb, 0, c1++)
!BN_GENCB_call(cb, 0, c1++)Description
TRUEnever evaluated
FALSEevaluated 3396 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-3396
97-
98 goto
never executed: goto err;
err;
never executed: goto err;
0
99-
100 if (!safe
!safeDescription
TRUEevaluated 3382 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 14 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
14-3382
101 i = BN_is_prime_fasttest_ex(ret, checks, ctx, 0, cb);-
102 if (i == -1
i == -1Description
TRUEnever evaluated
FALSEevaluated 3382 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-3382
103 goto
never executed: goto err;
err;
never executed: goto err;
0
104 if (i == 0
i == 0Description
TRUEevaluated 3316 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 66 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
66-3316
105 goto
executed 3316 times by 1 test: goto loop;
Executed by:
  • libcrypto.so.1.1
loop;
executed 3316 times by 1 test: goto loop;
Executed by:
  • libcrypto.so.1.1
3316
106 }
executed 66 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
66
107-
108-
109-
110-
111 if (!BN_rshift1(t, ret)
!BN_rshift1(t, ret)Description
TRUEnever evaluated
FALSEevaluated 14 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-14
112 goto
never executed: goto err;
err;
never executed: goto err;
0
113-
114 for (i = 0; i < checks
i < checksDescription
TRUEevaluated 40 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++) {
1-40
115 j = BN_is_prime_fasttest_ex(ret, 1, ctx, 0, cb);-
116 if (j == -1
j == -1Description
TRUEnever evaluated
FALSEevaluated 40 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-40
117 goto
never executed: goto err;
err;
never executed: goto err;
0
118 if (j == 0
j == 0Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 31 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
9-31
119 goto
executed 9 times by 1 test: goto loop;
Executed by:
  • libcrypto.so.1.1
loop;
executed 9 times by 1 test: goto loop;
Executed by:
  • libcrypto.so.1.1
9
120-
121 j = BN_is_prime_fasttest_ex(t, 1, ctx, 0, cb);-
122 if (j == -1
j == -1Description
TRUEnever evaluated
FALSEevaluated 31 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-31
123 goto
never executed: goto err;
err;
never executed: goto err;
0
124 if (j == 0
j == 0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 27 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
4-27
125 goto
executed 4 times by 1 test: goto loop;
Executed by:
  • libcrypto.so.1.1
loop;
executed 4 times by 1 test: goto loop;
Executed by:
  • libcrypto.so.1.1
4
126-
127 if (!BN_GENCB_call(cb, 2, c1 - 1)
!BN_GENCB_call(cb, 2, c1 - 1)Description
TRUEnever evaluated
FALSEevaluated 27 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-27
128 goto
never executed: goto err;
err;
never executed: goto err;
0
129-
130 }
executed 27 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
27
131 }
executed 1 time by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
1
132-
133 found = 1;-
134 err:
code before this statement executed 67 times by 1 test: err:
Executed by:
  • libcrypto.so.1.1
67
135 CRYPTO_free(mods, __FILE__, 137);-
136 if (ctx !=
ctx != ((void *)0)Description
TRUEevaluated 67 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-67
137 ((void *)0)
ctx != ((void *)0)Description
TRUEevaluated 67 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-67
138 )-
139 BN_CTX_end(ctx);
executed 67 times by 1 test: BN_CTX_end(ctx);
Executed by:
  • libcrypto.so.1.1
67
140 BN_CTX_free(ctx);-
141 ;-
142 return
executed 67 times by 1 test: return found;
Executed by:
  • libcrypto.so.1.1
found;
executed 67 times by 1 test: return found;
Executed by:
  • libcrypto.so.1.1
67
143}-
144-
145int BN_is_prime_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed,-
146 BN_GENCB *cb)-
147{-
148 return
executed 45 times by 1 test: return BN_is_prime_fasttest_ex(a, checks, ctx_passed, 0, cb);
Executed by:
  • libcrypto.so.1.1
BN_is_prime_fasttest_ex(a, checks, ctx_passed, 0, cb);
executed 45 times by 1 test: return BN_is_prime_fasttest_ex(a, checks, ctx_passed, 0, cb);
Executed by:
  • libcrypto.so.1.1
45
149}-
150-
151int BN_is_prime_fasttest_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed,-
152 int do_trial_division, BN_GENCB *cb)-
153{-
154 int i, j, ret = -1;-
155 int k;-
156 BN_CTX *ctx = -
157 ((void *)0)-
158 ;-
159 BIGNUM *A1, *A1_odd, *A3, *check;-
160 BN_MONT_CTX *mont = -
161 ((void *)0)-
162 ;-
163-
164-
165 if (BN_is_word(a, 2)
BN_is_word(a, 2)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3621 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| BN_is_word(a, 3)
BN_is_word(a, 3)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3619 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
2-3621
166 return
executed 4 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 4 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
4
167-
168-
169 if (!BN_is_odd(a)
!BN_is_odd(a)Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3613 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| BN_cmp(a, BN_value_one()) <= 0
BN_cmp(a, BN_value_one()) <= 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3611 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
2-3613
170 return
executed 8 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 8 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
8
171-
172 if (checks == 0
checks == 0Description
TRUEevaluated 44 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3567 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
44-3567
173 checks = ((
(BN_num_bits(a)) >= 3747Description
TRUEnever evaluated
FALSEevaluated 44 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
BN_num_bits(a)) >= 3747
(BN_num_bits(a)) >= 3747Description
TRUEnever evaluated
FALSEevaluated 44 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
? 3 : (
(BN_num_bits(a)) >= 1345Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 34 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
BN_num_bits(a)) >= 1345
(BN_num_bits(a)) >= 1345Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 34 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
? 4 : (
(BN_num_bits(a)) >= 476Description
TRUEevaluated 21 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 13 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
BN_num_bits(a)) >= 476
(BN_num_bits(a)) >= 476Description
TRUEevaluated 21 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 13 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
? 5 : (
(BN_num_bits(a)) >= 400Description
TRUEnever evaluated
FALSEevaluated 13 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
BN_num_bits(a)) >= 400
(BN_num_bits(a)) >= 400Description
TRUEnever evaluated
FALSEevaluated 13 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
? 6 : (
(BN_num_bits(a)) >= 347Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
BN_num_bits(a)) >= 347
(BN_num_bits(a)) >= 347Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
? 7 : (
(BN_num_bits(a)) >= 308Description
TRUEnever evaluated
FALSEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
BN_num_bits(a)) >= 308
(BN_num_bits(a)) >= 308Description
TRUEnever evaluated
FALSEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
? 8 : (
(BN_num_bits(a)) >= 55Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
BN_num_bits(a)) >= 55
(BN_num_bits(a)) >= 55Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
? 27 : 34);
executed 44 times by 1 test: checks = ((BN_num_bits(a)) >= 3747 ? 3 : (BN_num_bits(a)) >= 1345 ? 4 : (BN_num_bits(a)) >= 476 ? 5 : (BN_num_bits(a)) >= 400 ? 6 : (BN_num_bits(a)) >= 347 ? 7 : (BN_num_bits(a)) >= 308 ? 8 : (BN_num_bits(a)) >= 55 ? 27 : 34);
Executed by:
  • libcrypto.so.1.1
0-44
174-
175-
176 if (do_trial_division
do_trial_divisionDescription
TRUEevaluated 110 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3501 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
110-3501
177 for (i = 1; i < 2048
i < 2048Description
TRUEevaluated 22032 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++) {
8-22032
178 unsigned long mod = BN_mod_word(a, primes[i]);-
179 if (mod == (unsigned long)-1
mod == (unsigned long)-1Description
TRUEnever evaluated
FALSEevaluated 22032 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-22032
180 goto
never executed: goto err;
err;
never executed: goto err;
0
181 if (mod == 0
mod == 0Description
TRUEevaluated 102 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 21930 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
102-21930
182 return
executed 102 times by 1 test: return BN_is_word(a, primes[i]);
Executed by:
  • libcrypto.so.1.1
BN_is_word(a, primes[i]);
executed 102 times by 1 test: return BN_is_word(a, primes[i]);
Executed by:
  • libcrypto.so.1.1
102
183 }
executed 21930 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
21930
184 if (!BN_GENCB_call(cb, 1, -1)
!BN_GENCB_call(cb, 1, -1)Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-8
185 goto
never executed: goto err;
err;
never executed: goto err;
0
186 }
executed 8 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
8
187-
188 if (ctx_passed !=
ctx_passed != ((void *)0)Description
TRUEevaluated 3473 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 36 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
36-3473
189 ((void *)0)
ctx_passed != ((void *)0)Description
TRUEevaluated 3473 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 36 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
36-3473
190 )-
191 ctx = ctx_passed;
executed 3473 times by 1 test: ctx = ctx_passed;
Executed by:
  • libcrypto.so.1.1
3473
192 else if ((
(ctx = BN_CTX_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 36 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
ctx = BN_CTX_new()) ==
(ctx = BN_CTX_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 36 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-36
193 ((void *)0)
(ctx = BN_CTX_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 36 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-36
194 )-
195 goto
never executed: goto err;
err;
never executed: goto err;
0
196 BN_CTX_start(ctx);-
197-
198 A1 = BN_CTX_get(ctx);-
199 A3 = BN_CTX_get(ctx);-
200 A1_odd = BN_CTX_get(ctx);-
201 check = BN_CTX_get(ctx);-
202 if (check ==
check == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 3509 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-3509
203 ((void *)0)
check == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 3509 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-3509
204 )-
205 goto
never executed: goto err;
err;
never executed: goto err;
0
206-
207-
208 if (!BN_copy(A1, a)
!BN_copy(A1, a)Description
TRUEnever evaluated
FALSEevaluated 3509 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| !BN_sub_word(A1, 1)
!BN_sub_word(A1, 1)Description
TRUEnever evaluated
FALSEevaluated 3509 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-3509
209 goto
never executed: goto err;
err;
never executed: goto err;
0
210-
211 if (!BN_copy(A3, a)
!BN_copy(A3, a)Description
TRUEnever evaluated
FALSEevaluated 3509 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| !BN_sub_word(A3, 3)
!BN_sub_word(A3, 3)Description
TRUEnever evaluated
FALSEevaluated 3509 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-3509
212 goto
never executed: goto err;
err;
never executed: goto err;
0
213-
214-
215 k = 1;-
216 while (!BN_is_bit_set(A1, k)
!BN_is_bit_set(A1, k)Description
TRUEevaluated 3591 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3509 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
3509-3591
217 k++;
executed 3591 times by 1 test: k++;
Executed by:
  • libcrypto.so.1.1
3591
218 if (!BN_rshift(A1_odd, A1, k)
!BN_rshift(A1_odd, A1, k)Description
TRUEnever evaluated
FALSEevaluated 3509 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-3509
219 goto
never executed: goto err;
err;
never executed: goto err;
0
220-
221-
222 mont = BN_MONT_CTX_new();-
223 if (mont ==
mont == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 3509 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-3509
224 ((void *)0)
mont == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 3509 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-3509
225 )-
226 goto
never executed: goto err;
err;
never executed: goto err;
0
227 if (!BN_MONT_CTX_set(mont, a, ctx)
!BN_MONT_CTX_set(mont, a, ctx)Description
TRUEnever evaluated
FALSEevaluated 3509 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-3509
228 goto
never executed: goto err;
err;
never executed: goto err;
0
229-
230 for (i = 0; i < checks
i < checksDescription
TRUEevaluated 4472 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 173 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++) {
173-4472
231-
232 if (!BN_priv_rand_range(check, A3)
!BN_priv_rand_range(check, A3)Description
TRUEnever evaluated
FALSEevaluated 4472 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| !BN_add_word(check, 2)
!BN_add_word(check, 2)Description
TRUEnever evaluated
FALSEevaluated 4472 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-4472
233 goto
never executed: goto err;
err;
never executed: goto err;
0
234-
235 j = witness(check, a, A1, A1_odd, k, ctx, mont);-
236 if (j == -1
j == -1Description
TRUEnever evaluated
FALSEevaluated 4472 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-4472
237 goto
never executed: goto err;
err;
never executed: goto err;
0
238 if (j
jDescription
TRUEevaluated 3336 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1136 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
1136-3336
239 ret = 0;-
240 goto
executed 3336 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 3336 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
3336
241 }-
242 if (!BN_GENCB_call(cb, 1, i)
!BN_GENCB_call(cb, 1, i)Description
TRUEnever evaluated
FALSEevaluated 1136 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1136
243 goto
never executed: goto err;
err;
never executed: goto err;
0
244 }
executed 1136 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
1136
245 ret = 1;-
246 err:
code before this statement executed 173 times by 1 test: err:
Executed by:
  • libcrypto.so.1.1
173
247 if (ctx !=
ctx != ((void *)0)Description
TRUEevaluated 3509 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-3509
248 ((void *)0)
ctx != ((void *)0)Description
TRUEevaluated 3509 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-3509
249 ) {-
250 BN_CTX_end(ctx);-
251 if (ctx_passed ==
ctx_passed == ((void *)0)Description
TRUEevaluated 36 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3473 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
36-3473
252 ((void *)0)
ctx_passed == ((void *)0)Description
TRUEevaluated 36 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3473 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
36-3473
253 )-
254 BN_CTX_free(ctx);
executed 36 times by 1 test: BN_CTX_free(ctx);
Executed by:
  • libcrypto.so.1.1
36
255 }
executed 3509 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
3509
256 BN_MONT_CTX_free(mont);-
257-
258 return
executed 3509 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 3509 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
3509
259}-
260-
261static int witness(BIGNUM *w, const BIGNUM *a, const BIGNUM *a1,-
262 const BIGNUM *a1_odd, int k, BN_CTX *ctx,-
263 BN_MONT_CTX *mont)-
264{-
265 if (!BN_mod_exp_mont(w, w, a1_odd, a, ctx, mont)
!BN_mod_exp_mo... a, ctx, mont)Description
TRUEnever evaluated
FALSEevaluated 4472 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-4472
266 return
never executed: return -1;
-1;
never executed: return -1;
0
267 if (BN_is_one(w)
BN_is_one(w)Description
TRUEevaluated 401 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4071 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
401-4071
268 return
executed 401 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 401 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
401
269 if (BN_cmp(w, a1) == 0
BN_cmp(w, a1) == 0Description
TRUEevaluated 379 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3692 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
379-3692
270 return
executed 379 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 379 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
379
271 while (--
--kDescription
TRUEevaluated 6484 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3336 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
k
--kDescription
TRUEevaluated 6484 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3336 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
3336-6484
272 if (!BN_mod_mul(w, w, w, a, ctx)
!BN_mod_mul(w, w, w, a, ctx)Description
TRUEnever evaluated
FALSEevaluated 6484 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-6484
273 return
never executed: return -1;
-1;
never executed: return -1;
0
274 if (BN_is_one(w)
BN_is_one(w)Description
TRUEnever evaluated
FALSEevaluated 6484 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-6484
275 return
never executed: return 1;
1;
never executed: return 1;
0
276-
277 if (BN_cmp(w, a1) == 0
BN_cmp(w, a1) == 0Description
TRUEevaluated 356 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 6128 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
356-6128
278 return
executed 356 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 356 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
356
279 }
executed 6128 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
6128
280-
281-
282-
283-
284 ;-
285 return
executed 3336 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 3336 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
3336
286}-
287-
288static int probable_prime(BIGNUM *rnd, int bits, prime_t *mods)-
289{-
290 int i;-
291 unsigned long delta;-
292 unsigned long maxdelta = (0xffffffffffffffffL) - primes[2048 - 1];-
293 char is_single_word = bits <= (8 * 8);-
294-
295 again:
code before this statement executed 3382 times by 1 test: again:
Executed by:
  • libcrypto.so.1.1
3382
296-
297 if (!BN_priv_rand(rnd, bits, 1, 1)
!BN_priv_rand(rnd, bits, 1, 1)Description
TRUEnever evaluated
FALSEevaluated 3382 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-3382
298 return
never executed: return 0;
0;
never executed: return 0;
0
299-
300 for (i = 1; i < 2048
i < 2048Description
TRUEevaluated 6922954 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3382 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++) {
3382-6922954
301 unsigned long mod = BN_mod_word(rnd, (unsigned long)primes[i]);-
302 if (mod == (unsigned long)-1
mod == (unsigned long)-1Description
TRUEnever evaluated
FALSEevaluated 6922954 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-6922954
303 return
never executed: return 0;
0;
never executed: return 0;
0
304 mods[i] = (prime_t) mod;-
305 }
executed 6922954 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
6922954
306-
307-
308-
309-
310 if (is_single_word
is_single_wordDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3381 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
1-3381
311 unsigned long size_limit;-
312-
313 if (bits == (8 * 8)
bits == (8 * 8)Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-1
314-
315-
316-
317-
318 size_limit = ~((unsigned long)0) - BN_get_word(rnd);-
319 }
never executed: end of block
else {
0
320 size_limit = (((unsigned long)1) << bits) - BN_get_word(rnd) - 1;-
321 }
executed 1 time by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
1
322 if (size_limit < maxdelta
size_limit < maxdeltaDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
)
0-1
323 maxdelta = size_limit;
executed 1 time by 1 test: maxdelta = size_limit;
Executed by:
  • libcrypto.so.1.1
1
324 }
executed 1 time by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
1
325 delta = 0;-
326 loop:
code before this statement executed 3382 times by 1 test: loop:
Executed by:
  • libcrypto.so.1.1
3382
327 if (is_single_word
is_single_wordDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 370074 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
4-370074
328 unsigned long rnd_word = BN_get_word(rnd);-
329 for (i = 1; i < 2048
i < 2048Description
TRUEevaluated 175 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
&& primes[i] < rnd_word
primes[i] < rnd_wordDescription
TRUEevaluated 174 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++) {
0-175
330 if ((
(mods[i] + del...primes[i] == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 171 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
mods[i] + delta) % primes[i] == 0
(mods[i] + del...primes[i] == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 171 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
3-171
331 delta += 2;-
332 if (delta > maxdelta
delta > maxdeltaDescription
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-3
333 goto
never executed: goto again;
again;
never executed: goto again;
0
334 goto
executed 3 times by 1 test: goto loop;
Executed by:
  • libcrypto.so.1.1
loop;
executed 3 times by 1 test: goto loop;
Executed by:
  • libcrypto.so.1.1
3
335 }-
336 }
executed 171 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
171
337 }
executed 1 time by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
1
338 for (i = 1; i < 2048
i < 2048Description
TRUEevaluated 10173323 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3381 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++) {
3381-10173323
339-
340-
341-
342-
343 if (((
((mods[i] + de...rimes[i]) <= 1Description
TRUEevaluated 366693 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 9806630 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
mods[i] + delta) % primes[i]) <= 1
((mods[i] + de...rimes[i]) <= 1Description
TRUEevaluated 366693 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 9806630 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
366693-9806630
344 delta += 2;-
345 if (delta > maxdelta
delta > maxdeltaDescription
TRUEnever evaluated
FALSEevaluated 366693 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-366693
346 goto
never executed: goto again;
again;
never executed: goto again;
0
347 goto
executed 366693 times by 1 test: goto loop;
Executed by:
  • libcrypto.so.1.1
loop;
executed 366693 times by 1 test: goto loop;
Executed by:
  • libcrypto.so.1.1
366693
348 }-
349 }
executed 9806630 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
9806630
350 }
executed 3381 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
3381
351 if (!BN_add_word(rnd, delta)
!BN_add_word(rnd, delta)Description
TRUEnever evaluated
FALSEevaluated 3382 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-3382
352 return
never executed: return 0;
0;
never executed: return 0;
0
353 if (BN_num_bits(rnd) != bits
BN_num_bits(rnd) != bitsDescription
TRUEnever evaluated
FALSEevaluated 3382 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-3382
354 goto
never executed: goto again;
again;
never executed: goto again;
0
355 ;-
356 return
executed 3382 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 3382 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
3382
357}-
358-
359int bn_probable_prime_dh(BIGNUM *rnd, int bits,-
360 const BIGNUM *add, const BIGNUM *rem, BN_CTX *ctx)-
361{-
362 int i, ret = 0;-
363 BIGNUM *t1;-
364-
365 BN_CTX_start(ctx);-
366 if ((
(t1 = BN_CTX_g...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
t1 = BN_CTX_get(ctx)) ==
(t1 = BN_CTX_g...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
367 ((void *)0)
(t1 = BN_CTX_g...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
368 )-
369 goto
never executed: goto err;
err;
never executed: goto err;
0
370-
371 if (!BN_rand(rnd, bits, 0, 1)
!BN_rand(rnd, bits, 0, 1)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
372 goto
never executed: goto err;
err;
never executed: goto err;
0
373-
374-
375-
376 if (!BN_div(
!BN_div( ((voi...),(add),(ctx))Description
TRUEnever evaluated
FALSEnever evaluated
0
377 ((void *)0)
!BN_div( ((voi...),(add),(ctx))Description
TRUEnever evaluated
FALSEnever evaluated
0
378 ,(t1),(rnd),(add),(ctx))
!BN_div( ((voi...),(add),(ctx))Description
TRUEnever evaluated
FALSEnever evaluated
)
0
379 goto
never executed: goto err;
err;
never executed: goto err;
0
380 if (!BN_sub(rnd, rnd, t1)
!BN_sub(rnd, rnd, t1)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
381 goto
never executed: goto err;
err;
never executed: goto err;
0
382 if (rem ==
rem == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
383 ((void *)0)
rem == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
384 ) {-
385 if (!BN_add_word(rnd, 1)
!BN_add_word(rnd, 1)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
386 goto
never executed: goto err;
err;
never executed: goto err;
0
387 }
never executed: end of block
else {
0
388 if (!BN_add(rnd, rnd, rem)
!BN_add(rnd, rnd, rem)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
389 goto
never executed: goto err;
err;
never executed: goto err;
0
390 }
never executed: end of block
0
391-
392-
393-
394 loop:
code before this statement never executed: loop:
0
395 for (i = 1; i < 2048
i < 2048Description
TRUEnever evaluated
FALSEnever evaluated
; i++) {
0
396-
397 unsigned long mod = BN_mod_word(rnd, (unsigned long)primes[i]);-
398 if (mod == (unsigned long)-1
mod == (unsigned long)-1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
399 goto
never executed: goto err;
err;
never executed: goto err;
0
400 if (mod <= 1
mod <= 1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
401 if (!BN_add(rnd, rnd, add)
!BN_add(rnd, rnd, add)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
402 goto
never executed: goto err;
err;
never executed: goto err;
0
403 goto
never executed: goto loop;
loop;
never executed: goto loop;
0
404 }-
405 }
never executed: end of block
0
406 ret = 1;-
407-
408 err:
code before this statement never executed: err:
0
409 BN_CTX_end(ctx);-
410 ;-
411 return
never executed: return ret;
ret;
never executed: return ret;
0
412}-
413-
414static int probable_prime_dh_safe(BIGNUM *p, int bits, const BIGNUM *padd,-
415 const BIGNUM *rem, BN_CTX *ctx)-
416{-
417 int i, ret = 0;-
418 BIGNUM *t1, *qadd, *q;-
419-
420 bits--;-
421 BN_CTX_start(ctx);-
422 t1 = BN_CTX_get(ctx);-
423 q = BN_CTX_get(ctx);-
424 qadd = BN_CTX_get(ctx);-
425 if (qadd ==
qadd == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 14 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-14
426 ((void *)0)
qadd == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 14 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-14
427 )-
428 goto
never executed: goto err;
err;
never executed: goto err;
0
429-
430 if (!BN_rshift1(qadd, padd)
!BN_rshift1(qadd, padd)Description
TRUEnever evaluated
FALSEevaluated 14 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-14
431 goto
never executed: goto err;
err;
never executed: goto err;
0
432-
433 if (!BN_rand(q, bits, 0, 1)
!BN_rand(q, bits, 0, 1)Description
TRUEnever evaluated
FALSEevaluated 14 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-14
434 goto
never executed: goto err;
err;
never executed: goto err;
0
435-
436-
437 if (!BN_div(
!BN_div( ((voi...,(qadd),(ctx))Description
TRUEnever evaluated
FALSEevaluated 14 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-14
438 ((void *)0)
!BN_div( ((voi...,(qadd),(ctx))Description
TRUEnever evaluated
FALSEevaluated 14 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-14
439 ,(t1),(q),(qadd),(ctx))
!BN_div( ((voi...,(qadd),(ctx))Description
TRUEnever evaluated
FALSEevaluated 14 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-14
440 goto
never executed: goto err;
err;
never executed: goto err;
0
441 if (!BN_sub(q, q, t1)
!BN_sub(q, q, t1)Description
TRUEnever evaluated
FALSEevaluated 14 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-14
442 goto
never executed: goto err;
err;
never executed: goto err;
0
443 if (rem ==
rem == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 14 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-14
444 ((void *)0)
rem == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 14 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-14
445 ) {-
446 if (!BN_add_word(q, 1)
!BN_add_word(q, 1)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
447 goto
never executed: goto err;
err;
never executed: goto err;
0
448 }
never executed: end of block
else {
0
449 if (!BN_rshift1(t1, rem)
!BN_rshift1(t1, rem)Description
TRUEnever evaluated
FALSEevaluated 14 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-14
450 goto
never executed: goto err;
err;
never executed: goto err;
0
451 if (!BN_add(q, q, t1)
!BN_add(q, q, t1)Description
TRUEnever evaluated
FALSEevaluated 14 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-14
452 goto
never executed: goto err;
err;
never executed: goto err;
0
453 }
executed 14 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
14
454-
455-
456 if (!BN_lshift1(p, q)
!BN_lshift1(p, q)Description
TRUEnever evaluated
FALSEevaluated 14 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-14
457 goto
never executed: goto err;
err;
never executed: goto err;
0
458 if (!BN_add_word(p, 1)
!BN_add_word(p, 1)Description
TRUEnever evaluated
FALSEevaluated 14 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-14
459 goto
never executed: goto err;
err;
never executed: goto err;
0
460-
461 loop:
code before this statement executed 14 times by 1 test: loop:
Executed by:
  • libcrypto.so.1.1
14
462 for (i = 1; i < 2048
i < 2048Description
TRUEevaluated 38758 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 14 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++) {
14-38758
463-
464-
465-
466-
467 unsigned long pmod = BN_mod_word(p, (unsigned long)primes[i]);-
468 unsigned long qmod = BN_mod_word(q, (unsigned long)primes[i]);-
469 if (pmod == (unsigned long)-1
pmod == (unsigned long)-1Description
TRUEnever evaluated
FALSEevaluated 38758 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| qmod == (unsigned long)-1
qmod == (unsigned long)-1Description
TRUEnever evaluated
FALSEevaluated 38758 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-38758
470 goto
never executed: goto err;
err;
never executed: goto err;
0
471 if (pmod == 0
pmod == 0Description
TRUEevaluated 471 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 38287 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| qmod == 0
qmod == 0Description
TRUEevaluated 494 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 37793 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
471-38287
472 if (!BN_add(p, p, padd)
!BN_add(p, p, padd)Description
TRUEnever evaluated
FALSEevaluated 965 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-965
473 goto
never executed: goto err;
err;
never executed: goto err;
0
474 if (!BN_add(q, q, qadd)
!BN_add(q, q, qadd)Description
TRUEnever evaluated
FALSEevaluated 965 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-965
475 goto
never executed: goto err;
err;
never executed: goto err;
0
476 goto
executed 965 times by 1 test: goto loop;
Executed by:
  • libcrypto.so.1.1
loop;
executed 965 times by 1 test: goto loop;
Executed by:
  • libcrypto.so.1.1
965
477 }-
478 }
executed 37793 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
37793
479 ret = 1;-
480-
481 err:
code before this statement executed 14 times by 1 test: err:
Executed by:
  • libcrypto.so.1.1
14
482 BN_CTX_end(ctx);-
483 ;-
484 return
executed 14 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 14 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
14
485}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2