OpenCoverage

bn_gf2m.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/bn/bn_gf2m.c
Switch to Source codePreprocessed file
LineSourceCount
1void bn_GF2m_mul_2x2(unsigned long *r, unsigned long a1, unsigned long a0, unsigned long b1,-
2 unsigned long b0);-
3-
4-
5-
6-
7-
8-
9int BN_GF2m_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)-
10{-
11 int i;-
12 const BIGNUM *at, *bt;-
13-
14 ;-
15 ;-
16-
17 if (a->top < b->top
a->top < b->topDescription
TRUEevaluated 96203 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 33753235 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
96203-33753235
18 at = b;-
19 bt = a;-
20 }
executed 96203 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
96203
21 at = a;-
22 bt = b;-
23 }
executed 33753235 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
33753235
24-
25 if (bn_wexpand(r, at->top) ==
bn_wexpand(r, ...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 33849438 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-33849438
26 ((void *)0)
bn_wexpand(r, ...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 33849438 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-33849438
27 )-
28 return
never executed: return 0;
0;
never executed: return 0;
0
29-
30 for (i = 0; i < bt->top
i < bt->topDescription
TRUEevaluated 199055657 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 33849438 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++) {
33849438-199055657
31 r->d[i] = at->d[i] ^ bt->d[i];-
32 }
executed 199055657 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
199055657
33 for (; i < at->top
i < at->topDescription
TRUEevaluated 1085927 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 33849438 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++) {
1085927-33849438
34 r->d[i] = at->d[i];-
35 }
executed 1085927 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
1085927
36-
37 r->top = at->top;-
38 bn_correct_top(r);-
39-
40 return
executed 33849438 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 33849438 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
33849438
41}-
42int BN_GF2m_mod_arr(BIGNUM *r, const BIGNUM *a, const int p[])-
43{-
44 int j, k;-
45 int n, dN, d0, d1;-
46 unsigned long zz, *z;-
47-
48 ;-
49-
50 if (!p[0]
!p[0]Description
TRUEnever evaluated
FALSEevaluated 54755526 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-54755526
51-
52 (BN_set_word((r),0));-
53 return
never executed: return 1;
1;
never executed: return 1;
0
54 }-
55-
56-
57-
58-
59-
60 if (a != r
a != rDescription
TRUEevaluated 54712862 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 42664 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
42664-54712862
61 if (!bn_wexpand(r, a->top)
!bn_wexpand(r, a->top)Description
TRUEnever evaluated
FALSEevaluated 54712862 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-54712862
62 return
never executed: return 0;
0;
never executed: return 0;
0
63 for (j = 0; j < a->top
j < a->topDescription
TRUEevaluated 634631023 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 54712862 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; j++) {
54712862-634631023
64 r->d[j] = a->d[j];-
65 }
executed 634631023 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
634631023
66 r->top = a->top;-
67 }
executed 54712862 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
54712862
68 z = r->d;-
69-
70-
71 dN = p[0] / (8 * 8);-
72 for (j = r->top - 1; j > dN
j > dNDescription
TRUEevaluated 630952008 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 54755526 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
;) {
54755526-630952008
73 zz = z[j];-
74 if (z[j] == 0
z[j] == 0Description
TRUEevaluated 315478452 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 315473556 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
315473556-315478452
75 j--;-
76 continue;
executed 315478452 times by 1 test: continue;
Executed by:
  • libcrypto.so.1.1
315478452
77 }-
78 z[j] = 0;-
79-
80 for (k = 1; p[k] != 0
p[k] != 0Description
TRUEevaluated 912934854 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 315473556 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; k++) {
315473556-912934854
81-
82 n = p[0] - p[k];-
83 d0 = n % (8 * 8);-
84 d1 = (8 * 8) - d0;-
85 n /= (8 * 8);-
86 z[j - n] ^= (zz >> d0);-
87 if (d0
d0Description
TRUEevaluated 912731191 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 203663 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
203663-912731191
88 z[j - n - 1] ^= (zz << d1);
executed 912731191 times by 1 test: z[j - n - 1] ^= (zz << d1);
Executed by:
  • libcrypto.so.1.1
912731191
89 }
executed 912934854 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
912934854
90-
91-
92 n = dN;-
93 d0 = p[0] % (8 * 8);-
94 d1 = (8 * 8) - d0;-
95 z[j - n] ^= (zz >> d0);-
96 if (d0
d0Description
TRUEevaluated 315473556 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
)
0-315473556
97 z[j - n - 1] ^= (zz << d1);
executed 315473556 times by 1 test: z[j - n - 1] ^= (zz << d1);
Executed by:
  • libcrypto.so.1.1
315473556
98 }
executed 315473556 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
315473556
99-
100-
101 while (j == dN
j == dNDescription
TRUEevaluated 108386740 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 274903 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
274903-108386740
102-
103 d0 = p[0] % (8 * 8);-
104 zz = z[dN] >> d0;-
105 if (zz == 0
zz == 0Description
TRUEevaluated 54480623 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 53906117 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
53906117-54480623
106 break;
executed 54480623 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
54480623
107 d1 = (8 * 8) - d0;-
108-
109-
110 if (d0
d0Description
TRUEevaluated 53906117 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
)
0-53906117
111 z[dN] = (z[dN] << d1) >> d1;
executed 53906117 times by 1 test: z[dN] = (z[dN] << d1) >> d1;
Executed by:
  • libcrypto.so.1.1
53906117
112 else-
113 z[dN] = 0;
never executed: z[dN] = 0;
0
114 z[0] ^= zz;-
115-
116 for (k = 1; p[k] != 0
p[k] != 0Description
TRUEevaluated 154452711 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 53906117 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; k++) {
53906117-154452711
117 unsigned long tmp_ulong;-
118-
119-
120 n = p[k] / (8 * 8);-
121 d0 = p[k] % (8 * 8);-
122 d1 = (8 * 8) - d0;-
123 z[n] ^= (zz << d0);-
124 if (d0
d0Description
TRUEevaluated 154452711 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
&& (
(tmp_ulong = zz >> d1)Description
TRUEevaluated 1226248 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 153226463 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
tmp_ulong = zz >> d1)
(tmp_ulong = zz >> d1)Description
TRUEevaluated 1226248 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 153226463 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-154452711
125 z[n + 1] ^= tmp_ulong;
executed 1226248 times by 1 test: z[n + 1] ^= tmp_ulong;
Executed by:
  • libcrypto.so.1.1
1226248
126 }
executed 154452711 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
154452711
127-
128 }
executed 53906117 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
53906117
129-
130 bn_correct_top(r);-
131 return
executed 54755526 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 54755526 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
54755526
132}-
133-
134-
135-
136-
137-
138-
139-
140int BN_GF2m_mod(BIGNUM *r, const BIGNUM *a, const BIGNUM *p)-
141{-
142 int ret = 0;-
143 int arr[6];-
144 ;-
145 ;-
146 ret = BN_GF2m_poly2arr(p, arr, (sizeof(arr)/sizeof((arr)[0])));-
147 if (!ret
!retDescription
TRUEnever evaluated
FALSEevaluated 74082 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| ret > (int)(sizeof(arr)/sizeof((arr)[0]))
ret > (int)(si...eof((arr)[0]))Description
TRUEnever evaluated
FALSEevaluated 74082 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-74082
148 ERR_put_error(3,(131),(106),__FILE__,398);-
149 return
never executed: return 0;
0;
never executed: return 0;
0
150 }-
151 ret = BN_GF2m_mod_arr(r, a, arr);-
152 ;-
153 return
executed 74082 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 74082 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
74082
154}-
155-
156-
157-
158-
159-
160int BN_GF2m_mod_mul_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,-
161 const int p[], BN_CTX *ctx)-
162{-
163 int zlen, i, j, k, ret = 0;-
164 BIGNUM *s;-
165 unsigned long x1, x0, y1, y0, zz[4];-
166-
167 ;-
168 ;-
169-
170 if (a == b
a == bDescription
TRUEnever evaluated
FALSEevaluated 19552766 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-19552766
171 return
never executed: return BN_GF2m_mod_sqr_arr(r, a, p, ctx);
BN_GF2m_mod_sqr_arr(r, a, p, ctx);
never executed: return BN_GF2m_mod_sqr_arr(r, a, p, ctx);
0
172 }-
173-
174 BN_CTX_start(ctx);-
175 if ((
(s = BN_CTX_ge...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 19552766 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
s = BN_CTX_get(ctx)) ==
(s = BN_CTX_ge...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 19552766 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-19552766
176 ((void *)0)
(s = BN_CTX_ge...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 19552766 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-19552766
177 )-
178 goto
never executed: goto err;
err;
never executed: goto err;
0
179-
180 zlen = a->top + b->top + 4;-
181 if (!bn_wexpand(s, zlen)
!bn_wexpand(s, zlen)Description
TRUEnever evaluated
FALSEevaluated 19552766 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-19552766
182 goto
never executed: goto err;
err;
never executed: goto err;
0
183 s->top = zlen;-
184-
185 for (i = 0; i < zlen
i < zlenDescription
TRUEevaluated 305716397 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 19552766 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++)
19552766-305716397
186 s->d[i] = 0;
executed 305716397 times by 1 test: s->d[i] = 0;
Executed by:
  • libcrypto.so.1.1
305716397
187-
188 for (j = 0; j < b->top
j < b->topDescription
TRUEevaluated 58335979 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 19552766 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; j += 2) {
19552766-58335979
189 y0 = b->d[j];-
190 y1 = ((
((j + 1) == b->top)Description
TRUEevaluated 3018680 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 55317299 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
j + 1) == b->top)
((j + 1) == b->top)Description
TRUEevaluated 3018680 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 55317299 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
? 0 : b->d[j + 1];
3018680-55317299
191 for (i = 0; i < a->top
i < a->topDescription
TRUEevaluated 179393583 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 58335979 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i += 2) {
58335979-179393583
192 x0 = a->d[i];-
193 x1 = ((
((i + 1) == a->top)Description
TRUEevaluated 10022750 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 169370833 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
i + 1) == a->top)
((i + 1) == a->top)Description
TRUEevaluated 10022750 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 169370833 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
? 0 : a->d[i + 1];
10022750-169370833
194 bn_GF2m_mul_2x2(zz, x1, x0, y1, y0);-
195 for (k = 0; k < 4
k < 4Description
TRUEevaluated 717574332 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 179393583 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; k++)
179393583-717574332
196 s->d[i + j + k] ^= zz[k];
executed 717574332 times by 1 test: s->d[i + j + k] ^= zz[k];
Executed by:
  • libcrypto.so.1.1
717574332
197 }
executed 179393583 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
179393583
198 }
executed 58335979 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
58335979
199-
200 bn_correct_top(s);-
201 if (BN_GF2m_mod_arr(r, s, p)
BN_GF2m_mod_arr(r, s, p)Description
TRUEevaluated 19552766 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
)
0-19552766
202 ret = 1;
executed 19552766 times by 1 test: ret = 1;
Executed by:
  • libcrypto.so.1.1
19552766
203 ;-
204-
205 err:
code before this statement executed 19552766 times by 1 test: err:
Executed by:
  • libcrypto.so.1.1
19552766
206 BN_CTX_end(ctx);-
207 return
executed 19552766 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 19552766 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
19552766
208}-
209int BN_GF2m_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,-
210 const BIGNUM *p, BN_CTX *ctx)-
211{-
212 int ret = 0;-
213 const int max = BN_num_bits(p) + 1;-
214 int *arr = -
215 ((void *)0)-
216 ;-
217 ;-
218 ;-
219 ;-
220 if ((
(arr = CRYPTO_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 219585 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
arr = CRYPTO_malloc(sizeof(*arr) * max, __FILE__, 474)) ==
(arr = CRYPTO_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 219585 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-219585
221 ((void *)0)
(arr = CRYPTO_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 219585 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-219585
222 )-
223 goto
never executed: goto err;
err;
never executed: goto err;
0
224 ret = BN_GF2m_poly2arr(p, arr, max);-
225 if (!ret
!retDescription
TRUEnever evaluated
FALSEevaluated 219585 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| ret > max
ret > maxDescription
TRUEnever evaluated
FALSEevaluated 219585 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-219585
226 ERR_put_error(3,(133),(106),__FILE__,478);-
227 goto
never executed: goto err;
err;
never executed: goto err;
0
228 }-
229 ret = BN_GF2m_mod_mul_arr(r, a, b, arr, ctx);-
230 ;-
231 err:
code before this statement executed 219585 times by 1 test: err:
Executed by:
  • libcrypto.so.1.1
219585
232 CRYPTO_free(arr, __FILE__, 484);-
233 return
executed 219585 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 219585 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
219585
234}-
235-
236-
237int BN_GF2m_mod_sqr_arr(BIGNUM *r, const BIGNUM *a, const int p[],-
238 BN_CTX *ctx)-
239{-
240 int i, ret = 0;-
241 BIGNUM *s;-
242-
243 ;-
244 BN_CTX_start(ctx);-
245 if ((
(s = BN_CTX_ge...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 35053540 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
s = BN_CTX_get(ctx)) ==
(s = BN_CTX_ge...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 35053540 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-35053540
246 ((void *)0)
(s = BN_CTX_ge...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 35053540 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-35053540
247 )-
248 goto
never executed: goto err;
err;
never executed: goto err;
0
249 if (!bn_wexpand(s, 2 * a->top)
!bn_wexpand(s, 2 * a->top)Description
TRUEnever evaluated
FALSEevaluated 35053540 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-35053540
250 goto
never executed: goto err;
err;
never executed: goto err;
0
251-
252 for (i = a->top - 1; i >= 0
i >= 0Description
TRUEevaluated 204697073 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 35053540 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i--) {
35053540-204697073
253 s->d[2 * i + 1] = (((((a->d[i]) >> 60) & 8) << 3) | ((((a->d[i]) >> 60) & 4) << 2) | ((((a->d[i]) >> 60) & 2) << 1) | (((a->d[i]) >> 60) & 1)) << 56 | (((((a->d[i]) >> 56) & 8) << 3) | ((((a->d[i]) >> 56) & 4) << 2) | ((((a->d[i]) >> 56) & 2) << 1) | (((a->d[i]) >> 56) & 1)) << 48 | (((((a->d[i]) >> 52) & 8) << 3) | ((((a->d[i]) >> 52) & 4) << 2) | ((((a->d[i]) >> 52) & 2) << 1) | (((a->d[i]) >> 52) & 1)) << 40 | (((((a->d[i]) >> 48) & 8) << 3) | ((((a->d[i]) >> 48) & 4) << 2) | ((((a->d[i]) >> 48) & 2) << 1) | (((a->d[i]) >> 48) & 1)) << 32 | (((((a->d[i]) >> 44) & 8) << 3) | ((((a->d[i]) >> 44) & 4) << 2) | ((((a->d[i]) >> 44) & 2) << 1) | (((a->d[i]) >> 44) & 1)) << 24 | (((((a->d[i]) >> 40) & 8) << 3) | ((((a->d[i]) >> 40) & 4) << 2) | ((((a->d[i]) >> 40) & 2) << 1) | (((a->d[i]) >> 40) & 1)) << 16 | (((((a->d[i]) >> 36) & 8) << 3) | ((((a->d[i]) >> 36) & 4) << 2) | ((((a->d[i]) >> 36) & 2) << 1) | (((a->d[i]) >> 36) & 1)) << 8 | (((((a->d[i]) >> 32) & 8) << 3) | ((((a->d[i]) >> 32) & 4) << 2) | ((((a->d[i]) >> 32) & 2) << 1) | (((a->d[i]) >> 32) & 1));-
254 s->d[2 * i] = (((((a->d[i]) >> 28) & 8) << 3) | ((((a->d[i]) >> 28) & 4) << 2) | ((((a->d[i]) >> 28) & 2) << 1) | (((a->d[i]) >> 28) & 1)) << 56 | (((((a->d[i]) >> 24) & 8) << 3) | ((((a->d[i]) >> 24) & 4) << 2) | ((((a->d[i]) >> 24) & 2) << 1) | (((a->d[i]) >> 24) & 1)) << 48 | (((((a->d[i]) >> 20) & 8) << 3) | ((((a->d[i]) >> 20) & 4) << 2) | ((((a->d[i]) >> 20) & 2) << 1) | (((a->d[i]) >> 20) & 1)) << 40 | (((((a->d[i]) >> 16) & 8) << 3) | ((((a->d[i]) >> 16) & 4) << 2) | ((((a->d[i]) >> 16) & 2) << 1) | (((a->d[i]) >> 16) & 1)) << 32 | (((((a->d[i]) >> 12) & 8) << 3) | ((((a->d[i]) >> 12) & 4) << 2) | ((((a->d[i]) >> 12) & 2) << 1) | (((a->d[i]) >> 12) & 1)) << 24 | (((((a->d[i]) >> 8) & 8) << 3) | ((((a->d[i]) >> 8) & 4) << 2) | ((((a->d[i]) >> 8) & 2) << 1) | (((a->d[i]) >> 8) & 1)) << 16 | (((((a->d[i]) >> 4) & 8) << 3) | ((((a->d[i]) >> 4) & 4) << 2) | ((((a->d[i]) >> 4) & 2) << 1) | (((a->d[i]) >> 4) & 1)) << 8 | (((((a->d[i])) & 8) << 3) | ((((a->d[i])) & 4) << 2) | ((((a->d[i])) & 2) << 1) | (((a->d[i])) & 1));-
255 }
executed 204697073 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
204697073
256-
257 s->top = 2 * a->top;-
258 bn_correct_top(s);-
259 if (!BN_GF2m_mod_arr(r, s, p)
!BN_GF2m_mod_arr(r, s, p)Description
TRUEnever evaluated
FALSEevaluated 35053540 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-35053540
260 goto
never executed: goto err;
err;
never executed: goto err;
0
261 ;-
262 ret = 1;-
263 err:
code before this statement executed 35053540 times by 1 test: err:
Executed by:
  • libcrypto.so.1.1
35053540
264 BN_CTX_end(ctx);-
265 return
executed 35053540 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 35053540 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
35053540
266}-
267-
268-
269-
270-
271-
272-
273-
274int BN_GF2m_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)-
275{-
276 int ret = 0;-
277 const int max = BN_num_bits(p) + 1;-
278 int *arr = -
279 ((void *)0)-
280 ;-
281-
282 ;-
283 ;-
284 if ((
(arr = CRYPTO_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 495 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
arr = CRYPTO_malloc(sizeof(*arr) * max, __FILE__, 532)) ==
(arr = CRYPTO_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 495 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-495
285 ((void *)0)
(arr = CRYPTO_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 495 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-495
286 )-
287 goto
never executed: goto err;
err;
never executed: goto err;
0
288 ret = BN_GF2m_poly2arr(p, arr, max);-
289 if (!ret
!retDescription
TRUEnever evaluated
FALSEevaluated 495 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| ret > max
ret > maxDescription
TRUEnever evaluated
FALSEevaluated 495 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-495
290 ERR_put_error(3,(136),(106),__FILE__,536);-
291 goto
never executed: goto err;
err;
never executed: goto err;
0
292 }-
293 ret = BN_GF2m_mod_sqr_arr(r, a, arr, ctx);-
294 ;-
295 err:
code before this statement executed 495 times by 1 test: err:
Executed by:
  • libcrypto.so.1.1
495
296 CRYPTO_free(arr, __FILE__, 542);-
297 return
executed 495 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 495 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
495
298}-
299-
300-
301-
302-
303-
304-
305-
306static int BN_GF2m_mod_inv_vartime(BIGNUM *r, const BIGNUM *a,-
307 const BIGNUM *p, BN_CTX *ctx)-
308{-
309 BIGNUM *b, *c = -
310 ((void *)0)-
311 , *u = -
312 ((void *)0)-
313 , *v = -
314 ((void *)0)-
315 , *tmp;-
316 int ret = 0;-
317-
318 ;-
319 ;-
320-
321 BN_CTX_start(ctx);-
322-
323 b = BN_CTX_get(ctx);-
324 c = BN_CTX_get(ctx);-
325 u = BN_CTX_get(ctx);-
326 v = BN_CTX_get(ctx);-
327 if (v ==
v == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 73387 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-73387
328 ((void *)0)
v == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 73387 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-73387
329 )-
330 goto
never executed: goto err;
err;
never executed: goto err;
0
331-
332 if (!BN_GF2m_mod(u, a, p)
!BN_GF2m_mod(u, a, p)Description
TRUEnever evaluated
FALSEevaluated 73387 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-73387
333 goto
never executed: goto err;
err;
never executed: goto err;
0
334 if (BN_is_zero(u)
BN_is_zero(u)Description
TRUEevaluated 76 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 73311 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
76-73311
335 goto
executed 76 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 76 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
76
336-
337 if (!BN_copy(v, p)
!BN_copy(v, p)Description
TRUEnever evaluated
FALSEevaluated 73311 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-73311
338 goto
never executed: goto err;
err;
never executed: goto err;
0
339 {-
340 int i;-
341 int ubits = BN_num_bits(u);-
342 int vbits = BN_num_bits(v);-
343 int top = p->top;-
344 unsigned long *udp, *bdp, *vdp, *cdp;-
345-
346 if (!bn_wexpand(u, top)
!bn_wexpand(u, top)Description
TRUEnever evaluated
FALSEevaluated 73311 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-73311
347 goto
never executed: goto err;
err;
never executed: goto err;
0
348 udp = u->d;-
349 for (i = u->top; i < top
i < topDescription
TRUEevaluated 1290 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 73311 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++)
1290-73311
350 udp[i] = 0;
executed 1290 times by 1 test: udp[i] = 0;
Executed by:
  • libcrypto.so.1.1
1290
351 u->top = top;-
352 if (!bn_wexpand(b, top)
!bn_wexpand(b, top)Description
TRUEnever evaluated
FALSEevaluated 73311 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-73311
353 goto
never executed: goto err;
err;
never executed: goto err;
0
354 bdp = b->d;-
355 bdp[0] = 1;-
356 for (i = 1; i < top
i < topDescription
TRUEevaluated 309743 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 73311 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++)
73311-309743
357 bdp[i] = 0;
executed 309743 times by 1 test: bdp[i] = 0;
Executed by:
  • libcrypto.so.1.1
309743
358 b->top = top;-
359 if (!bn_wexpand(c, top)
!bn_wexpand(c, top)Description
TRUEnever evaluated
FALSEevaluated 73311 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-73311
360 goto
never executed: goto err;
err;
never executed: goto err;
0
361 cdp = c->d;-
362 for (i = 0; i < top
i < topDescription
TRUEevaluated 383054 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 73311 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++)
73311-383054
363 cdp[i] = 0;
executed 383054 times by 1 test: cdp[i] = 0;
Executed by:
  • libcrypto.so.1.1
383054
364 c->top = top;-
365 vdp = v->d;-
366-
367-
368-
369 while (1) {-
370 while (ubits
ubitsDescription
TRUEevaluated 56610033 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& !(udp[0] & 1)
!(udp[0] & 1)Description
TRUEevaluated 37712320 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 18897713 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
1-56610033
371 unsigned long u0, u1, b0, b1, mask;-
372-
373 u0 = udp[0];-
374 b0 = bdp[0];-
375 mask = (unsigned long)0 - (b0 & 1);-
376 b0 ^= p->d[0] & mask;-
377 for (i = 0; i < top - 1
i < top - 1Description
TRUEevaluated 200342146 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 37712320 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++) {
37712320-200342146
378 u1 = udp[i + 1];-
379 udp[i] = ((u0 >> 1) | (u1 << ((8 * 8) - 1))) & (0xffffffffffffffffL);-
380 u0 = u1;-
381 b1 = bdp[i + 1] ^ (p->d[i + 1] & mask);-
382 bdp[i] = ((b0 >> 1) | (b1 << ((8 * 8) - 1))) & (0xffffffffffffffffL);-
383 b0 = b1;-
384 }
executed 200342146 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
200342146
385 udp[i] = u0 >> 1;-
386 bdp[i] = b0 >> 1;-
387 ubits--;-
388 }
executed 37712320 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
37712320
389-
390 if (ubits <= (8 * 8)
ubits <= (8 * 8)Description
TRUEevaluated 3820696 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 15077018 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
3820696-15077018
391 if (udp[0] == 0
udp[0] == 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3820695 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
1-3820695
392 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
393 if (udp[0] == 1
udp[0] == 1Description
TRUEevaluated 73310 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3747385 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
73310-3747385
394 break;
executed 73310 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
73310
395 }
executed 3747385 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
3747385
396-
397 if (ubits < vbits
ubits < vbitsDescription
TRUEevaluated 7566193 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 11258210 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
7566193-11258210
398 i = ubits;-
399 ubits = vbits;-
400 vbits = i;-
401 tmp = u;-
402 u = v;-
403 v = tmp;-
404 tmp = b;-
405 b = c;-
406 c = tmp;-
407 udp = vdp;-
408 vdp = v->d;-
409 bdp = cdp;-
410 cdp = c->d;-
411 }
executed 7566193 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
7566193
412 for (i = 0; i < top
i < topDescription
TRUEevaluated 118896530 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 18824403 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++) {
18824403-118896530
413 udp[i] ^= vdp[i];-
414 bdp[i] ^= cdp[i];-
415 }
executed 118896530 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
118896530
416 if (ubits == vbits
ubits == vbitsDescription
TRUEevaluated 3761280 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 15063123 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
3761280-15063123
417 unsigned long ul;-
418 int utop = (ubits - 1) / (8 * 8);-
419-
420 while ((
(ul = udp[utop]) == 0Description
TRUEevaluated 103267 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3761279 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
ul = udp[utop]) == 0
(ul = udp[utop]) == 0Description
TRUEevaluated 103267 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3761279 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& utop
utopDescription
TRUEevaluated 103266 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
1-3761279
421 utop--;
executed 103266 times by 1 test: utop--;
Executed by:
  • libcrypto.so.1.1
103266
422 ubits = utop * (8 * 8) + BN_num_bits_word(ul);-
423 }
executed 3761280 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
3761280
424 }
executed 18824403 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
18824403
425 bn_correct_top(b);-
426 }-
427-
428-
429 if (!BN_copy(r, b)
!BN_copy(r, b)Description
TRUEnever evaluated
FALSEevaluated 73310 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-73310
430 goto
never executed: goto err;
err;
never executed: goto err;
0
431 ;-
432 ret = 1;-
433-
434 err:
code before this statement executed 73310 times by 1 test: err:
Executed by:
  • libcrypto.so.1.1
73310
435-
436-
437-
438-
439-
440-
441 BN_CTX_end(ctx);-
442 return
executed 73387 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 73387 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
73387
443}-
444-
445-
446-
447-
448-
449-
450int BN_GF2m_mod_inv(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)-
451{-
452 BIGNUM *b = -
453 ((void *)0)-
454 ;-
455 int ret = 0;-
456-
457 BN_CTX_start(ctx);-
458 if ((
(b = BN_CTX_ge...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 73387 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
b = BN_CTX_get(ctx)) ==
(b = BN_CTX_ge...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 73387 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-73387
459 ((void *)0)
(b = BN_CTX_ge...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 73387 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-73387
460 )-
461 goto
never executed: goto err;
err;
never executed: goto err;
0
462-
463-
464 do {-
465 if (!BN_priv_rand(b, BN_num_bits(p) - 1,
!BN_priv_rand(...p) - 1, -1, 0)Description
TRUEnever evaluated
FALSEevaluated 73387 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-73387
466 -1, 0)
!BN_priv_rand(...p) - 1, -1, 0)Description
TRUEnever evaluated
FALSEevaluated 73387 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-73387
467 goto
never executed: goto err;
err;
never executed: goto err;
0
468 }
executed 73387 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
while (BN_is_zero(b)
BN_is_zero(b)Description
TRUEnever evaluated
FALSEevaluated 73387 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
);
0-73387
469-
470-
471 if (!BN_GF2m_mod_mul(r, a, b, p, ctx)
!BN_GF2m_mod_m... a, b, p, ctx)Description
TRUEnever evaluated
FALSEevaluated 73387 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-73387
472 goto
never executed: goto err;
err;
never executed: goto err;
0
473-
474-
475 if (!BN_GF2m_mod_inv_vartime(r, r, p, ctx)
!BN_GF2m_mod_i...(r, r, p, ctx)Description
TRUEevaluated 77 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 73310 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
77-73310
476 goto
executed 77 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 77 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
77
477-
478-
479 if (!BN_GF2m_mod_mul(r, r, b, p, ctx)
!BN_GF2m_mod_m... r, b, p, ctx)Description
TRUEnever evaluated
FALSEevaluated 73310 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-73310
480 goto
never executed: goto err;
err;
never executed: goto err;
0
481-
482 ret = 1;-
483-
484 err:
code before this statement executed 73310 times by 1 test: err:
Executed by:
  • libcrypto.so.1.1
73310
485 BN_CTX_end(ctx);-
486 return
executed 73387 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 73387 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
73387
487}-
488-
489-
490-
491-
492-
493-
494-
495int BN_GF2m_mod_inv_arr(BIGNUM *r, const BIGNUM *xx, const int p[],-
496 BN_CTX *ctx)-
497{-
498 BIGNUM *field;-
499 int ret = 0;-
500-
501 ;-
502 BN_CTX_start(ctx);-
503 if ((
(field = BN_CT...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
field = BN_CTX_get(ctx)) ==
(field = BN_CT...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
504 ((void *)0)
(field = BN_CT...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
505 )-
506 goto
never executed: goto err;
err;
never executed: goto err;
0
507 if (!BN_GF2m_arr2poly(p, field)
!BN_GF2m_arr2poly(p, field)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
508 goto
never executed: goto err;
err;
never executed: goto err;
0
509-
510 ret = BN_GF2m_mod_inv(r, xx, field, ctx);-
511 ;-
512-
513 err:
code before this statement never executed: err:
0
514 BN_CTX_end(ctx);-
515 return
never executed: return ret;
ret;
never executed: return ret;
0
516}-
517-
518-
519-
520-
521-
522int BN_GF2m_mod_div(BIGNUM *r, const BIGNUM *y, const BIGNUM *x,-
523 const BIGNUM *p, BN_CTX *ctx)-
524{-
525 BIGNUM *xinv = -
526 ((void *)0)-
527 ;-
528 int ret = 0;-
529-
530 ;-
531 ;-
532 ;-
533-
534 BN_CTX_start(ctx);-
535 xinv = BN_CTX_get(ctx);-
536 if (xinv ==
xinv == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 71565 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-71565
537 ((void *)0)
xinv == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 71565 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-71565
538 )-
539 goto
never executed: goto err;
err;
never executed: goto err;
0
540-
541 if (!BN_GF2m_mod_inv(xinv, x, p, ctx)
!BN_GF2m_mod_i...nv, x, p, ctx)Description
TRUEevaluated 77 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 71488 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
77-71488
542 goto
executed 77 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 77 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
77
543 if (!BN_GF2m_mod_mul(r, y, xinv, p, ctx)
!BN_GF2m_mod_m... xinv, p, ctx)Description
TRUEnever evaluated
FALSEevaluated 71488 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-71488
544 goto
never executed: goto err;
err;
never executed: goto err;
0
545 ;-
546 ret = 1;-
547-
548 err:
code before this statement executed 71488 times by 1 test: err:
Executed by:
  • libcrypto.so.1.1
71488
549 BN_CTX_end(ctx);-
550 return
executed 71565 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 71565 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
71565
551}-
552-
553-
554-
555-
556-
557-
558-
559int BN_GF2m_mod_div_arr(BIGNUM *r, const BIGNUM *yy, const BIGNUM *xx,-
560 const int p[], BN_CTX *ctx)-
561{-
562 BIGNUM *field;-
563 int ret = 0;-
564-
565 ;-
566 ;-
567-
568 BN_CTX_start(ctx);-
569 if ((
(field = BN_CT...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
field = BN_CTX_get(ctx)) ==
(field = BN_CT...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
570 ((void *)0)
(field = BN_CT...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
571 )-
572 goto
never executed: goto err;
err;
never executed: goto err;
0
573 if (!BN_GF2m_arr2poly(p, field)
!BN_GF2m_arr2poly(p, field)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
574 goto
never executed: goto err;
err;
never executed: goto err;
0
575-
576 ret = BN_GF2m_mod_div(r, yy, xx, field, ctx);-
577 ;-
578-
579 err:
code before this statement never executed: err:
0
580 BN_CTX_end(ctx);-
581 return
never executed: return ret;
ret;
never executed: return ret;
0
582}-
583-
584-
585-
586-
587-
588-
589int BN_GF2m_mod_exp_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,-
590 const int p[], BN_CTX *ctx)-
591{-
592 int ret = 0, i, n;-
593 BIGNUM *u;-
594-
595 ;-
596 ;-
597-
598 if (BN_is_zero(b)
BN_is_zero(b)Description
TRUEnever evaluated
FALSEevaluated 1911 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1911
599 return
never executed: return (BN_set_word((r),1));
(BN_set_word((r),1));
never executed: return (BN_set_word((r),1));
0
600-
601 if (BN_abs_is_word(b, 1)
BN_abs_is_word(b, 1)Description
TRUEnever evaluated
FALSEevaluated 1911 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1911
602 return
never executed: return (BN_copy(r, a) != ((void *)0) );
(BN_copy(r, a) !=
never executed: return (BN_copy(r, a) != ((void *)0) );
0
603 ((void *)0)
never executed: return (BN_copy(r, a) != ((void *)0) );
0
604 );
never executed: return (BN_copy(r, a) != ((void *)0) );
0
605-
606 BN_CTX_start(ctx);-
607 if ((
(u = BN_CTX_ge...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 1911 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
u = BN_CTX_get(ctx)) ==
(u = BN_CTX_ge...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 1911 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1911
608 ((void *)0)
(u = BN_CTX_ge...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 1911 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1911
609 )-
610 goto
never executed: goto err;
err;
never executed: goto err;
0
611-
612 if (!BN_GF2m_mod_arr(u, a, p)
!BN_GF2m_mod_arr(u, a, p)Description
TRUEnever evaluated
FALSEevaluated 1911 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1911
613 goto
never executed: goto err;
err;
never executed: goto err;
0
614-
615 n = BN_num_bits(b) - 1;-
616 for (i = n - 1; i >= 0
i >= 0Description
TRUEevaluated 469957 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1911 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i--) {
1911-469957
617 if (!BN_GF2m_mod_sqr_arr(u, u, p, ctx)
!BN_GF2m_mod_s...(u, u, p, ctx)Description
TRUEnever evaluated
FALSEevaluated 469957 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-469957
618 goto
never executed: goto err;
err;
never executed: goto err;
0
619 if (BN_is_bit_set(b, i)
BN_is_bit_set(b, i)Description
TRUEevaluated 156042 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 313915 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
156042-313915
620 if (!BN_GF2m_mod_mul_arr(u, u, a, p, ctx)
!BN_GF2m_mod_m... u, a, p, ctx)Description
TRUEnever evaluated
FALSEevaluated 156042 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-156042
621 goto
never executed: goto err;
err;
never executed: goto err;
0
622 }
executed 156042 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
156042
623 }
executed 469957 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
469957
624 if (!BN_copy(r, u)
!BN_copy(r, u)Description
TRUEnever evaluated
FALSEevaluated 1911 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1911
625 goto
never executed: goto err;
err;
never executed: goto err;
0
626 ;-
627 ret = 1;-
628 err:
code before this statement executed 1911 times by 1 test: err:
Executed by:
  • libcrypto.so.1.1
1911
629 BN_CTX_end(ctx);-
630 return
executed 1911 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 1911 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
1911
631}-
632-
633-
634-
635-
636-
637-
638-
639int BN_GF2m_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,-
640 const BIGNUM *p, BN_CTX *ctx)-
641{-
642 int ret = 0;-
643 const int max = BN_num_bits(p) + 1;-
644 int *arr = -
645 ((void *)0)-
646 ;-
647 ;-
648 ;-
649 ;-
650 if ((
(arr = CRYPTO_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 600 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
arr = CRYPTO_malloc(sizeof(*arr) * max, __FILE__, 906)) ==
(arr = CRYPTO_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 600 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-600
651 ((void *)0)
(arr = CRYPTO_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 600 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-600
652 )-
653 goto
never executed: goto err;
err;
never executed: goto err;
0
654 ret = BN_GF2m_poly2arr(p, arr, max);-
655 if (!ret
!retDescription
TRUEnever evaluated
FALSEevaluated 600 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| ret > max
ret > maxDescription
TRUEnever evaluated
FALSEevaluated 600 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-600
656 ERR_put_error(3,(132),(106),__FILE__,910);-
657 goto
never executed: goto err;
err;
never executed: goto err;
0
658 }-
659 ret = BN_GF2m_mod_exp_arr(r, a, b, arr, ctx);-
660 ;-
661 err:
code before this statement executed 600 times by 1 test: err:
Executed by:
  • libcrypto.so.1.1
600
662 CRYPTO_free(arr, __FILE__, 916);-
663 return
executed 600 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 600 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
600
664}-
665-
666-
667-
668-
669-
670int BN_GF2m_mod_sqrt_arr(BIGNUM *r, const BIGNUM *a, const int p[],-
671 BN_CTX *ctx)-
672{-
673 int ret = 0;-
674 BIGNUM *u;-
675-
676 ;-
677-
678 if (!p[0]
!p[0]Description
TRUEnever evaluated
FALSEevaluated 1311 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-1311
679-
680 (BN_set_word((r),0));-
681 return
never executed: return 1;
1;
never executed: return 1;
0
682 }-
683-
684 BN_CTX_start(ctx);-
685 if ((
(u = BN_CTX_ge...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 1311 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
u = BN_CTX_get(ctx)) ==
(u = BN_CTX_ge...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 1311 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1311
686 ((void *)0)
(u = BN_CTX_ge...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 1311 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1311
687 )-
688 goto
never executed: goto err;
err;
never executed: goto err;
0
689-
690 if (!BN_set_bit(u, p[0] - 1)
!BN_set_bit(u, p[0] - 1)Description
TRUEnever evaluated
FALSEevaluated 1311 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1311
691 goto
never executed: goto err;
err;
never executed: goto err;
0
692 ret = BN_GF2m_mod_exp_arr(r, a, u, p, ctx);-
693 ;-
694-
695 err:
code before this statement executed 1311 times by 1 test: err:
Executed by:
  • libcrypto.so.1.1
1311
696 BN_CTX_end(ctx);-
697 return
executed 1311 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 1311 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
1311
698}-
699-
700-
701-
702-
703-
704-
705-
706int BN_GF2m_mod_sqrt(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)-
707{-
708 int ret = 0;-
709 const int max = BN_num_bits(p) + 1;-
710 int *arr = -
711 ((void *)0)-
712 ;-
713 ;-
714 ;-
715 if ((
(arr = CRYPTO_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 200 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
arr = CRYPTO_malloc(sizeof(*arr) * max, __FILE__, 965)) ==
(arr = CRYPTO_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 200 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-200
716 ((void *)0)
(arr = CRYPTO_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 200 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-200
717 )-
718 goto
never executed: goto err;
err;
never executed: goto err;
0
719 ret = BN_GF2m_poly2arr(p, arr, max);-
720 if (!ret
!retDescription
TRUEnever evaluated
FALSEevaluated 200 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| ret > max
ret > maxDescription
TRUEnever evaluated
FALSEevaluated 200 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-200
721 ERR_put_error(3,(137),(106),__FILE__,969);-
722 goto
never executed: goto err;
err;
never executed: goto err;
0
723 }-
724 ret = BN_GF2m_mod_sqrt_arr(r, a, arr, ctx);-
725 ;-
726 err:
code before this statement executed 200 times by 1 test: err:
Executed by:
  • libcrypto.so.1.1
200
727 CRYPTO_free(arr, __FILE__, 975);-
728 return
executed 200 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 200 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
200
729}-
730-
731-
732-
733-
734-
735int BN_GF2m_mod_solve_quad_arr(BIGNUM *r, const BIGNUM *a_, const int p[],-
736 BN_CTX *ctx)-
737{-
738 int ret = 0, count = 0, j;-
739 BIGNUM *a, *z, *rho, *w, *w2, *tmp;-
740-
741 ;-
742-
743 if (!p[0]
!p[0]Description
TRUEnever evaluated
FALSEevaluated 5134 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-5134
744-
745 (BN_set_word((r),0));-
746 return
never executed: return 1;
1;
never executed: return 1;
0
747 }-
748-
749 BN_CTX_start(ctx);-
750 a = BN_CTX_get(ctx);-
751 z = BN_CTX_get(ctx);-
752 w = BN_CTX_get(ctx);-
753 if (w ==
w == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 5134 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-5134
754 ((void *)0)
w == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 5134 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-5134
755 )-
756 goto
never executed: goto err;
err;
never executed: goto err;
0
757-
758 if (!BN_GF2m_mod_arr(a, a_, p)
!BN_GF2m_mod_arr(a, a_, p)Description
TRUEnever evaluated
FALSEevaluated 5134 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-5134
759 goto
never executed: goto err;
err;
never executed: goto err;
0
760-
761 if (BN_is_zero(a)
BN_is_zero(a)Description
TRUEevaluated 98 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5036 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
98-5036
762 (BN_set_word((r),0));-
763 ret = 1;-
764 goto
executed 98 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 98 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
98
765 }-
766-
767 if (p[0] & 0x1
p[0] & 0x1Description
TRUEevaluated 3091 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1945 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
1945-3091
768-
769 if (!BN_copy(z, a)
!BN_copy(z, a)Description
TRUEnever evaluated
FALSEevaluated 3091 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-3091
770 goto
never executed: goto err;
err;
never executed: goto err;
0
771 for (j = 1; j <= (p[0] - 1) / 2
j <= (p[0] - 1) / 2Description
TRUEevaluated 235273 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3091 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; j++) {
3091-235273
772 if (!BN_GF2m_mod_sqr_arr(z, z, p, ctx)
!BN_GF2m_mod_s...(z, z, p, ctx)Description
TRUEnever evaluated
FALSEevaluated 235273 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-235273
773 goto
never executed: goto err;
err;
never executed: goto err;
0
774 if (!BN_GF2m_mod_sqr_arr(z, z, p, ctx)
!BN_GF2m_mod_s...(z, z, p, ctx)Description
TRUEnever evaluated
FALSEevaluated 235273 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-235273
775 goto
never executed: goto err;
err;
never executed: goto err;
0
776 if (!BN_GF2m_add(z, z, a)
!BN_GF2m_add(z, z, a)Description
TRUEnever evaluated
FALSEevaluated 235273 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-235273
777 goto
never executed: goto err;
err;
never executed: goto err;
0
778 }
executed 235273 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
235273
779-
780 }
executed 3091 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
3091
781-
782 rho = BN_CTX_get(ctx);-
783 w2 = BN_CTX_get(ctx);-
784 tmp = BN_CTX_get(ctx);-
785 if (tmp ==
tmp == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 1945 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1945
786 ((void *)0)
tmp == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 1945 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1945
787 )-
788 goto
never executed: goto err;
err;
never executed: goto err;
0
789 do {-
790 if (!BN_priv_rand(rho, p[0], 0, 0)
!BN_priv_rand(rho, p[0], 0, 0)Description
TRUEnever evaluated
FALSEevaluated 42664 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-42664
791 goto
never executed: goto err;
err;
never executed: goto err;
0
792 if (!BN_GF2m_mod_arr(rho, rho, p)
!BN_GF2m_mod_arr(rho, rho, p)Description
TRUEnever evaluated
FALSEevaluated 42664 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-42664
793 goto
never executed: goto err;
err;
never executed: goto err;
0
794 (BN_set_word((z),0));-
795 if (!BN_copy(w, rho)
!BN_copy(w, rho)Description
TRUEnever evaluated
FALSEevaluated 42664 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-42664
796 goto
never executed: goto err;
err;
never executed: goto err;
0
797 for (j = 1; j <= p[0] - 1
j <= p[0] - 1Description
TRUEevaluated 15583288 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 42664 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; j++) {
42664-15583288
798 if (!BN_GF2m_mod_sqr_arr(z, z, p, ctx)
!BN_GF2m_mod_s...(z, z, p, ctx)Description
TRUEnever evaluated
FALSEevaluated 15583288 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-15583288
799 goto
never executed: goto err;
err;
never executed: goto err;
0
800 if (!BN_GF2m_mod_sqr_arr(w2, w, p, ctx)
!BN_GF2m_mod_s...w2, w, p, ctx)Description
TRUEnever evaluated
FALSEevaluated 15583288 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-15583288
801 goto
never executed: goto err;
err;
never executed: goto err;
0
802 if (!BN_GF2m_mod_mul_arr(tmp, w2, a, p, ctx)
!BN_GF2m_mod_m...w2, a, p, ctx)Description
TRUEnever evaluated
FALSEevaluated 15583288 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-15583288
803 goto
never executed: goto err;
err;
never executed: goto err;
0
804 if (!BN_GF2m_add(z, z, tmp)
!BN_GF2m_add(z, z, tmp)Description
TRUEnever evaluated
FALSEevaluated 15583288 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-15583288
805 goto
never executed: goto err;
err;
never executed: goto err;
0
806 if (!BN_GF2m_add(w, w2, rho)
!BN_GF2m_add(w, w2, rho)Description
TRUEnever evaluated
FALSEevaluated 15583288 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-15583288
807 goto
never executed: goto err;
err;
never executed: goto err;
0
808 }
executed 15583288 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
15583288
809 count++;-
810 }
executed 42664 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
while (BN_is_zero(w)
BN_is_zero(w)Description
TRUEevaluated 41550 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1114 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& (
(count < 50)Description
TRUEevaluated 40719 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 831 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
count < 50)
(count < 50)Description
TRUEevaluated 40719 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 831 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
);
831-42664
811 if (BN_is_zero(w)
BN_is_zero(w)Description
TRUEevaluated 831 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1114 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
831-1114
812 ERR_put_error(3,(135),(113),__FILE__,1056);-
813 goto
executed 831 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 831 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
831
814 }-
815 }
executed 1114 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
1114
816-
817 if (!BN_GF2m_mod_sqr_arr(w, z, p, ctx)
!BN_GF2m_mod_s...(w, z, p, ctx)Description
TRUEnever evaluated
FALSEevaluated 4205 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-4205
818 goto
never executed: goto err;
err;
never executed: goto err;
0
819 if (!BN_GF2m_add(w, z, w)
!BN_GF2m_add(w, z, w)Description
TRUEnever evaluated
FALSEevaluated 4205 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-4205
820 goto
never executed: goto err;
err;
never executed: goto err;
0
821 if (BN_ucmp((w), (a))
BN_ucmp((w), (a))Description
TRUEevaluated 1588 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2617 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
1588-2617
822 ERR_put_error(3,(135),(116),__FILE__,1066);-
823 goto
executed 1588 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 1588 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
1588
824 }-
825-
826 if (!BN_copy(r, z)
!BN_copy(r, z)Description
TRUEnever evaluated
FALSEevaluated 2617 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-2617
827 goto
never executed: goto err;
err;
never executed: goto err;
0
828 ;-
829-
830 ret = 1;-
831-
832 err:
code before this statement executed 2617 times by 1 test: err:
Executed by:
  • libcrypto.so.1.1
2617
833 BN_CTX_end(ctx);-
834 return
executed 5134 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 5134 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
5134
835}-
836-
837-
838-
839-
840-
841-
842-
843int BN_GF2m_mod_solve_quad(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,-
844 BN_CTX *ctx)-
845{-
846 int ret = 0;-
847 const int max = BN_num_bits(p) + 1;-
848 int *arr = -
849 ((void *)0)-
850 ;-
851 ;-
852 ;-
853 if ((
(arr = CRYPTO_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 200 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
arr = CRYPTO_malloc(sizeof(*arr) * max, __FILE__, 1095)) ==
(arr = CRYPTO_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 200 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-200
854 ((void *)0)
(arr = CRYPTO_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 200 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-200
855 )-
856 goto
never executed: goto err;
err;
never executed: goto err;
0
857 ret = BN_GF2m_poly2arr(p, arr, max);-
858 if (!ret
!retDescription
TRUEnever evaluated
FALSEevaluated 200 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| ret > max
ret > maxDescription
TRUEnever evaluated
FALSEevaluated 200 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-200
859 ERR_put_error(3,(134),(106),__FILE__,1099);-
860 goto
never executed: goto err;
err;
never executed: goto err;
0
861 }-
862 ret = BN_GF2m_mod_solve_quad_arr(r, a, arr, ctx);-
863 ;-
864 err:
code before this statement executed 200 times by 1 test: err:
Executed by:
  • libcrypto.so.1.1
200
865 CRYPTO_free(arr, __FILE__, 1105);-
866 return
executed 200 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 200 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
200
867}-
868int BN_GF2m_poly2arr(const BIGNUM *a, int p[], int max)-
869{-
870 int i, j, k = 0;-
871 unsigned long mask;-
872-
873 if (BN_is_zero(a)
BN_is_zero(a)Description
TRUEnever evaluated
FALSEevaluated 304793 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-304793
874 return
never executed: return 0;
0;
never executed: return 0;
0
875-
876 for (i = a->top - 1; i >= 0
i >= 0Description
TRUEevaluated 1572388 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 304793 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i--) {
304793-1572388
877 if (!a->d[i]
!a->d[i]Description
TRUEevaluated 859778 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 712610 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
712610-859778
878-
879 continue;
executed 859778 times by 1 test: continue;
Executed by:
  • libcrypto.so.1.1
859778
880 mask = ((unsigned long)1 << ((8 * 8) - 1));-
881 for (j = (8 * 8) - 1; j >= 0
j >= 0Description
TRUEevaluated 45607040 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 712610 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; j--) {
712610-45607040
882 if (a->d[i] & mask
a->d[i] & maskDescription
TRUEevaluated 1226623 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 44380417 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
1226623-44380417
883 if (k < max
k < maxDescription
TRUEevaluated 1226623 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
)
0-1226623
884 p[k] = (8 * 8) * i + j;
executed 1226623 times by 1 test: p[k] = (8 * 8) * i + j;
Executed by:
  • libcrypto.so.1.1
1226623
885 k++;-
886 }
executed 1226623 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
1226623
887 mask >>= 1;-
888 }
executed 45607040 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
45607040
889 }
executed 712610 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
712610
890-
891 if (k < max
k < maxDescription
TRUEevaluated 304793 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-304793
892 p[k] = -1;-
893 k++;-
894 }
executed 304793 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
304793
895-
896 return
executed 304793 times by 1 test: return k;
Executed by:
  • libcrypto.so.1.1
k;
executed 304793 times by 1 test: return k;
Executed by:
  • libcrypto.so.1.1
304793
897}-
898-
899-
900-
901-
902-
903int BN_GF2m_arr2poly(const int p[], BIGNUM *a)-
904{-
905 int i;-
906-
907 ;-
908 (BN_set_word((a),0));-
909 for (i = 0; p[i] != -1
p[i] != -1Description
TRUEevaluated 64 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 16 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++) {
16-64
910 if (BN_set_bit(a, p[i]) == 0
BN_set_bit(a, p[i]) == 0Description
TRUEnever evaluated
FALSEevaluated 64 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-64
911 return
never executed: return 0;
0;
never executed: return 0;
0
912 }
executed 64 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
64
913 ;-
914-
915 return
executed 16 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 16 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
16
916}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2