OpenCoverage

bn_exp.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/bn/bn_exp.c
Switch to Source codePreprocessed file
LineSourceCount
1int BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)-
2{-
3 int i, bits, ret = 0;-
4 BIGNUM *v, *rr;-
5-
6 if (BN_get_flags(p, 0x04) != 0
BN_get_flags(p, 0x04) != 0Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-5
7 || BN_get_flags(a, 0x04) != 0
BN_get_flags(a, 0x04) != 0Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-5
8-
9 ERR_put_error(3,(123),((2|64)),__FILE__,49);-
10 return
never executed: return 0;
0;
never executed: return 0;
0
11 }-
12-
13 BN_CTX_start(ctx);-
14 rr = ((
(r == a)Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
r == a)
(r == a)Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| (
(r == p)Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
r == p)
(r == p)Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) ? BN_CTX_get(ctx) : r;
0-5
15 v = BN_CTX_get(ctx);-
16 if (rr ==
rr == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-5
17 ((void *)0)
rr == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-5
18 || v ==
v == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-5
19 ((void *)0)
v == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-5
20 )-
21 goto
never executed: goto err;
err;
never executed: goto err;
0
22-
23 if (BN_copy(v, a) ==
BN_copy(v, a) == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-5
24 ((void *)0)
BN_copy(v, a) == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-5
25 )-
26 goto
never executed: goto err;
err;
never executed: goto err;
0
27 bits = BN_num_bits(p);-
28-
29 if (BN_is_odd(p)
BN_is_odd(p)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
2-3
30 if (BN_copy(rr, a) ==
BN_copy(rr, a) == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-2
31 ((void *)0)
BN_copy(rr, a) == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-2
32 )-
33 goto
never executed: goto err;
err;
never executed: goto err;
0
34 }
executed 2 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
2
35 if (!(BN_set_word((rr),1))
!(BN_set_word((rr),1))Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-3
36 goto
never executed: goto err;
err;
never executed: goto err;
0
37 }
executed 3 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
3
38-
39 for (i = 1; i < bits
i < bitsDescription
TRUEevaluated 15 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++) {
5-15
40 if (!BN_sqr(v, v, ctx)
!BN_sqr(v, v, ctx)Description
TRUEnever evaluated
FALSEevaluated 15 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-15
41 goto
never executed: goto err;
err;
never executed: goto err;
0
42 if (BN_is_bit_set(p, i)
BN_is_bit_set(p, i)Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
5-10
43 if (!BN_mul(rr, rr, v, ctx)
!BN_mul(rr, rr, v, ctx)Description
TRUEnever evaluated
FALSEevaluated 10 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-10
44 goto
never executed: goto err;
err;
never executed: goto err;
0
45 }
executed 10 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
10
46 }
executed 15 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
15
47 if (r != rr
r != rrDescription
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& BN_copy(r, rr) ==
BN_copy(r, rr) == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0-5
48 ((void *)0)
BN_copy(r, rr) == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
49 )-
50 goto
never executed: goto err;
err;
never executed: goto err;
0
51-
52 ret = 1;-
53 err:
code before this statement executed 5 times by 1 test: err:
Executed by:
  • libcrypto.so.1.1
5
54 BN_CTX_end(ctx);-
55 ;-
56 return
executed 5 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 5 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
5
57}-
58-
59int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m,-
60 BN_CTX *ctx)-
61{-
62 int ret;-
63-
64 ;-
65 ;-
66 ;-
67 if (BN_is_odd(m)
BN_is_odd(m)Description
TRUEevaluated 8967 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 279 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
279-8967
68-
69 if (a->top == 1
a->top == 1Description
TRUEevaluated 2817 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 6150 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& !a->neg
!a->negDescription
TRUEevaluated 2725 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 92 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
92-6150
70 && (
(BN_get_flags(p, 0x04) == 0)Description
TRUEevaluated 2725 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
BN_get_flags(p, 0x04) == 0)
(BN_get_flags(p, 0x04) == 0)Description
TRUEevaluated 2725 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-2725
71 && (
(BN_get_flags(a, 0x04) == 0)Description
TRUEevaluated 2725 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
BN_get_flags(a, 0x04) == 0)
(BN_get_flags(a, 0x04) == 0)Description
TRUEevaluated 2725 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-2725
72 && (
(BN_get_flags(m, 0x04) == 0)Description
TRUEevaluated 2725 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
BN_get_flags(m, 0x04) == 0)
(BN_get_flags(m, 0x04) == 0)Description
TRUEevaluated 2725 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-2725
73 unsigned long A = a->d[0];-
74 ret = BN_mod_exp_mont_word(r, A, p, m, ctx, -
75 ((void *)0)-
76 );-
77 }
executed 2725 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else
2725
78-
79 ret = BN_mod_exp_mont(r, a, p, m, ctx,
executed 6242 times by 1 test: ret = BN_mod_exp_mont(r, a, p, m, ctx, ((void *)0) );
Executed by:
  • libcrypto.so.1.1
6242
80 ((void *)0)
executed 6242 times by 1 test: ret = BN_mod_exp_mont(r, a, p, m, ctx, ((void *)0) );
Executed by:
  • libcrypto.so.1.1
6242
81 );
executed 6242 times by 1 test: ret = BN_mod_exp_mont(r, a, p, m, ctx, ((void *)0) );
Executed by:
  • libcrypto.so.1.1
6242
82 } else-
83-
84-
85 {-
86 ret = BN_mod_exp_recp(r, a, p, m, ctx);-
87 }
executed 279 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
279
88-
89-
90-
91-
92-
93-
94 ;-
95 return
executed 9246 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 9246 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
9246
96}-
97-
98int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,-
99 const BIGNUM *m, BN_CTX *ctx)-
100{-
101 int i, j, bits, ret = 0, wstart, wend, window, wvalue;-
102 int start = 1;-
103 BIGNUM *aa;-
104-
105 BIGNUM *val[32];-
106 BN_RECP_CTX recp;-
107-
108 if (BN_get_flags(p, 0x04) != 0
BN_get_flags(p, 0x04) != 0Description
TRUEnever evaluated
FALSEevaluated 582 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-582
109 || BN_get_flags(a, 0x04) != 0
BN_get_flags(a, 0x04) != 0Description
TRUEnever evaluated
FALSEevaluated 582 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-582
110 || BN_get_flags(m, 0x04) != 0
BN_get_flags(m, 0x04) != 0Description
TRUEnever evaluated
FALSEevaluated 582 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-582
111-
112 ERR_put_error(3,(125),((2|64)),__FILE__,175);-
113 return
never executed: return 0;
0;
never executed: return 0;
0
114 }-
115-
116 bits = BN_num_bits(p);-
117 if (bits == 0
bits == 0Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 577 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
5-577
118-
119 if (BN_abs_is_word(m, 1)
BN_abs_is_word(m, 1)Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
2-3
120 ret = 1;-
121 (BN_set_word((r),0));-
122 }
executed 3 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
3
123 ret = (BN_set_word((r),1));-
124 }
executed 2 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
2
125 return
executed 5 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 5 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
5
126 }-
127-
128 BN_CTX_start(ctx);-
129 aa = BN_CTX_get(ctx);-
130 val[0] = BN_CTX_get(ctx);-
131 if (val[0] ==
val[0] == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 577 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-577
132 ((void *)0)
val[0] == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 577 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-577
133 )-
134 goto
never executed: goto err;
err;
never executed: goto err;
0
135-
136 BN_RECP_CTX_init(&recp);-
137 if (m->neg
m->negDescription
TRUEevaluated 92 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 485 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
92-485
138-
139 if (!BN_copy(aa, m)
!BN_copy(aa, m)Description
TRUEnever evaluated
FALSEevaluated 92 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-92
140 goto
never executed: goto err;
err;
never executed: goto err;
0
141 aa->neg = 0;-
142 if (BN_RECP_CTX_set(&recp, aa, ctx) <= 0
BN_RECP_CTX_se... aa, ctx) <= 0Description
TRUEnever evaluated
FALSEevaluated 92 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-92
143 goto
never executed: goto err;
err;
never executed: goto err;
0
144 }
executed 92 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
92
145 if (BN_RECP_CTX_set(&recp, m, ctx) <= 0
BN_RECP_CTX_se..., m, ctx) <= 0Description
TRUEnever evaluated
FALSEevaluated 485 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-485
146 goto
never executed: goto err;
err;
never executed: goto err;
0
147 }
executed 485 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
485
148-
149 if (!BN_nnmod(val[0], a, m, ctx)
!BN_nnmod(val[0], a, m, ctx)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 576 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
1-576
150 goto
executed 1 time by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 1 time by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
1
151 if (BN_is_zero(val[0])
BN_is_zero(val[0])Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 572 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
4-572
152 (BN_set_word((r),0));-
153 ret = 1;-
154 goto
executed 4 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 4 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
4
155 }-
156-
157 window = ((
(bits) > 671Description
TRUEevaluated 13 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 559 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
bits) > 671
(bits) > 671Description
TRUEevaluated 13 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 559 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
? 6 : (
(bits) > 239Description
TRUEevaluated 305 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 254 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
bits) > 239
(bits) > 239Description
TRUEevaluated 305 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 254 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
? 5 : (
(bits) > 79Description
TRUEevaluated 45 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
bits) > 79
(bits) > 79Description
TRUEevaluated 45 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
? 4 : (
(bits) > 23Description
TRUEevaluated 43 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 166 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
bits) > 23
(bits) > 23Description
TRUEevaluated 43 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 166 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
? 3 : 1);
13-559
158 if (window > 1
window > 1Description
TRUEevaluated 406 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 166 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
166-406
159 if (!BN_mod_mul_reciprocal(aa, val[0], val[0], &recp, ctx)
!BN_mod_mul_re...], &recp, ctx)Description
TRUEnever evaluated
FALSEevaluated 406 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-406
160 goto
never executed: goto err;
err;
never executed: goto err;
0
161 j = 1 << (window - 1);-
162 for (i = 1; i < j
i < jDescription
TRUEevaluated 5422 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 406 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++) {
406-5422
163 if (((
((val[i] = BN_... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 5422 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
val[i] = BN_CTX_get(ctx)) ==
((val[i] = BN_... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 5422 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-5422
164 ((void *)0)
((val[i] = BN_... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 5422 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-5422
165 )
((val[i] = BN_... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 5422 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
||
0-5422
166 !BN_mod_mul_reciprocal(val[i], val[i - 1], aa, &recp, ctx)
!BN_mod_mul_re...a, &recp, ctx)Description
TRUEnever evaluated
FALSEevaluated 5422 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-5422
167 goto
never executed: goto err;
err;
never executed: goto err;
0
168 }
executed 5422 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
5422
169 }
executed 406 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
406
170-
171 start = 1;-
172-
173-
174 wvalue = 0;-
175 wstart = bits - 1;-
176 wend = 0;-
177-
178 if (!(BN_set_word((r),1))
!(BN_set_word((r),1))Description
TRUEnever evaluated
FALSEevaluated 572 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-572
179 goto
never executed: goto err;
err;
never executed: goto err;
0
180-
181 for (;;) {-
182 if (BN_is_bit_set(p, wstart) == 0
BN_is_bit_set(p, wstart) == 0Description
TRUEevaluated 51529 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 23919 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
23919-51529
183 if (!start
!startDescription
TRUEevaluated 51529 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
)
0-51529
184 if (!BN_mod_mul_reciprocal(r, r, r, &recp, ctx)
!BN_mod_mul_re...r, &recp, ctx)Description
TRUEnever evaluated
FALSEevaluated 51529 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-51529
185 goto
never executed: goto err;
err;
never executed: goto err;
0
186 if (wstart == 0
wstart == 0Description
TRUEevaluated 320 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 51209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
320-51209
187 break;
executed 320 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
320
188 wstart--;-
189 continue;
executed 51209 times by 1 test: continue;
Executed by:
  • libcrypto.so.1.1
51209
190 }-
191-
192-
193-
194-
195-
196 j = wstart;-
197 wvalue = 1;-
198 wend = 0;-
199 for (i = 1; i < window
i < windowDescription
TRUEevaluated 91140 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 23754 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++) {
23754-91140
200 if (wstart - i < 0
wstart - i < 0Description
TRUEevaluated 165 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 90975 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
165-90975
201 break;
executed 165 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
165
202 if (BN_is_bit_set(p, wstart - i)
BN_is_bit_set(p, wstart - i)Description
TRUEevaluated 47726 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 43249 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
43249-47726
203 wvalue <<= (i - wend);-
204 wvalue |= 1;-
205 wend = i;-
206 }
executed 47726 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
47726
207 }
executed 90975 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
90975
208-
209-
210 j = wend + 1;-
211-
212 if (!start
!startDescription
TRUEevaluated 23347 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 572 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
572-23347
213 for (i = 0; i < j
i < jDescription
TRUEevaluated 91488 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 23347 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++) {
23347-91488
214 if (!BN_mod_mul_reciprocal(r, r, r, &recp, ctx)
!BN_mod_mul_re...r, &recp, ctx)Description
TRUEnever evaluated
FALSEevaluated 91488 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-91488
215 goto
never executed: goto err;
err;
never executed: goto err;
0
216 }
executed 91488 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
91488
217-
218-
219 if (!BN_mod_mul_reciprocal(r, r, val[wvalue >> 1], &recp, ctx)
!BN_mod_mul_re...], &recp, ctx)Description
TRUEnever evaluated
FALSEevaluated 23919 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-23919
220 goto
never executed: goto err;
err;
never executed: goto err;
0
221-
222-
223 wstart -= wend + 1;-
224 wvalue = 0;-
225 start = 0;-
226 if (wstart < 0
wstart < 0Description
TRUEevaluated 252 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 23667 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
252-23667
227 break;
executed 252 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
252
228 }
executed 23667 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
23667
229 ret = 1;-
230 err:
code before this statement executed 572 times by 1 test: err:
Executed by:
  • libcrypto.so.1.1
572
231 BN_CTX_end(ctx);-
232 BN_RECP_CTX_free(&recp);-
233 ;-
234 return
executed 577 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 577 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
577
235}-
236-
237int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,-
238 const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont)-
239{-
240 int i, j, bits, ret = 0, wstart, wend, window, wvalue;-
241 int start = 1;-
242 BIGNUM *d, *r;-
243 const BIGNUM *aa;-
244-
245 BIGNUM *val[32];-
246 BN_MONT_CTX *mont = -
247 ((void *)0)-
248 ;-
249-
250 if (BN_get_flags(p, 0x04) != 0
BN_get_flags(p, 0x04) != 0Description
TRUEevaluated 592 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 17148 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
592-17148
251 || BN_get_flags(a, 0x04) != 0
BN_get_flags(a, 0x04) != 0Description
TRUEnever evaluated
FALSEevaluated 17148 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-17148
252 || BN_get_flags(m, 0x04) != 0
BN_get_flags(m, 0x04) != 0Description
TRUEevaluated 5448 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 11700 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
5448-11700
253 return
executed 6040 times by 1 test: return BN_mod_exp_mont_consttime(rr, a, p, m, ctx, in_mont);
Executed by:
  • libcrypto.so.1.1
BN_mod_exp_mont_consttime(rr, a, p, m, ctx, in_mont);
executed 6040 times by 1 test: return BN_mod_exp_mont_consttime(rr, a, p, m, ctx, in_mont);
Executed by:
  • libcrypto.so.1.1
6040
254 }-
255-
256 ;-
257 ;-
258 ;-
259-
260 if (!BN_is_odd(m)
!BN_is_odd(m)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 11698 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
2-11698
261 ERR_put_error(3,(109),(102),__FILE__,318);-
262 return
executed 2 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 2 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
2
263 }-
264 bits = BN_num_bits(p);-
265 if (bits == 0
bits == 0Description
TRUEevaluated 34 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 11664 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
34-11664
266-
267 if (BN_abs_is_word(m, 1)
BN_abs_is_word(m, 1)Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 26 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
8-26
268 ret = 1;-
269 (BN_set_word((rr),0));-
270 }
executed 8 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
8
271 ret = (BN_set_word((rr),1));-
272 }
executed 26 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
26
273 return
executed 34 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 34 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
34
274 }-
275-
276 BN_CTX_start(ctx);-
277 d = BN_CTX_get(ctx);-
278 r = BN_CTX_get(ctx);-
279 val[0] = BN_CTX_get(ctx);-
280 if (val[0] ==
val[0] == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 11664 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-11664
281 ((void *)0)
val[0] == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 11664 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-11664
282 )-
283 goto
never executed: goto err;
err;
never executed: goto err;
0
284-
285-
286-
287-
288-
289 if (in_mont !=
in_mont != ((void *)0)Description
TRUEevaluated 6949 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 4715 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
4715-6949
290 ((void *)0)
in_mont != ((void *)0)Description
TRUEevaluated 6949 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 4715 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
4715-6949
291 )-
292 mont = in_mont;
executed 6949 times by 2 tests: mont = in_mont;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
6949
293 else {-
294 if ((
(mont = BN_MON...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 4715 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
mont = BN_MONT_CTX_new()) ==
(mont = BN_MON...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 4715 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4715
295 ((void *)0)
(mont = BN_MON...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 4715 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4715
296 )-
297 goto
never executed: goto err;
err;
never executed: goto err;
0
298 if (!BN_MONT_CTX_set(mont, m, ctx)
!BN_MONT_CTX_set(mont, m, ctx)Description
TRUEnever evaluated
FALSEevaluated 4715 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-4715
299 goto
never executed: goto err;
err;
never executed: goto err;
0
300 }
executed 4715 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
4715
301-
302 if (a->neg
a->negDescription
TRUEevaluated 103 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 11561 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
|| BN_ucmp(a, m) >= 0
BN_ucmp(a, m) >= 0Description
TRUEevaluated 33 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 11528 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
33-11561
303 if (!BN_nnmod(val[0], a, m, ctx)
!BN_nnmod(val[0], a, m, ctx)Description
TRUEnever evaluated
FALSEevaluated 136 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-136
304 goto
never executed: goto err;
err;
never executed: goto err;
0
305 aa = val[0];-
306 }
executed 136 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else
136
307 aa = a;
executed 11528 times by 2 tests: aa = a;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
11528
308 if (!bn_to_mont_fixed_top(val[0], aa, mont, ctx)
!bn_to_mont_fi...aa, mont, ctx)Description
TRUEnever evaluated
FALSEevaluated 11664 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
0-11664
309 goto
never executed: goto err;
err;
never executed: goto err;
0
310-
311 window = ((
(bits) > 671Description
TRUEevaluated 213 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 11451 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
bits) > 671
(bits) > 671Description
TRUEevaluated 213 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 11451 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
? 6 : (
(bits) > 239Description
TRUEevaluated 2454 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 8997 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
bits) > 239
(bits) > 239Description
TRUEevaluated 2454 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 8997 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
? 5 : (
(bits) > 79Description
TRUEevaluated 3024 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5973 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
bits) > 79
(bits) > 79Description
TRUEevaluated 3024 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5973 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
? 4 : (
(bits) > 23Description
TRUEevaluated 342 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5631 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
bits) > 23
(bits) > 23Description
TRUEevaluated 342 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5631 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
? 3 : 1);
213-11451
312 if (window > 1
window > 1Description
TRUEevaluated 6033 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 5631 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
5631-6033
313 if (!bn_mul_mont_fixed_top(d, val[0], val[0], mont, ctx)
!bn_mul_mont_f...0], mont, ctx)Description
TRUEnever evaluated
FALSEevaluated 6033 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
0-6033
314 goto
never executed: goto err;
err;
never executed: goto err;
0
315 j = 1 << (window - 1);-
316 for (i = 1; i < j
i < jDescription
TRUEevaluated 65607 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 6033 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
; i++) {
6033-65607
317 if (((
((val[i] = BN_... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 65607 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
val[i] = BN_CTX_get(ctx)) ==
((val[i] = BN_... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 65607 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-65607
318 ((void *)0)
((val[i] = BN_... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 65607 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-65607
319 )
((val[i] = BN_... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 65607 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
||
0-65607
320 !bn_mul_mont_fixed_top(val[i], val[i - 1], d, mont, ctx)
!bn_mul_mont_f... d, mont, ctx)Description
TRUEnever evaluated
FALSEevaluated 65607 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
0-65607
321 goto
never executed: goto err;
err;
never executed: goto err;
0
322 }
executed 65607 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
65607
323 }
executed 6033 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
6033
324-
325 start = 1;-
326-
327-
328 wvalue = 0;-
329 wstart = bits - 1;-
330 wend = 0;-
331-
332-
333 j = m->top;-
334 if (m->d[j - 1] & (((unsigned long)1) << ((8 * 8) - 1))
m->d[j - 1] & ...((8 * 8) - 1))Description
TRUEevaluated 6808 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 4856 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
4856-6808
335 if (bn_wexpand(r, j) ==
bn_wexpand(r, ...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 6808 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-6808
336 ((void *)0)
bn_wexpand(r, ...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 6808 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-6808
337 )-
338 goto
never executed: goto err;
err;
never executed: goto err;
0
339-
340 r->d[0] = (0 - m->d[0]) & (0xffffffffffffffffL);-
341 for (i = 1; i < j
i < jDescription
TRUEevaluated 163595 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 6808 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
; i++)
6808-163595
342 r->d[i] = (~m->d[i]) & (0xffffffffffffffffL);
executed 163595 times by 2 tests: r->d[i] = (~m->d[i]) & (0xffffffffffffffffL);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
163595
343 r->top = j;-
344 r->flags |= 0;-
345 }
executed 6808 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
else
6808
346-
347 if (!bn_to_mont_fixed_top(r, BN_value_one(), mont, ctx)
!bn_to_mont_fi...(), mont, ctx)Description
TRUEnever evaluated
FALSEevaluated 4856 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-4856
348 goto
never executed: goto err;
err;
never executed: goto err;
0
349 for (;;) {-
350 if (BN_is_bit_set(p, wstart) == 0
BN_is_bit_set(p, wstart) == 0Description
TRUEevaluated 808705 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 246538 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
246538-808705
351 if (!start
!startDescription
TRUEevaluated 808705 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEnever evaluated
) {
0-808705
352 if (!bn_mul_mont_fixed_top(r, r, r, mont, ctx)
!bn_mul_mont_f... r, mont, ctx)Description
TRUEnever evaluated
FALSEevaluated 808705 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
0-808705
353 goto
never executed: goto err;
err;
never executed: goto err;
0
354 }
executed 808705 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
808705
355 if (wstart == 0
wstart == 0Description
TRUEevaluated 1938 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 806767 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
1938-806767
356 break;
executed 1938 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
1938
357 wstart--;-
358 continue;
executed 806767 times by 2 tests: continue;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
806767
359 }-
360-
361-
362-
363-
364-
365 j = wstart;-
366 wvalue = 1;-
367 wend = 0;-
368 for (i = 1; i < window
i < windowDescription
TRUEevaluated 861621 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 242914 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
; i++) {
242914-861621
369 if (wstart - i < 0
wstart - i < 0Description
TRUEevaluated 3624 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 857997 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
3624-857997
370 break;
executed 3624 times by 2 tests: break;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
3624
371 if (BN_is_bit_set(p, wstart - i)
BN_is_bit_set(p, wstart - i)Description
TRUEevaluated 646167 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 211830 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
211830-646167
372 wvalue <<= (i - wend);-
373 wvalue |= 1;-
374 wend = i;-
375 }
executed 646167 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
646167
376 }
executed 857997 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
857997
377-
378-
379 j = wend + 1;-
380-
381 if (!start
!startDescription
TRUEevaluated 234874 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 11664 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
11664-234874
382 for (i = 0; i < j
i < jDescription
TRUEevaluated 974897 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 234874 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
; i++) {
234874-974897
383 if (!bn_mul_mont_fixed_top(r, r, r, mont, ctx)
!bn_mul_mont_f... r, mont, ctx)Description
TRUEnever evaluated
FALSEevaluated 974897 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
0-974897
384 goto
never executed: goto err;
err;
never executed: goto err;
0
385 }
executed 974897 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
974897
386-
387-
388 if (!bn_mul_mont_fixed_top(r, r, val[wvalue >> 1], mont, ctx)
!bn_mul_mont_f...1], mont, ctx)Description
TRUEnever evaluated
FALSEevaluated 246538 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
0-246538
389 goto
never executed: goto err;
err;
never executed: goto err;
0
390-
391-
392 wstart -= wend + 1;-
393 wvalue = 0;-
394 start = 0;-
395 if (wstart < 0
wstart < 0Description
TRUEevaluated 9726 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 236812 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
9726-236812
396 break;
executed 9726 times by 2 tests: break;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
9726
397 }
executed 236812 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
236812
398 if (!BN_from_montgomery(rr, r, mont, ctx)
!BN_from_montg... r, mont, ctx)Description
TRUEnever evaluated
FALSEevaluated 11664 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
0-11664
399 goto
never executed: goto err;
err;
never executed: goto err;
0
400 ret = 1;-
401 err:
code before this statement executed 11664 times by 2 tests: err:
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
11664
402 if (in_mont ==
in_mont == ((void *)0)Description
TRUEevaluated 4715 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 6949 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
4715-6949
403 ((void *)0)
in_mont == ((void *)0)Description
TRUEevaluated 4715 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 6949 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
4715-6949
404 )-
405 BN_MONT_CTX_free(mont);
executed 4715 times by 1 test: BN_MONT_CTX_free(mont);
Executed by:
  • libcrypto.so.1.1
4715
406 BN_CTX_end(ctx);-
407 ;-
408 return
executed 11664 times by 2 tests: return ret;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
ret;
executed 11664 times by 2 tests: return ret;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
11664
409}-
410-
411static unsigned long bn_get_bits(const BIGNUM *a, int bitpos)-
412{-
413 unsigned long ret = 0;-
414 int wordpos;-
415-
416 wordpos = bitpos / (8 * 8);-
417 bitpos %= (8 * 8);-
418 if (wordpos >= 0
wordpos >= 0Description
TRUEevaluated 96938 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
&& wordpos < a->top
wordpos < a->topDescription
TRUEevaluated 96938 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-96938
419 ret = a->d[wordpos] & (0xffffffffffffffffL);-
420 if (bitpos
bitposDescription
TRUEevaluated 92042 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4896 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
4896-92042
421 ret >>= bitpos;-
422 if (++
++wordpos < a->topDescription
TRUEevaluated 34740 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 57302 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
wordpos < a->top
++wordpos < a->topDescription
TRUEevaluated 34740 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 57302 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
34740-57302
423 ret |= a->d[wordpos] << ((8 * 8) - bitpos);
executed 34740 times by 1 test: ret |= a->d[wordpos] << ((8 * 8) - bitpos);
Executed by:
  • libcrypto.so.1.1
34740
424 }
executed 92042 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
92042
425 }
executed 96938 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
96938
426-
427 return
executed 96938 times by 1 test: return ret & (0xffffffffffffffffL);
Executed by:
  • libcrypto.so.1.1
ret & (0xffffffffffffffffL);
executed 96938 times by 1 test: return ret & (0xffffffffffffffffL);
Executed by:
  • libcrypto.so.1.1
96938
428}-
429static int MOD_EXP_CTIME_COPY_TO_PREBUF(const BIGNUM *b, int top,-
430 unsigned char *buf, int idx,-
431 int window)-
432{-
433 int i, j;-
434 int width = 1 << window;-
435 unsigned long *table = (unsigned long *)buf;-
436-
437 if (top > b->top
top > b->topDescription
TRUEnever evaluated
FALSEevaluated 26960 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-26960
438 top = b->top;
never executed: top = b->top;
0
439-
440 for (i = 0, j = idx; i < top
i < topDescription
TRUEevaluated 528840 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 26960 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++, j += width) {
26960-528840
441 table[j] = b->d[i];-
442 }
executed 528840 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
528840
443-
444 return
executed 26960 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 26960 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
26960
445}-
446-
447static int MOD_EXP_CTIME_COPY_FROM_PREBUF(BIGNUM *b, int top,-
448 unsigned char *buf, int idx,-
449 int window)-
450{-
451 int i, j;-
452 int width = 1 << window;-
453 volatile unsigned long *table = (volatile unsigned long *)buf;-
454-
455 if (bn_wexpand(b, top) ==
bn_wexpand(b, ...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 89076 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-89076
456 ((void *)0)
bn_wexpand(b, ...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 89076 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-89076
457 )-
458 return
never executed: return 0;
0;
never executed: return 0;
0
459-
460 if (window <= 3
window <= 3Description
TRUEevaluated 39380 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 49696 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
39380-49696
461 for (i = 0; i < top
i < topDescription
TRUEevaluated 1222738 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 39380 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++, table += width) {
39380-1222738
462 unsigned long acc = 0;-
463-
464 for (j = 0; j < width
j < widthDescription
TRUEevaluated 9781904 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1222738 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; j++) {
1222738-9781904
465 acc |= table[j] &-
466 ((unsigned long)0 - (constant_time_eq_int(j,idx)&1));-
467 }
executed 9781904 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
9781904
468-
469 b->d[i] = acc;-
470 }
executed 1222738 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
1222738
471 }
executed 39380 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
39380
472 int xstride = 1 << (window - 2);-
473 unsigned long y0, y1, y2, y3;-
474-
475 i = idx >> (window - 2);-
476 idx &= xstride - 1;-
477-
478 y0 = (unsigned long)0 - (constant_time_eq_int(i,0)&1);-
479 y1 = (unsigned long)0 - (constant_time_eq_int(i,1)&1);-
480 y2 = (unsigned long)0 - (constant_time_eq_int(i,2)&1);-
481 y3 = (unsigned long)0 - (constant_time_eq_int(i,3)&1);-
482-
483 for (i = 0; i < top
i < topDescription
TRUEevaluated 323264 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 49696 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++, table += width) {
49696-323264
484 unsigned long acc = 0;-
485-
486 for (j = 0; j < xstride
j < xstrideDescription
TRUEevaluated 1293056 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 323264 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; j++) {
323264-1293056
487 acc |= ( (table[j + 0 * xstride] & y0) |-
488 (table[j + 1 * xstride] & y1) |-
489 (table[j + 2 * xstride] & y2) |-
490 (table[j + 3 * xstride] & y3) )-
491 & ((unsigned long)0 - (constant_time_eq_int(j,idx)&1));-
492 }
executed 1293056 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
1293056
493-
494 b->d[i] = acc;-
495 }
executed 323264 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
323264
496 }
executed 49696 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
49696
497-
498 b->top = top;-
499 b->flags |= 0;-
500 return
executed 89076 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 89076 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
89076
501}-
502int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,-
503 const BIGNUM *m, BN_CTX *ctx,-
504 BN_MONT_CTX *in_mont)-
505{-
506 int i, bits, ret = 0, window, wvalue, wmask, window0;-
507 int top;-
508 BN_MONT_CTX *mont = -
509 ((void *)0)-
510 ;-
511-
512 int numPowers;-
513 unsigned char *powerbufFree = -
514 ((void *)0)-
515 ;-
516 int powerbufLen = 0;-
517 unsigned char *powerbuf = -
518 ((void *)0)-
519 ;-
520 BIGNUM tmp, am;-
521-
522-
523-
524-
525 ;-
526 ;-
527 ;-
528-
529 if (!BN_is_odd(m)
!BN_is_odd(m)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 11073 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
2-11073
530 ERR_put_error(3,(124),(102),__FILE__,614);-
531 return
executed 2 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 2 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
2
532 }-
533-
534 top = m->top;-
535-
536-
537-
538-
539-
540 bits = p->top * (8 * 8);-
541 if (bits == 0
bits == 0Description
TRUEevaluated 15 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 11058 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
15-11058
542-
543 if (BN_abs_is_word(m, 1)
BN_abs_is_word(m, 1)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 11 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
4-11
544 ret = 1;-
545 (BN_set_word((rr),0));-
546 }
executed 4 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
4
547 ret = (BN_set_word((rr),1));-
548 }
executed 11 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
11
549 return
executed 15 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 15 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
15
550 }-
551-
552 BN_CTX_start(ctx);-
553-
554-
555-
556-
557-
558 if (in_mont !=
in_mont != ((void *)0)Description
TRUEevaluated 9015 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2043 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
2043-9015
559 ((void *)0)
in_mont != ((void *)0)Description
TRUEevaluated 9015 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2043 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
2043-9015
560 )-
561 mont = in_mont;
executed 9015 times by 1 test: mont = in_mont;
Executed by:
  • libcrypto.so.1.1
9015
562 else {-
563 if ((
(mont = BN_MON...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2043 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
mont = BN_MONT_CTX_new()) ==
(mont = BN_MON...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2043 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-2043
564 ((void *)0)
(mont = BN_MON...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2043 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-2043
565 )-
566 goto
never executed: goto err;
err;
never executed: goto err;
0
567 if (!BN_MONT_CTX_set(mont, m, ctx)
!BN_MONT_CTX_set(mont, m, ctx)Description
TRUEnever evaluated
FALSEevaluated 2043 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-2043
568 goto
never executed: goto err;
err;
never executed: goto err;
0
569 }
executed 2043 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
2043
570-
571-
572 if (!a->neg
!a->negDescription
TRUEevaluated 11058 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-11058
573-
574-
575-
576-
577-
578 if ((
(16 == a->top)Description
TRUEevaluated 5299 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5759 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
16 == a->top)
(16 == a->top)Description
TRUEevaluated 5299 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5759 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& (
(16 == p->top)Description
TRUEevaluated 5175 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 124 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
16 == p->top)
(16 == p->top)Description
TRUEevaluated 5175 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 124 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& (
(BN_num_bits(m) == 1024)Description
TRUEevaluated 5174 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
BN_num_bits(m) == 1024)
(BN_num_bits(m) == 1024)Description
TRUEevaluated 5174 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
1-5759
579 && rsaz_avx2_eligible()
rsaz_avx2_eligible()Description
TRUEnever evaluated
FALSEevaluated 5174 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-5174
580 if (-
581 ((
((void *)0) ==...expand(rr, 16)Description
TRUEnever evaluated
FALSEnever evaluated
void *)0)
((void *)0) ==...expand(rr, 16)Description
TRUEnever evaluated
FALSEnever evaluated
0
582 == bn_wexpand(rr, 16)
((void *)0) ==...expand(rr, 16)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
583 goto
never executed: goto err;
err;
never executed: goto err;
0
584 RSAZ_1024_mod_exp_avx2(rr->d, a->d, p->d, m->d, mont->RR.d,-
585 mont->n0[0]);-
586 rr->top = 16;-
587 rr->neg = 0;-
588 bn_correct_top(rr);-
589 ret = 1;-
590 goto
never executed: goto err;
err;
never executed: goto err;
0
591 } else if ((
(8 == a->top)Description
TRUEevaluated 669 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 10389 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
8 == a->top)
(8 == a->top)Description
TRUEevaluated 669 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 10389 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& (
(8 == p->top)Description
TRUEevaluated 635 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 34 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
8 == p->top)
(8 == p->top)Description
TRUEevaluated 635 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(m) == 512)Description
TRUEevaluated 616 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 19 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
BN_num_bits(m) == 512)
(BN_num_bits(m) == 512)Description
TRUEevaluated 616 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 19 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
19-10389
592 if (-
593 ((
((void *)0) ==...wexpand(rr, 8)Description
TRUEnever evaluated
FALSEevaluated 616 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
void *)0)
((void *)0) ==...wexpand(rr, 8)Description
TRUEnever evaluated
FALSEevaluated 616 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-616
594 == bn_wexpand(rr, 8)
((void *)0) ==...wexpand(rr, 8)Description
TRUEnever evaluated
FALSEevaluated 616 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-616
595 goto
never executed: goto err;
err;
never executed: goto err;
0
596 RSAZ_512_mod_exp(rr->d, a->d, p->d, m->d, mont->n0[0], mont->RR.d);-
597 rr->top = 8;-
598 rr->neg = 0;-
599 bn_correct_top(rr);-
600 ret = 1;-
601 goto
executed 616 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 616 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
616
602 }-
603 }
executed 10442 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
10442
604-
605-
606-
607 window = ((
(bits) > 937Description
TRUEevaluated 7269 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3173 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
bits) > 937
(bits) > 937Description
TRUEevaluated 7269 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3173 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
? 6 : (
(bits) > 306Description
TRUEevaluated 593 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2580 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
bits) > 306
(bits) > 306Description
TRUEevaluated 593 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2580 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
? 5 : (
(bits) > 89Description
TRUEevaluated 790 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1790 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
bits) > 89
(bits) > 89Description
TRUEevaluated 790 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1790 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
? 4 : (
(bits) > 22Description
TRUEevaluated 1790 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
bits) > 22
(bits) > 22Description
TRUEevaluated 1790 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
? 3 : 1);
0-7269
608 if (window >= 5
window >= 5Description
TRUEevaluated 7862 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2580 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
2580-7862
609 window = 5;-
610-
611-
612 powerbufLen += top * sizeof(mont->N.d[0]);-
613 }
executed 7862 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
7862
614-
615 (void)0;-
616-
617-
618-
619-
620-
621 numPowers = 1 << window;-
622 powerbufLen += sizeof(m->d[0]) * (top * numPowers +-
623 ((2 * top) >-
624 numPowers ? (2 * top) : numPowers));-
625-
626 if (powerbufLen < 3072
powerbufLen < 3072Description
TRUEevaluated 2799 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 7643 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
2799-7643
627 powerbufFree =
executed 2799 times by 1 test: powerbufFree = __builtin_alloca ( powerbufLen + ( 64 ) ) ;
Executed by:
  • libcrypto.so.1.1
2799
628
executed 2799 times by 1 test: powerbufFree = __builtin_alloca ( powerbufLen + ( 64 ) ) ;
Executed by:
  • libcrypto.so.1.1
2799
629 __builtin_alloca (
executed 2799 times by 1 test: powerbufFree = __builtin_alloca ( powerbufLen + ( 64 ) ) ;
Executed by:
  • libcrypto.so.1.1
2799
630 powerbufLen + ( 64 )
executed 2799 times by 1 test: powerbufFree = __builtin_alloca ( powerbufLen + ( 64 ) ) ;
Executed by:
  • libcrypto.so.1.1
2799
631 )
executed 2799 times by 1 test: powerbufFree = __builtin_alloca ( powerbufLen + ( 64 ) ) ;
Executed by:
  • libcrypto.so.1.1
2799
632 ;
executed 2799 times by 1 test: powerbufFree = __builtin_alloca ( powerbufLen + ( 64 ) ) ;
Executed by:
  • libcrypto.so.1.1
2799
633 else-
634-
635 if ((
(powerbufFree ...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 7643 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
powerbufFree =
(powerbufFree ...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 7643 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-7643
636 CRYPTO_malloc(powerbufLen + ( 64 ), __FILE__, 716))
(powerbufFree ...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 7643 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-7643
637 ==
(powerbufFree ...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 7643 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-7643
638 ((void *)0)
(powerbufFree ...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 7643 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-7643
639 )-
640 goto
never executed: goto err;
err;
never executed: goto err;
0
641-
642 powerbuf = ((unsigned char*)(powerbufFree) + (( 64 ) - (((size_t)(powerbufFree)) & ((( 64 ) - 1)))));-
643 memset(powerbuf, 0, powerbufLen);-
644-
645-
646 if (powerbufLen < 3072
powerbufLen < 3072Description
TRUEevaluated 2799 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 7643 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
2799-7643
647 powerbufFree =
executed 2799 times by 1 test: powerbufFree = ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
2799
648 ((void *)0)
executed 2799 times by 1 test: powerbufFree = ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
2799
649 ;
executed 2799 times by 1 test: powerbufFree = ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
2799
650-
651-
652-
653 tmp.d = (unsigned long *)(powerbuf + sizeof(m->d[0]) * top * numPowers);-
654 am.d = tmp.d + top;-
655 tmp.top = am.top = 0;-
656 tmp.dmax = am.dmax = top;-
657 tmp.neg = am.neg = 0;-
658 tmp.flags = am.flags = 0x02;-
659-
660-
661-
662 if (m->d[top - 1] & (((unsigned long)1) << ((8 * 8) - 1))
m->d[top - 1] ...((8 * 8) - 1))Description
TRUEevaluated 7725 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2717 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
2717-7725
663-
664 tmp.d[0] = (0 - m->d[0]) & (0xffffffffffffffffL);-
665 for (i = 1; i < top
i < topDescription
TRUEevaluated 141477 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 7725 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++)
7725-141477
666 tmp.d[i] = (~m->d[i]) & (0xffffffffffffffffL);
executed 141477 times by 1 test: tmp.d[i] = (~m->d[i]) & (0xffffffffffffffffL);
Executed by:
  • libcrypto.so.1.1
141477
667 tmp.top = top;-
668 }
executed 7725 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else
7725
669-
670 if (!bn_to_mont_fixed_top(&tmp, BN_value_one(), mont, ctx)
!bn_to_mont_fi...(), mont, ctx)Description
TRUEnever evaluated
FALSEevaluated 2717 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-2717
671 goto
never executed: goto err;
err;
never executed: goto err;
0
672-
673-
674 if (a->neg
a->negDescription
TRUEnever evaluated
FALSEevaluated 10442 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| BN_ucmp(a, m) >= 0
BN_ucmp(a, m) >= 0Description
TRUEevaluated 22 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 10420 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-10442
675 if (!BN_nnmod(&am, a, m, ctx)
!BN_nnmod(&am, a, m, ctx)Description
TRUEnever evaluated
FALSEevaluated 22 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-22
676 goto
never executed: goto err;
err;
never executed: goto err;
0
677 if (!bn_to_mont_fixed_top(&am, &am, mont, ctx)
!bn_to_mont_fi...am, mont, ctx)Description
TRUEnever evaluated
FALSEevaluated 22 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-22
678 goto
never executed: goto err;
err;
never executed: goto err;
0
679 }
executed 22 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else if (!bn_to_mont_fixed_top(&am, a, mont, ctx)
!bn_to_mont_fi... a, mont, ctx)Description
TRUEnever evaluated
FALSEevaluated 10420 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-10420
680 goto
never executed: goto err;
err;
never executed: goto err;
0
681 if (window == 5
window == 5Description
TRUEevaluated 7862 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2580 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& top > 1
top > 1Description
TRUEevaluated 7862 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-7862
682 void bn_mul_mont_gather5(unsigned long *rp, const unsigned long *ap,-
683 const void *table, const unsigned long *np,-
684 const unsigned long *n0, int num, int power);-
685 void bn_scatter5(const unsigned long *inp, size_t num,-
686 void *table, size_t power);-
687 void bn_gather5(unsigned long *out, size_t num, void *table, size_t power);-
688 void bn_power5(unsigned long *rp, const unsigned long *ap,-
689 const void *table, const unsigned long *np,-
690 const unsigned long *n0, int num, int power);-
691 int bn_get_bits5(const unsigned long *ap, int off);-
692 int bn_from_montgomery(unsigned long *rp, const unsigned long *ap,-
693 const unsigned long *not_used, const unsigned long *np,-
694 const unsigned long *n0, int num);-
695-
696 unsigned long *n0 = mont->n0, *np;-
697-
698-
699-
700-
701-
702 for (i = am.top; i < top
i < topDescription
TRUEnever evaluated
FALSEevaluated 7862 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++)
0-7862
703 am.d[i] = 0;
never executed: am.d[i] = 0;
0
704 for (i = tmp.top; i < top
i < topDescription
TRUEnever evaluated
FALSEevaluated 7862 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++)
0-7862
705 tmp.d[i] = 0;
never executed: tmp.d[i] = 0;
0
706-
707-
708-
709-
710 for (np = am.d + top, i = 0; i < top
i < topDescription
TRUEevaluated 145430 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 7862 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++)
7862-145430
711 np[i] = mont->N.d[i];
executed 145430 times by 1 test: np[i] = mont->N.d[i];
Executed by:
  • libcrypto.so.1.1
145430
712-
713 bn_scatter5(tmp.d, top, powerbuf, 0);-
714 bn_scatter5(am.d, am.top, powerbuf, 1);-
715 bn_mul_mont(tmp.d, am.d, am.d, np, n0, top);-
716 bn_scatter5(tmp.d, top, powerbuf, 2);-
717 for (i = 4; i < 32
i < 32Description
TRUEevaluated 23586 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 7862 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i *= 2) {
7862-23586
718 bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top);-
719 bn_scatter5(tmp.d, top, powerbuf, i);-
720 }
executed 23586 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
23586
721 for (i = 3; i < 8
i < 8Description
TRUEevaluated 23586 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 7862 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i += 2) {
7862-23586
722 int j;-
723 bn_mul_mont_gather5(tmp.d, am.d, powerbuf, np, n0, top, i - 1);-
724 bn_scatter5(tmp.d, top, powerbuf, i);-
725 for (j = 2 * i; j < 32
j < 32Description
TRUEevaluated 55034 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 23586 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; j *= 2) {
23586-55034
726 bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top);-
727 bn_scatter5(tmp.d, top, powerbuf, j);-
728 }
executed 55034 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
55034
729 }
executed 23586 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
23586
730 for (; i < 16
i < 16Description
TRUEevaluated 31448 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 7862 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i += 2) {
7862-31448
731 bn_mul_mont_gather5(tmp.d, am.d, powerbuf, np, n0, top, i - 1);-
732 bn_scatter5(tmp.d, top, powerbuf, i);-
733 bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top);-
734 bn_scatter5(tmp.d, top, powerbuf, 2 * i);-
735 }
executed 31448 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
31448
736 for (; i < 32
i < 32Description
TRUEevaluated 62896 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 7862 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i += 2) {
7862-62896
737 bn_mul_mont_gather5(tmp.d, am.d, powerbuf, np, n0, top, i - 1);-
738 bn_scatter5(tmp.d, top, powerbuf, i);-
739 }
executed 62896 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
62896
740-
741-
742-
743-
744-
745-
746-
747 window0 = (bits - 1) % 5 + 1;-
748 wmask = (1 << window0) - 1;-
749 bits -= window0;-
750 wvalue = bn_get_bits(p, bits) & wmask;-
751 bn_gather5(tmp.d, top, powerbuf, wvalue);-
752-
753-
754-
755-
756-
757 if (top & 7
top & 7Description
TRUEevaluated 2340 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5522 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
2340-5522
758 while (bits > 0
bits > 0Description
TRUEevaluated 686189 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2340 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
2340-686189
759 bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top);-
760 bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top);-
761 bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top);-
762 bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top);-
763 bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top);-
764 bn_mul_mont_gather5(tmp.d, tmp.d, powerbuf, np, n0, top,-
765 bn_get_bits5(p->d, bits -= 5));-
766 }
executed 686189 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
686189
767 }
executed 2340 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
2340
768 while (bits > 0
bits > 0Description
TRUEevaluated 1135874 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5522 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
5522-1135874
769 bn_power5(tmp.d, tmp.d, powerbuf, np, n0, top,-
770 bn_get_bits5(p->d, bits -= 5));-
771 }
executed 1135874 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
1135874
772 }
executed 5522 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
5522
773-
774 ret = bn_from_montgomery(tmp.d, tmp.d, -
775 ((void *)0)-
776 , np, n0, top);-
777 tmp.top = top;-
778 bn_correct_top(&tmp);-
779 if (ret
retDescription
TRUEevaluated 5522 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2340 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
2340-5522
780 if (!BN_copy(rr, &tmp)
!BN_copy(rr, &tmp)Description
TRUEnever evaluated
FALSEevaluated 5522 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-5522
781 ret = 0;
never executed: ret = 0;
0
782 goto
executed 5522 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 5522 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
5522
783 }-
784 }
executed 2340 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else
2340
785-
786 {-
787 if (!MOD_EXP_CTIME_COPY_TO_PREBUF(&tmp, top, powerbuf, 0, window)
!MOD_EXP_CTIME...uf, 0, window)Description
TRUEnever evaluated
FALSEevaluated 2580 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-2580
788 goto
never executed: goto err;
err;
never executed: goto err;
0
789 if (!MOD_EXP_CTIME_COPY_TO_PREBUF(&am, top, powerbuf, 1, window)
!MOD_EXP_CTIME...uf, 1, window)Description
TRUEnever evaluated
FALSEevaluated 2580 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-2580
790 goto
never executed: goto err;
err;
never executed: goto err;
0
791-
792-
793-
794-
795-
796-
797-
798 if (window > 1
window > 1Description
TRUEevaluated 2580 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-2580
799 if (!bn_mul_mont_fixed_top(&tmp, &am, &am, mont, ctx)
!bn_mul_mont_f...am, mont, ctx)Description
TRUEnever evaluated
FALSEevaluated 2580 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-2580
800 goto
never executed: goto err;
err;
never executed: goto err;
0
801 if (!MOD_EXP_CTIME_COPY_TO_PREBUF(&tmp, top, powerbuf, 2,
!MOD_EXP_CTIME...uf, 2, window)Description
TRUEnever evaluated
FALSEevaluated 2580 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-2580
802 window)
!MOD_EXP_CTIME...uf, 2, window)Description
TRUEnever evaluated
FALSEevaluated 2580 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-2580
803 goto
never executed: goto err;
err;
never executed: goto err;
0
804 for (i = 3; i < numPowers
i < numPowersDescription
TRUEevaluated 19220 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2580 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++) {
2580-19220
805-
806 if (!bn_mul_mont_fixed_top(&tmp, &am, &tmp, mont, ctx)
!bn_mul_mont_f...mp, mont, ctx)Description
TRUEnever evaluated
FALSEevaluated 19220 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-19220
807 goto
never executed: goto err;
err;
never executed: goto err;
0
808 if (!MOD_EXP_CTIME_COPY_TO_PREBUF(&tmp, top, powerbuf, i,
!MOD_EXP_CTIME...uf, i, window)Description
TRUEnever evaluated
FALSEevaluated 19220 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-19220
809 window)
!MOD_EXP_CTIME...uf, i, window)Description
TRUEnever evaluated
FALSEevaluated 19220 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-19220
810 goto
never executed: goto err;
err;
never executed: goto err;
0
811 }
executed 19220 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
19220
812 }
executed 2580 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
2580
813-
814-
815-
816-
817-
818-
819-
820 window0 = (bits - 1) % window + 1;-
821 wmask = (1 << window0) - 1;-
822 bits -= window0;-
823 wvalue = bn_get_bits(p, bits) & wmask;-
824 if (!MOD_EXP_CTIME_COPY_FROM_PREBUF(&tmp, top, powerbuf, wvalue,
!MOD_EXP_CTIME...value, window)Description
TRUEnever evaluated
FALSEevaluated 2580 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-2580
825 window)
!MOD_EXP_CTIME...value, window)Description
TRUEnever evaluated
FALSEevaluated 2580 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-2580
826 goto
never executed: goto err;
err;
never executed: goto err;
0
827-
828 wmask = (1 << window) - 1;-
829-
830-
831-
832-
833 while (bits > 0
bits > 0Description
TRUEevaluated 86496 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2580 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
2580-86496
834-
835-
836 for (i = 0; i < window
i < windowDescription
TRUEevaluated 308394 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 86496 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++)
86496-308394
837 if (!bn_mul_mont_fixed_top(&tmp, &tmp, &tmp, mont, ctx)
!bn_mul_mont_f...mp, mont, ctx)Description
TRUEnever evaluated
FALSEevaluated 308394 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-308394
838 goto
never executed: goto err;
err;
never executed: goto err;
0
839 bits -= window;-
840 wvalue = bn_get_bits(p, bits) & wmask;-
841-
842-
843-
844 if (!MOD_EXP_CTIME_COPY_FROM_PREBUF(&am, top, powerbuf, wvalue,
!MOD_EXP_CTIME...value, window)Description
TRUEnever evaluated
FALSEevaluated 86496 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-86496
845 window)
!MOD_EXP_CTIME...value, window)Description
TRUEnever evaluated
FALSEevaluated 86496 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-86496
846 goto
never executed: goto err;
err;
never executed: goto err;
0
847-
848-
849 if (!bn_mul_mont_fixed_top(&tmp, &tmp, &am, mont, ctx)
!bn_mul_mont_f...am, mont, ctx)Description
TRUEnever evaluated
FALSEevaluated 86496 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-86496
850 goto
never executed: goto err;
err;
never executed: goto err;
0
851 }
executed 86496 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
86496
852 }
executed 2580 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
2580
853 if (!BN_from_montgomery(rr, &tmp, mont, ctx)
!BN_from_montg...mp, mont, ctx)Description
TRUEnever evaluated
FALSEevaluated 4920 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-4920
854 goto
never executed: goto err;
err;
never executed: goto err;
0
855 ret = 1;-
856 err:
code before this statement executed 4920 times by 1 test: err:
Executed by:
  • libcrypto.so.1.1
4920
857 if (in_mont ==
in_mont == ((void *)0)Description
TRUEevaluated 2043 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 9015 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
2043-9015
858 ((void *)0)
in_mont == ((void *)0)Description
TRUEevaluated 2043 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 9015 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
2043-9015
859 )-
860 BN_MONT_CTX_free(mont);
executed 2043 times by 1 test: BN_MONT_CTX_free(mont);
Executed by:
  • libcrypto.so.1.1
2043
861 if (powerbuf !=
powerbuf != ((void *)0)Description
TRUEevaluated 10442 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 616 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
616-10442
862 ((void *)0)
powerbuf != ((void *)0)Description
TRUEevaluated 10442 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 616 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
616-10442
863 ) {-
864 OPENSSL_cleanse(powerbuf, powerbufLen);-
865 CRYPTO_free(powerbufFree, __FILE__, 1121);-
866 }
executed 10442 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
10442
867 BN_CTX_end(ctx);-
868 return
executed 11058 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 11058 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
11058
869}-
870-
871int BN_mod_exp_mont_word(BIGNUM *rr, unsigned long a, const BIGNUM *p,-
872 const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont)-
873{-
874 BN_MONT_CTX *mont = -
875 ((void *)0)-
876 ;-
877 int b, bits, ret = 0;-
878 int r_is_one;-
879 unsigned long w, next_w;-
880 BIGNUM *r, *t;-
881 BIGNUM *swap_tmp;-
882 if (BN_get_flags(p, 0x04) != 0
BN_get_flags(p, 0x04) != 0Description
TRUEnever evaluated
FALSEevaluated 2729 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-2729
883 || BN_get_flags(m, 0x04) != 0
BN_get_flags(m, 0x04) != 0Description
TRUEnever evaluated
FALSEevaluated 2729 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-2729
884-
885 ERR_put_error(3,(117),((2|64)),__FILE__,1156);-
886 return
never executed: return 0;
0;
never executed: return 0;
0
887 }-
888-
889 ;-
890 ;-
891-
892 if (!BN_is_odd(m)
!BN_is_odd(m)Description
TRUEnever evaluated
FALSEevaluated 2729 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-2729
893 ERR_put_error(3,(117),(102),__FILE__,1164);-
894 return
never executed: return 0;
0;
never executed: return 0;
0
895 }-
896 if (m->top == 1
m->top == 1Description
TRUEevaluated 112 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2617 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
112-2617
897 a %= m->d[0];
executed 112 times by 1 test: a %= m->d[0];
Executed by:
  • libcrypto.so.1.1
112
898-
899 bits = BN_num_bits(p);-
900 if (bits == 0
bits == 0Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2719 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
10-2719
901-
902 if (BN_abs_is_word(m, 1)
BN_abs_is_word(m, 1)Description
TRUEevaluated 7 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
3-7
903 ret = 1;-
904 (BN_set_word((rr),0));-
905 }
executed 7 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
7
906 ret = (BN_set_word((rr),1));-
907 }
executed 3 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
3
908 return
executed 10 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 10 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
10
909 }-
910 if (a == 0
a == 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2717 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
2-2717
911 (BN_set_word((rr),0));-
912 ret = 1;-
913 return
executed 2 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 2 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
2
914 }-
915-
916 BN_CTX_start(ctx);-
917 r = BN_CTX_get(ctx);-
918 t = BN_CTX_get(ctx);-
919 if (t ==
t == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2717 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-2717
920 ((void *)0)
t == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2717 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-2717
921 )-
922 goto
never executed: goto err;
err;
never executed: goto err;
0
923-
924 if (in_mont !=
in_mont != ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2717 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-2717
925 ((void *)0)
in_mont != ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2717 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-2717
926 )-
927 mont = in_mont;
never executed: mont = in_mont;
0
928 else {-
929 if ((
(mont = BN_MON...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2717 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
mont = BN_MONT_CTX_new()) ==
(mont = BN_MON...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2717 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-2717
930 ((void *)0)
(mont = BN_MON...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2717 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-2717
931 )-
932 goto
never executed: goto err;
err;
never executed: goto err;
0
933 if (!BN_MONT_CTX_set(mont, m, ctx)
!BN_MONT_CTX_set(mont, m, ctx)Description
TRUEnever evaluated
FALSEevaluated 2717 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-2717
934 goto
never executed: goto err;
err;
never executed: goto err;
0
935 }
executed 2717 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
2717
936-
937 r_is_one = 1;-
938-
939-
940-
941-
942 w = a;-
943 for (b = bits - 2; b >= 0
b >= 0Description
TRUEevaluated 373922 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2717 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; b--) {
2717-373922
944-
945 next_w = w * w;-
946 if ((
(next_w / w) != wDescription
TRUEevaluated 83268 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 290654 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
next_w / w) != w
(next_w / w) != wDescription
TRUEevaluated 83268 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 290654 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
83268-290654
947 if (r_is_one
r_is_oneDescription
TRUEevaluated 2403 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 80865 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
2403-80865
948 if (!(BN_set_word(r, (w))
BN_set_word(r, (w))Description
TRUEevaluated 2403 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
&& BN_to_montgomery(r, r, (mont), ctx)
BN_to_montgome..., (mont), ctx)Description
TRUEevaluated 2403 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
))
0-2403
949 goto
never executed: goto err;
err;
never executed: goto err;
0
950 r_is_one = 0;-
951 }
executed 2403 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
2403
952 if (!(BN_mul_word(r, (w))
BN_mul_word(r, (w))Description
TRUEevaluated 80865 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
&& ( (BN_div(
BN_div( ((void...(r),(m),(ctx))Description
TRUEevaluated 80865 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-80865
953 ((void *)0)
BN_div( ((void...(r),(m),(ctx))Description
TRUEevaluated 80865 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-80865
954 ,(t),(r),(m),(ctx))
BN_div( ((void...(r),(m),(ctx))Description
TRUEevaluated 80865 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
&& (swap_tmp = r, r = t, t = swap_tmp, 1)))))
0-80865
955 goto
never executed: goto err;
err;
never executed: goto err;
0
956 }
executed 80865 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
80865
957 next_w = 1;-
958 }
executed 83268 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
83268
959 w = next_w;-
960 if (!r_is_one
!r_is_oneDescription
TRUEevaluated 366614 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 7308 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
7308-366614
961 if (!BN_mod_mul_montgomery(r, r, r, mont, ctx)
!BN_mod_mul_mo... r, mont, ctx)Description
TRUEnever evaluated
FALSEevaluated 366614 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-366614
962 goto
never executed: goto err;
err;
never executed: goto err;
0
963 }
executed 366614 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
366614
964-
965-
966 if (BN_is_bit_set(p, b)
BN_is_bit_set(p, b)Description
TRUEevaluated 343890 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 30032 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
30032-343890
967 next_w = w * a;-
968 if ((
(next_w / a) != wDescription
TRUEevaluated 51661 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 292229 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
next_w / a) != w
(next_w / a) != wDescription
TRUEevaluated 51661 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 292229 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
51661-292229
969 if (r_is_one
r_is_oneDescription
TRUEevaluated 270 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 51391 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
270-51391
970 if (!(BN_set_word(r, (w))
BN_set_word(r, (w))Description
TRUEevaluated 270 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
&& BN_to_montgomery(r, r, (mont), ctx)
BN_to_montgome..., (mont), ctx)Description
TRUEevaluated 270 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
))
0-270
971 goto
never executed: goto err;
err;
never executed: goto err;
0
972 r_is_one = 0;-
973 }
executed 270 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
270
974 if (!(BN_mul_word(r, (w))
BN_mul_word(r, (w))Description
TRUEevaluated 51391 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
&& ( (BN_div(
BN_div( ((void...(r),(m),(ctx))Description
TRUEevaluated 51391 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-51391
975 ((void *)0)
BN_div( ((void...(r),(m),(ctx))Description
TRUEevaluated 51391 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-51391
976 ,(t),(r),(m),(ctx))
BN_div( ((void...(r),(m),(ctx))Description
TRUEevaluated 51391 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
&& (swap_tmp = r, r = t, t = swap_tmp, 1)))))
0-51391
977 goto
never executed: goto err;
err;
never executed: goto err;
0
978 }
executed 51391 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
51391
979 next_w = a;-
980 }
executed 51661 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
51661
981 w = next_w;-
982 }
executed 343890 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
343890
983 }
executed 373922 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
373922
984-
985-
986 if (w != 1
w != 1Description
TRUEevaluated 2560 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 157 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
157-2560
987 if (r_is_one
r_is_oneDescription
TRUEevaluated 39 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2521 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
39-2521
988 if (!(BN_set_word(r, (w))
BN_set_word(r, (w))Description
TRUEevaluated 39 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
&& BN_to_montgomery(r, r, (mont), ctx)
BN_to_montgome..., (mont), ctx)Description
TRUEevaluated 39 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
))
0-39
989 goto
never executed: goto err;
err;
never executed: goto err;
0
990 r_is_one = 0;-
991 }
executed 39 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
39
992 if (!(BN_mul_word(r, (w))
BN_mul_word(r, (w))Description
TRUEevaluated 2521 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
&& ( (BN_div(
BN_div( ((void...(r),(m),(ctx))Description
TRUEevaluated 2521 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-2521
993 ((void *)0)
BN_div( ((void...(r),(m),(ctx))Description
TRUEevaluated 2521 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-2521
994 ,(t),(r),(m),(ctx))
BN_div( ((void...(r),(m),(ctx))Description
TRUEevaluated 2521 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
&& (swap_tmp = r, r = t, t = swap_tmp, 1)))))
0-2521
995 goto
never executed: goto err;
err;
never executed: goto err;
0
996 }
executed 2521 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
2521
997 }-
998-
999 if (r_is_one
r_is_oneDescription
TRUEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2712 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
5-2712
1000 if (!(BN_set_word((rr),1))
!(BN_set_word((rr),1))Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-5
1001 goto
never executed: goto err;
err;
never executed: goto err;
0
1002 }
executed 5 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
5
1003 if (!BN_from_montgomery(rr, r, mont, ctx)
!BN_from_montg... r, mont, ctx)Description
TRUEnever evaluated
FALSEevaluated 2712 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-2712
1004 goto
never executed: goto err;
err;
never executed: goto err;
0
1005 }
executed 2712 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
2712
1006 ret = 1;-
1007 err:
code before this statement executed 2717 times by 1 test: err:
Executed by:
  • libcrypto.so.1.1
2717
1008 if (in_mont ==
in_mont == ((void *)0)Description
TRUEevaluated 2717 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-2717
1009 ((void *)0)
in_mont == ((void *)0)Description
TRUEevaluated 2717 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-2717
1010 )-
1011 BN_MONT_CTX_free(mont);
executed 2717 times by 1 test: BN_MONT_CTX_free(mont);
Executed by:
  • libcrypto.so.1.1
2717
1012 BN_CTX_end(ctx);-
1013 ;-
1014 return
executed 2717 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 2717 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
2717
1015}-
1016-
1017-
1018int BN_mod_exp_simple(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,-
1019 const BIGNUM *m, BN_CTX *ctx)-
1020{-
1021 int i, j, bits, ret = 0, wstart, wend, window, wvalue;-
1022 int start = 1;-
1023 BIGNUM *d;-
1024-
1025 BIGNUM *val[32];-
1026-
1027 if (BN_get_flags(p, 0x04) != 0
BN_get_flags(p, 0x04) != 0Description
TRUEnever evaluated
FALSEevaluated 728 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-728
1028 || BN_get_flags(a, 0x04) != 0
BN_get_flags(a, 0x04) != 0Description
TRUEnever evaluated
FALSEevaluated 728 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-728
1029 || BN_get_flags(m, 0x04) != 0
BN_get_flags(m, 0x04) != 0Description
TRUEnever evaluated
FALSEevaluated 728 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-728
1030-
1031 ERR_put_error(3,(126),((2|64)),__FILE__,1288);-
1032 return
never executed: return 0;
0;
never executed: return 0;
0
1033 }-
1034-
1035 bits = BN_num_bits(p);-
1036 if (bits == 0
bits == 0Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 716 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
12-716
1037-
1038 if (BN_abs_is_word(m, 1)
BN_abs_is_word(m, 1)Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 6 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
6
1039 ret = 1;-
1040 (BN_set_word((r),0));-
1041 }
executed 6 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
6
1042 ret = (BN_set_word((r),1));-
1043 }
executed 6 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
6
1044 return
executed 12 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 12 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
12
1045 }-
1046-
1047 BN_CTX_start(ctx);-
1048 d = BN_CTX_get(ctx);-
1049 val[0] = BN_CTX_get(ctx);-
1050 if (val[0] ==
val[0] == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 716 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-716
1051 ((void *)0)
val[0] == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 716 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-716
1052 )-
1053 goto
never executed: goto err;
err;
never executed: goto err;
0
1054-
1055 if (!BN_nnmod(val[0], a, m, ctx)
!BN_nnmod(val[0], a, m, ctx)Description
TRUEnever evaluated
FALSEevaluated 716 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-716
1056 goto
never executed: goto err;
err;
never executed: goto err;
0
1057 if (BN_is_zero(val[0])
BN_is_zero(val[0])Description
TRUEevaluated 56 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 660 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
56-660
1058 (BN_set_word((r),0));-
1059 ret = 1;-
1060 goto
executed 56 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 56 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
56
1061 }-
1062-
1063 window = ((
(bits) > 671Description
TRUEevaluated 39 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 621 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
bits) > 671
(bits) > 671Description
TRUEevaluated 39 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 621 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
? 6 : (
(bits) > 239Description
TRUEevaluated 227 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 394 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
bits) > 239
(bits) > 239Description
TRUEevaluated 227 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 394 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
? 5 : (
(bits) > 79Description
TRUEevaluated 72 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 322 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
bits) > 79
(bits) > 79Description
TRUEevaluated 72 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 322 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
? 4 : (
(bits) > 23Description
TRUEevaluated 75 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 247 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
bits) > 23
(bits) > 23Description
TRUEevaluated 75 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 247 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
? 3 : 1);
39-621
1064 if (window > 1
window > 1Description
TRUEevaluated 413 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 247 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
247-413
1065 if (!BN_mod_mul(d, val[0], val[0], m, ctx)
!BN_mod_mul(d,...al[0], m, ctx)Description
TRUEnever evaluated
FALSEevaluated 413 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-413
1066 goto
never executed: goto err;
err;
never executed: goto err;
0
1067 j = 1 << (window - 1);-
1068 for (i = 1; i < j
i < jDescription
TRUEevaluated 5343 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 413 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++) {
413-5343
1069 if (((
((val[i] = BN_... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 5343 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
val[i] = BN_CTX_get(ctx)) ==
((val[i] = BN_... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 5343 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-5343
1070 ((void *)0)
((val[i] = BN_... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 5343 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-5343
1071 )
((val[i] = BN_... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 5343 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
||
0-5343
1072 !BN_mod_mul(val[i], val[i - 1], d, m, ctx)
!BN_mod_mul(va...1], d, m, ctx)Description
TRUEnever evaluated
FALSEevaluated 5343 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-5343
1073 goto
never executed: goto err;
err;
never executed: goto err;
0
1074 }
executed 5343 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
5343
1075 }
executed 413 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
413
1076-
1077 start = 1;-
1078-
1079-
1080 wvalue = 0;-
1081 wstart = bits - 1;-
1082 wend = 0;-
1083-
1084 if (!(BN_set_word((r),1))
!(BN_set_word((r),1))Description
TRUEnever evaluated
FALSEevaluated 660 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-660
1085 goto
never executed: goto err;
err;
never executed: goto err;
0
1086-
1087 for (;;) {-
1088 if (BN_is_bit_set(p, wstart) == 0
BN_is_bit_set(p, wstart) == 0Description
TRUEevaluated 64116 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 23776 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
23776-64116
1089 if (!start
!startDescription
TRUEevaluated 64116 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
)
0-64116
1090 if (!BN_mod_mul(r, r, r, m, ctx)
!BN_mod_mul(r, r, r, m, ctx)Description
TRUEnever evaluated
FALSEevaluated 64116 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-64116
1091 goto
never executed: goto err;
err;
never executed: goto err;
0
1092 if (wstart == 0
wstart == 0Description
TRUEevaluated 298 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 63818 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
298-63818
1093 break;
executed 298 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
298
1094 wstart--;-
1095 continue;
executed 63818 times by 1 test: continue;
Executed by:
  • libcrypto.so.1.1
63818
1096 }-
1097-
1098-
1099-
1100-
1101-
1102 j = wstart;-
1103 wvalue = 1;-
1104 wend = 0;-
1105 for (i = 1; i < window
i < windowDescription
TRUEevaluated 93047 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 23547 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++) {
23547-93047
1106 if (wstart - i < 0
wstart - i < 0Description
TRUEevaluated 229 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 92818 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
229-92818
1107 break;
executed 229 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
229
1108 if (BN_is_bit_set(p, wstart - i)
BN_is_bit_set(p, wstart - i)Description
TRUEevaluated 51861 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 40957 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
40957-51861
1109 wvalue <<= (i - wend);-
1110 wvalue |= 1;-
1111 wend = i;-
1112 }
executed 51861 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
51861
1113 }
executed 92818 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
92818
1114-
1115-
1116 j = wend + 1;-
1117-
1118 if (!start
!startDescription
TRUEevaluated 23116 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 660 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
660-23116
1119 for (i = 0; i < j
i < jDescription
TRUEevaluated 94651 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 23116 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++) {
23116-94651
1120 if (!BN_mod_mul(r, r, r, m, ctx)
!BN_mod_mul(r, r, r, m, ctx)Description
TRUEnever evaluated
FALSEevaluated 94651 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-94651
1121 goto
never executed: goto err;
err;
never executed: goto err;
0
1122 }
executed 94651 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
94651
1123-
1124-
1125 if (!BN_mod_mul(r, r, val[wvalue >> 1], m, ctx)
!BN_mod_mul(r,...>> 1], m, ctx)Description
TRUEnever evaluated
FALSEevaluated 23776 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-23776
1126 goto
never executed: goto err;
err;
never executed: goto err;
0
1127-
1128-
1129 wstart -= wend + 1;-
1130 wvalue = 0;-
1131 start = 0;-
1132 if (wstart < 0
wstart < 0Description
TRUEevaluated 362 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 23414 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
362-23414
1133 break;
executed 362 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
362
1134 }
executed 23414 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
23414
1135 ret = 1;-
1136 err:
code before this statement executed 660 times by 1 test: err:
Executed by:
  • libcrypto.so.1.1
660
1137 BN_CTX_end(ctx);-
1138 ;-
1139 return
executed 716 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 716 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
716
1140}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2