OpenCoverage

ec2_smpl.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/ec/ec2_smpl.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9int ec_GF2m_simple_group_init(EC_GROUP *group)-
10{-
11 group->field = BN_new();-
12 group->a = BN_new();-
13 group->b = BN_new();-
14-
15 if (group->field ==
group->field == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 19489 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-19489
16 ((void *)0)
group->field == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 19489 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-19489
17 || group->a ==
group->a == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 19489 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-19489
18 ((void *)0)
group->a == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 19489 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-19489
19 || group->b ==
group->b == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 19489 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-19489
20 ((void *)0)
group->b == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 19489 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-19489
21 ) {-
22 BN_free(group->field);-
23 BN_free(group->a);-
24 BN_free(group->b);-
25 return
never executed: return 0;
0;
never executed: return 0;
0
26 }-
27 return
executed 19489 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 19489 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
19489
28}-
29-
30-
31-
32-
33-
34void ec_GF2m_simple_group_finish(EC_GROUP *group)-
35{-
36 BN_free(group->field);-
37 BN_free(group->a);-
38 BN_free(group->b);-
39}
executed 19488 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
19488
40-
41-
42-
43-
44-
45void ec_GF2m_simple_group_clear_finish(EC_GROUP *group)-
46{-
47 BN_clear_free(group->field);-
48 BN_clear_free(group->a);-
49 BN_clear_free(group->b);-
50 group->poly[0] = 0;-
51 group->poly[1] = 0;-
52 group->poly[2] = 0;-
53 group->poly[3] = 0;-
54 group->poly[4] = 0;-
55 group->poly[5] = -1;-
56}
executed 1 time by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
1
57-
58-
59-
60-
61-
62int ec_GF2m_simple_group_copy(EC_GROUP *dest, const EC_GROUP *src)-
63{-
64 if (!BN_copy(dest->field, src->field)
!BN_copy(dest-...d, src->field)Description
TRUEnever evaluated
FALSEevaluated 9858 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-9858
65 return
never executed: return 0;
0;
never executed: return 0;
0
66 if (!BN_copy(dest->a, src->a)
!BN_copy(dest->a, src->a)Description
TRUEnever evaluated
FALSEevaluated 9858 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-9858
67 return
never executed: return 0;
0;
never executed: return 0;
0
68 if (!BN_copy(dest->b, src->b)
!BN_copy(dest->b, src->b)Description
TRUEnever evaluated
FALSEevaluated 9858 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-9858
69 return
never executed: return 0;
0;
never executed: return 0;
0
70 dest->poly[0] = src->poly[0];-
71 dest->poly[1] = src->poly[1];-
72 dest->poly[2] = src->poly[2];-
73 dest->poly[3] = src->poly[3];-
74 dest->poly[4] = src->poly[4];-
75 dest->poly[5] = src->poly[5];-
76 if (bn_wexpand(dest->a, (int)(dest->poly[0] + (8 * 8) - 1) / (8 * 8)) ==
bn_wexpand(des...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 9858 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-9858
77
bn_wexpand(des...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 9858 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-9858
78 ((void *)0)
bn_wexpand(des...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 9858 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-9858
79 )-
80 return
never executed: return 0;
0;
never executed: return 0;
0
81 if (bn_wexpand(dest->b, (int)(dest->poly[0] + (8 * 8) - 1) / (8 * 8)) ==
bn_wexpand(des...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 9858 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-9858
82
bn_wexpand(des...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 9858 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-9858
83 ((void *)0)
bn_wexpand(des...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 9858 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-9858
84 )-
85 return
never executed: return 0;
0;
never executed: return 0;
0
86 bn_set_all_zero(dest->a);-
87 bn_set_all_zero(dest->b);-
88 return
executed 9858 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 9858 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
9858
89}-
90-
91-
92int ec_GF2m_simple_group_set_curve(EC_GROUP *group,-
93 const BIGNUM *p, const BIGNUM *a,-
94 const BIGNUM *b, BN_CTX *ctx)-
95{-
96 int ret = 0, i;-
97-
98-
99 if (!BN_copy(group->field, p)
!BN_copy(group->field, p)Description
TRUEnever evaluated
FALSEevaluated 9631 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-9631
100 goto
never executed: goto err;
err;
never executed: goto err;
0
101 i = BN_GF2m_poly2arr(group->field, group->poly, 6) - 1;-
102 if ((
(i != 5)Description
TRUEevaluated 5435 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4196 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
i != 5)
(i != 5)Description
TRUEevaluated 5435 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4196 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& (
(i != 3)Description
TRUEnever evaluated
FALSEevaluated 5435 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
i != 3)
(i != 3)Description
TRUEnever evaluated
FALSEevaluated 5435 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-5435
103 ERR_put_error(16,(195),(131),__FILE__,106);-
104 goto
never executed: goto err;
err;
never executed: goto err;
0
105 }-
106-
107-
108 if (!BN_GF2m_mod_arr(group->a, a, group->poly)
!BN_GF2m_mod_a..., group->poly)Description
TRUEnever evaluated
FALSEevaluated 9631 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-9631
109 goto
never executed: goto err;
err;
never executed: goto err;
0
110 if (bn_wexpand(group->a, (int)(group->poly[0] + (8 * 8) - 1) / (8 * 8))
bn_wexpand(gro...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 9631 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-9631
111 ==
bn_wexpand(gro...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 9631 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-9631
112 ((void *)0)
bn_wexpand(gro...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 9631 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-9631
113 )-
114 goto
never executed: goto err;
err;
never executed: goto err;
0
115 bn_set_all_zero(group->a);-
116-
117-
118 if (!BN_GF2m_mod_arr(group->b, b, group->poly)
!BN_GF2m_mod_a..., group->poly)Description
TRUEnever evaluated
FALSEevaluated 9631 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-9631
119 goto
never executed: goto err;
err;
never executed: goto err;
0
120 if (bn_wexpand(group->b, (int)(group->poly[0] + (8 * 8) - 1) / (8 * 8))
bn_wexpand(gro...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 9631 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-9631
121 ==
bn_wexpand(gro...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 9631 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-9631
122 ((void *)0)
bn_wexpand(gro...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 9631 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-9631
123 )-
124 goto
never executed: goto err;
err;
never executed: goto err;
0
125 bn_set_all_zero(group->b);-
126-
127 ret = 1;-
128 err:
code before this statement executed 9631 times by 1 test: err:
Executed by:
  • libcrypto.so.1.1
9631
129 return
executed 9631 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 9631 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
9631
130}-
131-
132-
133-
134-
135-
136int ec_GF2m_simple_group_get_curve(const EC_GROUP *group, BIGNUM *p,-
137 BIGNUM *a, BIGNUM *b, BN_CTX *ctx)-
138{-
139 int ret = 0;-
140-
141 if (p !=
p != ((void *)0)Description
TRUEevaluated 2025 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-2025
142 ((void *)0)
p != ((void *)0)Description
TRUEevaluated 2025 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-2025
143 ) {-
144 if (!BN_copy(p, group->field)
!BN_copy(p, group->field)Description
TRUEnever evaluated
FALSEevaluated 2025 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-2025
145 return
never executed: return 0;
0;
never executed: return 0;
0
146 }
executed 2025 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
2025
147-
148 if (a !=
a != ((void *)0)Description
TRUEevaluated 2025 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-2025
149 ((void *)0)
a != ((void *)0)Description
TRUEevaluated 2025 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-2025
150 ) {-
151 if (!BN_copy(a, group->a)
!BN_copy(a, group->a)Description
TRUEnever evaluated
FALSEevaluated 2025 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-2025
152 goto
never executed: goto err;
err;
never executed: goto err;
0
153 }
executed 2025 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
2025
154-
155 if (b !=
b != ((void *)0)Description
TRUEevaluated 2025 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-2025
156 ((void *)0)
b != ((void *)0)Description
TRUEevaluated 2025 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-2025
157 ) {-
158 if (!BN_copy(b, group->b)
!BN_copy(b, group->b)Description
TRUEnever evaluated
FALSEevaluated 2025 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-2025
159 goto
never executed: goto err;
err;
never executed: goto err;
0
160 }
executed 2025 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
2025
161-
162 ret = 1;-
163-
164 err:
code before this statement executed 2025 times by 1 test: err:
Executed by:
  • libcrypto.so.1.1
2025
165 return
executed 2025 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 2025 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
2025
166}-
167-
168-
169-
170-
171-
172int ec_GF2m_simple_group_get_degree(const EC_GROUP *group)-
173{-
174 return
executed 9626 times by 1 test: return BN_num_bits(group->field) - 1;
Executed by:
  • libcrypto.so.1.1
BN_num_bits(group->field) - 1;
executed 9626 times by 1 test: return BN_num_bits(group->field) - 1;
Executed by:
  • libcrypto.so.1.1
9626
175}-
176-
177-
178-
179-
180-
181int ec_GF2m_simple_group_check_discriminant(const EC_GROUP *group,-
182 BN_CTX *ctx)-
183{-
184 int ret = 0;-
185 BIGNUM *b;-
186 BN_CTX *new_ctx = -
187 ((void *)0)-
188 ;-
189-
190 if (ctx ==
ctx == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 122 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-122
191 ((void *)0)
ctx == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 122 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-122
192 ) {-
193 ctx = new_ctx = BN_CTX_new();-
194 if (ctx ==
ctx == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
195 ((void *)0)
ctx == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
196 ) {-
197 ERR_put_error(16,(159),((1|64)),__FILE__,185)-
198 ;-
199 goto
never executed: goto err;
err;
never executed: goto err;
0
200 }-
201 }
never executed: end of block
0
202 BN_CTX_start(ctx);-
203 b = BN_CTX_get(ctx);-
204 if (b ==
b == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 122 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-122
205 ((void *)0)
b == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 122 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-122
206 )-
207 goto
never executed: goto err;
err;
never executed: goto err;
0
208-
209 if (!BN_GF2m_mod_arr(b, group->b, group->poly)
!BN_GF2m_mod_a..., group->poly)Description
TRUEnever evaluated
FALSEevaluated 122 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-122
210 goto
never executed: goto err;
err;
never executed: goto err;
0
211-
212-
213-
214-
215-
216 if (BN_is_zero(b)
BN_is_zero(b)Description
TRUEnever evaluated
FALSEevaluated 122 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-122
217 goto
never executed: goto err;
err;
never executed: goto err;
0
218-
219 ret = 1;-
220-
221 err:
code before this statement executed 122 times by 1 test: err:
Executed by:
  • libcrypto.so.1.1
122
222 if (ctx !=
ctx != ((void *)0)Description
TRUEevaluated 122 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-122
223 ((void *)0)
ctx != ((void *)0)Description
TRUEevaluated 122 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-122
224 )-
225 BN_CTX_end(ctx);
executed 122 times by 1 test: BN_CTX_end(ctx);
Executed by:
  • libcrypto.so.1.1
122
226 BN_CTX_free(new_ctx);-
227 return
executed 122 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 122 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
122
228}-
229-
230-
231int ec_GF2m_simple_point_init(EC_POINT *point)-
232{-
233 point->X = BN_new();-
234 point->Y = BN_new();-
235 point->Z = BN_new();-
236-
237 if (point->X ==
point->X == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 49398 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-49398
238 ((void *)0)
point->X == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 49398 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-49398
239 || point->Y ==
point->Y == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 49398 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-49398
240 ((void *)0)
point->Y == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 49398 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-49398
241 || point->Z ==
point->Z == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 49398 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-49398
242 ((void *)0)
point->Z == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 49398 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-49398
243 ) {-
244 BN_free(point->X);-
245 BN_free(point->Y);-
246 BN_free(point->Z);-
247 return
never executed: return 0;
0;
never executed: return 0;
0
248 }-
249 return
executed 49398 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 49398 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
49398
250}-
251-
252-
253void ec_GF2m_simple_point_finish(EC_POINT *point)-
254{-
255 BN_free(point->X);-
256 BN_free(point->Y);-
257 BN_free(point->Z);-
258}
executed 44814 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
44814
259-
260-
261void ec_GF2m_simple_point_clear_finish(EC_POINT *point)-
262{-
263 BN_clear_free(point->X);-
264 BN_clear_free(point->Y);-
265 BN_clear_free(point->Z);-
266 point->Z_is_one = 0;-
267}
executed 4584 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
4584
268-
269-
270-
271-
272-
273int ec_GF2m_simple_point_copy(EC_POINT *dest, const EC_POINT *src)-
274{-
275 if (!BN_copy(dest->X, src->X)
!BN_copy(dest->X, src->X)Description
TRUEnever evaluated
FALSEevaluated 26238 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-26238
276 return
never executed: return 0;
0;
never executed: return 0;
0
277 if (!BN_copy(dest->Y, src->Y)
!BN_copy(dest->Y, src->Y)Description
TRUEnever evaluated
FALSEevaluated 26238 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-26238
278 return
never executed: return 0;
0;
never executed: return 0;
0
279 if (!BN_copy(dest->Z, src->Z)
!BN_copy(dest->Z, src->Z)Description
TRUEnever evaluated
FALSEevaluated 26238 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-26238
280 return
never executed: return 0;
0;
never executed: return 0;
0
281 dest->Z_is_one = src->Z_is_one;-
282 dest->curve_name = src->curve_name;-
283-
284 return
executed 26238 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 26238 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
26238
285}-
286-
287-
288-
289-
290-
291int ec_GF2m_simple_point_set_to_infinity(const EC_GROUP *group,-
292 EC_POINT *point)-
293{-
294 point->Z_is_one = 0;-
295 (BN_set_word((point->Z),0));-
296 return
executed 831 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 831 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
831
297}-
298-
299-
300-
301-
302-
303int ec_GF2m_simple_point_set_affine_coordinates(const EC_GROUP *group,-
304 EC_POINT *point,-
305 const BIGNUM *x,-
306 const BIGNUM *y, BN_CTX *ctx)-
307{-
308 int ret = 0;-
309 if (x ==
x == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 80606 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-80606
310 ((void *)0)
x == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 80606 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-80606
311 || y ==
y == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 80606 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-80606
312 ((void *)0)
y == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 80606 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-80606
313 ) {-
314 ERR_put_error(16,(163),((3|64)),__FILE__,288)-
315 ;-
316 return
never executed: return 0;
0;
never executed: return 0;
0
317 }-
318-
319 if (!BN_copy(point->X, x)
!BN_copy(point->X, x)Description
TRUEnever evaluated
FALSEevaluated 80606 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-80606
320 goto
never executed: goto err;
err;
never executed: goto err;
0
321 BN_set_negative(point->X, 0);-
322 if (!BN_copy(point->Y, y)
!BN_copy(point->Y, y)Description
TRUEnever evaluated
FALSEevaluated 80606 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-80606
323 goto
never executed: goto err;
err;
never executed: goto err;
0
324 BN_set_negative(point->Y, 0);-
325 if (!BN_copy(point->Z, BN_value_one())
!BN_copy(point...N_value_one())Description
TRUEnever evaluated
FALSEevaluated 80606 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-80606
326 goto
never executed: goto err;
err;
never executed: goto err;
0
327 BN_set_negative(point->Z, 0);-
328 point->Z_is_one = 1;-
329 ret = 1;-
330-
331 err:
code before this statement executed 80606 times by 1 test: err:
Executed by:
  • libcrypto.so.1.1
80606
332 return
executed 80606 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 80606 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
80606
333}-
334-
335-
336-
337-
338-
339int ec_GF2m_simple_point_get_affine_coordinates(const EC_GROUP *group,-
340 const EC_POINT *point,-
341 BIGNUM *x, BIGNUM *y,-
342 BN_CTX *ctx)-
343{-
344 int ret = 0;-
345-
346 if (EC_POINT_is_at_infinity(group, point)
EC_POINT_is_at...(group, point)Description
TRUEnever evaluated
FALSEevaluated 826 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-826
347 ERR_put_error(16,(162),(106),__FILE__,321)-
348 ;-
349 return
never executed: return 0;
0;
never executed: return 0;
0
350 }-
351-
352 if (BN_cmp(point->Z, BN_value_one())
BN_cmp(point->...N_value_one())Description
TRUEnever evaluated
FALSEevaluated 826 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-826
353 ERR_put_error(16,(162),((2|64)),__FILE__,327)-
354 ;-
355 return
never executed: return 0;
0;
never executed: return 0;
0
356 }-
357 if (x !=
x != ((void *)0)Description
TRUEevaluated 826 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-826
358 ((void *)0)
x != ((void *)0)Description
TRUEevaluated 826 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-826
359 ) {-
360 if (!BN_copy(x, point->X)
!BN_copy(x, point->X)Description
TRUEnever evaluated
FALSEevaluated 826 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-826
361 goto
never executed: goto err;
err;
never executed: goto err;
0
362 BN_set_negative(x, 0);-
363 }
executed 826 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
826
364 if (y !=
y != ((void *)0)Description
TRUEevaluated 100 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 726 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
100-726
365 ((void *)0)
y != ((void *)0)Description
TRUEevaluated 100 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 726 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
100-726
366 ) {-
367 if (!BN_copy(y, point->Y)
!BN_copy(y, point->Y)Description
TRUEnever evaluated
FALSEevaluated 100 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-100
368 goto
never executed: goto err;
err;
never executed: goto err;
0
369 BN_set_negative(y, 0);-
370 }
executed 100 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
100
371 ret = 1;-
372-
373 err:
code before this statement executed 826 times by 1 test: err:
Executed by:
  • libcrypto.so.1.1
826
374 return
executed 826 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 826 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
826
375}-
376-
377-
378-
379-
380-
381int ec_GF2m_simple_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a,-
382 const EC_POINT *b, BN_CTX *ctx)-
383{-
384 BN_CTX *new_ctx = -
385 ((void *)0)-
386 ;-
387 BIGNUM *x0, *y0, *x1, *y1, *x2, *y2, *s, *t;-
388 int ret = 0;-
389-
390 if (EC_POINT_is_at_infinity(group, a)
EC_POINT_is_at...nity(group, a)Description
TRUEevaluated 3765 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 85790 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
3765-85790
391 if (!EC_POINT_copy(r, b)
!EC_POINT_copy(r, b)Description
TRUEnever evaluated
FALSEevaluated 3765 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-3765
392 return
never executed: return 0;
0;
never executed: return 0;
0
393 return
executed 3765 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 3765 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
3765
394 }-
395-
396 if (EC_POINT_is_at_infinity(group, b)
EC_POINT_is_at...nity(group, b)Description
TRUEevaluated 19856 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 65934 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
19856-65934
397 if (!EC_POINT_copy(r, a)
!EC_POINT_copy(r, a)Description
TRUEnever evaluated
FALSEevaluated 19856 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-19856
398 return
never executed: return 0;
0;
never executed: return 0;
0
399 return
executed 19856 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 19856 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
19856
400 }-
401-
402 if (ctx ==
ctx == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 65934 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-65934
403 ((void *)0)
ctx == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 65934 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-65934
404 ) {-
405 ctx = new_ctx = BN_CTX_new();-
406 if (ctx ==
ctx == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
407 ((void *)0)
ctx == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
408 )-
409 return
never executed: return 0;
0;
never executed: return 0;
0
410 }
never executed: end of block
0
411-
412 BN_CTX_start(ctx);-
413 x0 = BN_CTX_get(ctx);-
414 y0 = BN_CTX_get(ctx);-
415 x1 = BN_CTX_get(ctx);-
416 y1 = BN_CTX_get(ctx);-
417 x2 = BN_CTX_get(ctx);-
418 y2 = BN_CTX_get(ctx);-
419 s = BN_CTX_get(ctx);-
420 t = BN_CTX_get(ctx);-
421 if (t ==
t == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 65934 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-65934
422 ((void *)0)
t == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 65934 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-65934
423 )-
424 goto
never executed: goto err;
err;
never executed: goto err;
0
425-
426 if (a->Z_is_one
a->Z_is_oneDescription
TRUEevaluated 65934 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-65934
427 if (!BN_copy(x0, a->X)
!BN_copy(x0, a->X)Description
TRUEnever evaluated
FALSEevaluated 65934 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-65934
428 goto
never executed: goto err;
err;
never executed: goto err;
0
429 if (!BN_copy(y0, a->Y)
!BN_copy(y0, a->Y)Description
TRUEnever evaluated
FALSEevaluated 65934 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-65934
430 goto
never executed: goto err;
err;
never executed: goto err;
0
431 }
executed 65934 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
65934
432 if (!EC_POINT_get_affine_coordinates(group, a, x0, y0, ctx)
!EC_POINT_get_..., x0, y0, ctx)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
433 goto
never executed: goto err;
err;
never executed: goto err;
0
434 }
never executed: end of block
0
435 if (b->Z_is_one
b->Z_is_oneDescription
TRUEevaluated 65934 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-65934
436 if (!BN_copy(x1, b->X)
!BN_copy(x1, b->X)Description
TRUEnever evaluated
FALSEevaluated 65934 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-65934
437 goto
never executed: goto err;
err;
never executed: goto err;
0
438 if (!BN_copy(y1, b->Y)
!BN_copy(y1, b->Y)Description
TRUEnever evaluated
FALSEevaluated 65934 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-65934
439 goto
never executed: goto err;
err;
never executed: goto err;
0
440 }
executed 65934 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
65934
441 if (!EC_POINT_get_affine_coordinates(group, b, x1, y1, ctx)
!EC_POINT_get_..., x1, y1, ctx)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
442 goto
never executed: goto err;
err;
never executed: goto err;
0
443 }
never executed: end of block
0
444-
445 if (BN_ucmp((x0), (x1))
BN_ucmp((x0), (x1))Description
TRUEevaluated 11764 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 54170 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
11764-54170
446 if (!BN_GF2m_add(t, x0, x1)
!BN_GF2m_add(t, x0, x1)Description
TRUEnever evaluated
FALSEevaluated 11764 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-11764
447 goto
never executed: goto err;
err;
never executed: goto err;
0
448 if (!BN_GF2m_add(s, y0, y1)
!BN_GF2m_add(s, y0, y1)Description
TRUEnever evaluated
FALSEevaluated 11764 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-11764
449 goto
never executed: goto err;
err;
never executed: goto err;
0
450 if (!group->meth->field_div(group, s, s, t, ctx)
!group->meth->... s, s, t, ctx)Description
TRUEnever evaluated
FALSEevaluated 11764 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-11764
451 goto
never executed: goto err;
err;
never executed: goto err;
0
452 if (!group->meth->field_sqr(group, x2, s, ctx)
!group->meth->...p, x2, s, ctx)Description
TRUEnever evaluated
FALSEevaluated 11764 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-11764
453 goto
never executed: goto err;
err;
never executed: goto err;
0
454 if (!BN_GF2m_add(x2, x2, group->a)
!BN_GF2m_add(x2, x2, group->a)Description
TRUEnever evaluated
FALSEevaluated 11764 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-11764
455 goto
never executed: goto err;
err;
never executed: goto err;
0
456 if (!BN_GF2m_add(x2, x2, s)
!BN_GF2m_add(x2, x2, s)Description
TRUEnever evaluated
FALSEevaluated 11764 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-11764
457 goto
never executed: goto err;
err;
never executed: goto err;
0
458 if (!BN_GF2m_add(x2, x2, t)
!BN_GF2m_add(x2, x2, t)Description
TRUEnever evaluated
FALSEevaluated 11764 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-11764
459 goto
never executed: goto err;
err;
never executed: goto err;
0
460 }
executed 11764 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
11764
461 if (BN_ucmp((y0), (y1))
BN_ucmp((y0), (y1))Description
TRUEevaluated 285 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 53885 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| BN_is_zero(x1)
BN_is_zero(x1)Description
TRUEnever evaluated
FALSEevaluated 53885 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-53885
462 if (!EC_POINT_set_to_infinity(group, r)
!EC_POINT_set_...nity(group, r)Description
TRUEnever evaluated
FALSEevaluated 285 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-285
463 goto
never executed: goto err;
err;
never executed: goto err;
0
464 ret = 1;-
465 goto
executed 285 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 285 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
285
466 }-
467 if (!group->meth->field_div(group, s, y1, x1, ctx)
!group->meth->..., y1, x1, ctx)Description
TRUEnever evaluated
FALSEevaluated 53885 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-53885
468 goto
never executed: goto err;
err;
never executed: goto err;
0
469 if (!BN_GF2m_add(s, s, x1)
!BN_GF2m_add(s, s, x1)Description
TRUEnever evaluated
FALSEevaluated 53885 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-53885
470 goto
never executed: goto err;
err;
never executed: goto err;
0
471-
472 if (!group->meth->field_sqr(group, x2, s, ctx)
!group->meth->...p, x2, s, ctx)Description
TRUEnever evaluated
FALSEevaluated 53885 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-53885
473 goto
never executed: goto err;
err;
never executed: goto err;
0
474 if (!BN_GF2m_add(x2, x2, s)
!BN_GF2m_add(x2, x2, s)Description
TRUEnever evaluated
FALSEevaluated 53885 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-53885
475 goto
never executed: goto err;
err;
never executed: goto err;
0
476 if (!BN_GF2m_add(x2, x2, group->a)
!BN_GF2m_add(x2, x2, group->a)Description
TRUEnever evaluated
FALSEevaluated 53885 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-53885
477 goto
never executed: goto err;
err;
never executed: goto err;
0
478 }
executed 53885 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
53885
479-
480 if (!BN_GF2m_add(y2, x1, x2)
!BN_GF2m_add(y2, x1, x2)Description
TRUEnever evaluated
FALSEevaluated 65649 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-65649
481 goto
never executed: goto err;
err;
never executed: goto err;
0
482 if (!group->meth->field_mul(group, y2, y2, s, ctx)
!group->meth->...2, y2, s, ctx)Description
TRUEnever evaluated
FALSEevaluated 65649 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-65649
483 goto
never executed: goto err;
err;
never executed: goto err;
0
484 if (!BN_GF2m_add(y2, y2, x2)
!BN_GF2m_add(y2, y2, x2)Description
TRUEnever evaluated
FALSEevaluated 65649 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-65649
485 goto
never executed: goto err;
err;
never executed: goto err;
0
486 if (!BN_GF2m_add(y2, y2, y1)
!BN_GF2m_add(y2, y2, y1)Description
TRUEnever evaluated
FALSEevaluated 65649 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-65649
487 goto
never executed: goto err;
err;
never executed: goto err;
0
488-
489 if (!EC_POINT_set_affine_coordinates(group, r, x2, y2, ctx)
!EC_POINT_set_..., x2, y2, ctx)Description
TRUEnever evaluated
FALSEevaluated 65649 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-65649
490 goto
never executed: goto err;
err;
never executed: goto err;
0
491-
492 ret = 1;-
493-
494 err:
code before this statement executed 65649 times by 1 test: err:
Executed by:
  • libcrypto.so.1.1
65649
495 BN_CTX_end(ctx);-
496 BN_CTX_free(new_ctx);-
497 return
executed 65934 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 65934 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
65934
498}-
499-
500-
501-
502-
503-
504int ec_GF2m_simple_dbl(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a,-
505 BN_CTX *ctx)-
506{-
507 return
executed 55015 times by 1 test: return ec_GF2m_simple_add(group, r, a, a, ctx);
Executed by:
  • libcrypto.so.1.1
ec_GF2m_simple_add(group, r, a, a, ctx);
executed 55015 times by 1 test: return ec_GF2m_simple_add(group, r, a, a, ctx);
Executed by:
  • libcrypto.so.1.1
55015
508}-
509-
510int ec_GF2m_simple_invert(const EC_GROUP *group, EC_POINT *point, BN_CTX *ctx)-
511{-
512 if (EC_POINT_is_at_infinity(group, point)
EC_POINT_is_at...(group, point)Description
TRUEevaluated 86 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 6230 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| BN_is_zero(point->Y)
BN_is_zero(point->Y)Description
TRUEnever evaluated
FALSEevaluated 6230 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-6230
513-
514 return
executed 86 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 86 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
86
515-
516 if (!EC_POINT_make_affine(group, point, ctx)
!EC_POINT_make...p, point, ctx)Description
TRUEnever evaluated
FALSEevaluated 6230 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-6230
517 return
never executed: return 0;
0;
never executed: return 0;
0
518 return
executed 6230 times by 1 test: return BN_GF2m_add(point->Y, point->X, point->Y);
Executed by:
  • libcrypto.so.1.1
BN_GF2m_add(point->Y, point->X, point->Y);
executed 6230 times by 1 test: return BN_GF2m_add(point->Y, point->X, point->Y);
Executed by:
  • libcrypto.so.1.1
6230
519}-
520-
521-
522int ec_GF2m_simple_is_at_infinity(const EC_GROUP *group,-
523 const EC_POINT *point)-
524{-
525 return
executed 273149 times by 1 test: return BN_is_zero(point->Z);
Executed by:
  • libcrypto.so.1.1
BN_is_zero(point->Z);
executed 273149 times by 1 test: return BN_is_zero(point->Z);
Executed by:
  • libcrypto.so.1.1
273149
526}-
527-
528-
529-
530-
531-
532-
533int ec_GF2m_simple_is_on_curve(const EC_GROUP *group, const EC_POINT *point,-
534 BN_CTX *ctx)-
535{-
536 int ret = -1;-
537 BN_CTX *new_ctx = -
538 ((void *)0)-
539 ;-
540 BIGNUM *lh, *y2;-
541 int (*field_mul) (const EC_GROUP *, BIGNUM *, const BIGNUM *,-
542 const BIGNUM *, BN_CTX *);-
543 int (*field_sqr) (const EC_GROUP *, BIGNUM *, const BIGNUM *, BN_CTX *);-
544-
545 if (EC_POINT_is_at_infinity(group, point)
EC_POINT_is_at...(group, point)Description
TRUEnever evaluated
FALSEevaluated 80774 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-80774
546 return
never executed: return 1;
1;
never executed: return 1;
0
547-
548 field_mul = group->meth->field_mul;-
549 field_sqr = group->meth->field_sqr;-
550-
551-
552 if (!point->Z_is_one
!point->Z_is_oneDescription
TRUEnever evaluated
FALSEevaluated 80774 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-80774
553 return
never executed: return -1;
-1;
never executed: return -1;
0
554-
555 if (ctx ==
ctx == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 80774 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-80774
556 ((void *)0)
ctx == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 80774 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-80774
557 ) {-
558 ctx = new_ctx = BN_CTX_new();-
559 if (ctx ==
ctx == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
560 ((void *)0)
ctx == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
561 )-
562 return
never executed: return -1;
-1;
never executed: return -1;
0
563 }
never executed: end of block
0
564-
565 BN_CTX_start(ctx);-
566 y2 = BN_CTX_get(ctx);-
567 lh = BN_CTX_get(ctx);-
568 if (lh ==
lh == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 80774 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-80774
569 ((void *)0)
lh == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 80774 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-80774
570 )-
571 goto
never executed: goto err;
err;
never executed: goto err;
0
572-
573-
574-
575-
576-
577-
578-
579 if (!BN_GF2m_add(lh, point->X, group->a)
!BN_GF2m_add(l...->X, group->a)Description
TRUEnever evaluated
FALSEevaluated 80774 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-80774
580 goto
never executed: goto err;
err;
never executed: goto err;
0
581 if (!field_mul(group, lh, lh, point->X, ctx)
!field_mul(gro...point->X, ctx)Description
TRUEnever evaluated
FALSEevaluated 80774 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-80774
582 goto
never executed: goto err;
err;
never executed: goto err;
0
583 if (!BN_GF2m_add(lh, lh, point->Y)
!BN_GF2m_add(lh, lh, point->Y)Description
TRUEnever evaluated
FALSEevaluated 80774 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-80774
584 goto
never executed: goto err;
err;
never executed: goto err;
0
585 if (!field_mul(group, lh, lh, point->X, ctx)
!field_mul(gro...point->X, ctx)Description
TRUEnever evaluated
FALSEevaluated 80774 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-80774
586 goto
never executed: goto err;
err;
never executed: goto err;
0
587 if (!BN_GF2m_add(lh, lh, group->b)
!BN_GF2m_add(lh, lh, group->b)Description
TRUEnever evaluated
FALSEevaluated 80774 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-80774
588 goto
never executed: goto err;
err;
never executed: goto err;
0
589 if (!field_sqr(group, y2, point->Y, ctx)
!field_sqr(gro...point->Y, ctx)Description
TRUEnever evaluated
FALSEevaluated 80774 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-80774
590 goto
never executed: goto err;
err;
never executed: goto err;
0
591 if (!BN_GF2m_add(lh, lh, y2)
!BN_GF2m_add(lh, lh, y2)Description
TRUEnever evaluated
FALSEevaluated 80774 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-80774
592 goto
never executed: goto err;
err;
never executed: goto err;
0
593 ret = BN_is_zero(lh);-
594-
595 err:
code before this statement executed 80774 times by 1 test: err:
Executed by:
  • libcrypto.so.1.1
80774
596 BN_CTX_end(ctx);-
597 BN_CTX_free(new_ctx);-
598 return
executed 80774 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 80774 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
80774
599}-
600int ec_GF2m_simple_cmp(const EC_GROUP *group, const EC_POINT *a,-
601 const EC_POINT *b, BN_CTX *ctx)-
602{-
603 BIGNUM *aX, *aY, *bX, *bY;-
604 BN_CTX *new_ctx = -
605 ((void *)0)-
606 ;-
607 int ret = -1;-
608-
609 if (EC_POINT_is_at_infinity(group, a)
EC_POINT_is_at...nity(group, a)Description
TRUEnever evaluated
FALSEevaluated 2033 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-2033
610 return
never executed: return EC_POINT_is_at_infinity(group, b) ? 0 : 1;
EC_POINT_is_at_infinity(group, b)
EC_POINT_is_at...nity(group, b)Description
TRUEnever evaluated
FALSEnever evaluated
? 0 : 1;
never executed: return EC_POINT_is_at_infinity(group, b) ? 0 : 1;
0
611 }-
612-
613 if (EC_POINT_is_at_infinity(group, b)
EC_POINT_is_at...nity(group, b)Description
TRUEnever evaluated
FALSEevaluated 2033 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-2033
614 return
never executed: return 1;
1;
never executed: return 1;
0
615-
616 if (a->Z_is_one
a->Z_is_oneDescription
TRUEevaluated 2033 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
&& b->Z_is_one
b->Z_is_oneDescription
TRUEevaluated 2033 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-2033
617 return
executed 2033 times by 1 test: return ((BN_cmp(a->X, b->X) == 0) && BN_cmp(a->Y, b->Y) == 0) ? 0 : 1;
Executed by:
  • libcrypto.so.1.1
((
(BN_cmp(a->X, b->X) == 0)Description
TRUEevaluated 2033 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
BN_cmp(a->X, b->X) == 0)
(BN_cmp(a->X, b->X) == 0)Description
TRUEevaluated 2033 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
&& BN_cmp(a->Y, b->Y) == 0
BN_cmp(a->Y, b->Y) == 0Description
TRUEevaluated 2033 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) ? 0 : 1;
executed 2033 times by 1 test: return ((BN_cmp(a->X, b->X) == 0) && BN_cmp(a->Y, b->Y) == 0) ? 0 : 1;
Executed by:
  • libcrypto.so.1.1
0-2033
618 }-
619-
620 if (ctx ==
ctx == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
621 ((void *)0)
ctx == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
622 ) {-
623 ctx = new_ctx = BN_CTX_new();-
624 if (ctx ==
ctx == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
625 ((void *)0)
ctx == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
626 )-
627 return
never executed: return -1;
-1;
never executed: return -1;
0
628 }
never executed: end of block
0
629-
630 BN_CTX_start(ctx);-
631 aX = BN_CTX_get(ctx);-
632 aY = BN_CTX_get(ctx);-
633 bX = BN_CTX_get(ctx);-
634 bY = BN_CTX_get(ctx);-
635 if (bY ==
bY == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
636 ((void *)0)
bY == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
637 )-
638 goto
never executed: goto err;
err;
never executed: goto err;
0
639-
640 if (!EC_POINT_get_affine_coordinates(group, a, aX, aY, ctx)
!EC_POINT_get_..., aX, aY, ctx)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
641 goto
never executed: goto err;
err;
never executed: goto err;
0
642 if (!EC_POINT_get_affine_coordinates(group, b, bX, bY, ctx)
!EC_POINT_get_..., bX, bY, ctx)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
643 goto
never executed: goto err;
err;
never executed: goto err;
0
644 ret = ((
(BN_cmp(aX, bX) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
BN_cmp(aX, bX) == 0)
(BN_cmp(aX, bX) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
&& BN_cmp(aY, bY) == 0
BN_cmp(aY, bY) == 0Description
TRUEnever evaluated
FALSEnever evaluated
) ? 0 : 1;
0
645-
646 err:
code before this statement never executed: err:
0
647 BN_CTX_end(ctx);-
648 BN_CTX_free(new_ctx);-
649 return
never executed: return ret;
ret;
never executed: return ret;
0
650}-
651-
652-
653int ec_GF2m_simple_make_affine(const EC_GROUP *group, EC_POINT *point,-
654 BN_CTX *ctx)-
655{-
656 BN_CTX *new_ctx = -
657 ((void *)0)-
658 ;-
659 BIGNUM *x, *y;-
660 int ret = 0;-
661-
662 if (point->Z_is_one
point->Z_is_oneDescription
TRUEevaluated 7950 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2864 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| EC_POINT_is_at_infinity(group, point)
EC_POINT_is_at...(group, point)Description
TRUEevaluated 2864 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
)
0-7950
663 return
executed 10814 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 10814 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
10814
664-
665 if (ctx ==
ctx == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
666 ((void *)0)
ctx == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
667 ) {-
668 ctx = new_ctx = BN_CTX_new();-
669 if (ctx ==
ctx == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
670 ((void *)0)
ctx == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
671 )-
672 return
never executed: return 0;
0;
never executed: return 0;
0
673 }
never executed: end of block
0
674-
675 BN_CTX_start(ctx);-
676 x = BN_CTX_get(ctx);-
677 y = BN_CTX_get(ctx);-
678 if (y ==
y == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
679 ((void *)0)
y == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
680 )-
681 goto
never executed: goto err;
err;
never executed: goto err;
0
682-
683 if (!EC_POINT_get_affine_coordinates(group, point, x, y, ctx)
!EC_POINT_get_...nt, x, y, ctx)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
684 goto
never executed: goto err;
err;
never executed: goto err;
0
685 if (!BN_copy(point->X, x)
!BN_copy(point->X, x)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
686 goto
never executed: goto err;
err;
never executed: goto err;
0
687 if (!BN_copy(point->Y, y)
!BN_copy(point->Y, y)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
688 goto
never executed: goto err;
err;
never executed: goto err;
0
689 if (!(BN_set_word((point->Z),1))
!(BN_set_word((point->Z),1))Description
TRUEnever evaluated
FALSEnever evaluated
)
0
690 goto
never executed: goto err;
err;
never executed: goto err;
0
691 point->Z_is_one = 1;-
692-
693 ret = 1;-
694-
695 err:
code before this statement never executed: err:
0
696 BN_CTX_end(ctx);-
697 BN_CTX_free(new_ctx);-
698 return
never executed: return ret;
ret;
never executed: return ret;
0
699}-
700-
701-
702-
703-
704int ec_GF2m_simple_points_make_affine(const EC_GROUP *group, size_t num,-
705 EC_POINT *points[], BN_CTX *ctx)-
706{-
707 size_t i;-
708-
709 for (i = 0; i < num
i < numDescription
TRUEevaluated 4584 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 212 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++) {
212-4584
710 if (!group->meth->make_affine(group, points[i], ctx)
!group->meth->...oints[i], ctx)Description
TRUEnever evaluated
FALSEevaluated 4584 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-4584
711 return
never executed: return 0;
0;
never executed: return 0;
0
712 }
executed 4584 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
4584
713-
714 return
executed 212 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 212 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
212
715}-
716-
717-
718int ec_GF2m_simple_field_mul(const EC_GROUP *group, BIGNUM *r,-
719 const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)-
720{-
721 return
executed 3593851 times by 1 test: return BN_GF2m_mod_mul_arr(r, a, b, group->poly, ctx);
Executed by:
  • libcrypto.so.1.1
BN_GF2m_mod_mul_arr(r, a, b, group->poly, ctx);
executed 3593851 times by 1 test: return BN_GF2m_mod_mul_arr(r, a, b, group->poly, ctx);
Executed by:
  • libcrypto.so.1.1
3593851
722}-
723-
724-
725int ec_GF2m_simple_field_sqr(const EC_GROUP *group, BIGNUM *r,-
726 const BIGNUM *a, BN_CTX *ctx)-
727{-
728 return
executed 2941761 times by 1 test: return BN_GF2m_mod_sqr_arr(r, a, group->poly, ctx);
Executed by:
  • libcrypto.so.1.1
BN_GF2m_mod_sqr_arr(r, a, group->poly, ctx);
executed 2941761 times by 1 test: return BN_GF2m_mod_sqr_arr(r, a, group->poly, ctx);
Executed by:
  • libcrypto.so.1.1
2941761
729}-
730-
731-
732int ec_GF2m_simple_field_div(const EC_GROUP *group, BIGNUM *r,-
733 const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)-
734{-
735 return
executed 71165 times by 1 test: return BN_GF2m_mod_div(r, a, b, group->field, ctx);
Executed by:
  • libcrypto.so.1.1
BN_GF2m_mod_div(r, a, b, group->field, ctx);
executed 71165 times by 1 test: return BN_GF2m_mod_div(r, a, b, group->field, ctx);
Executed by:
  • libcrypto.so.1.1
71165
736}-
737-
738-
739-
740-
741-
742-
743-
744static-
745int ec_GF2m_simple_ladder_pre(const EC_GROUP *group,-
746 EC_POINT *r, EC_POINT *s,-
747 EC_POINT *p, BN_CTX *ctx)-
748{-
749-
750 if (p->Z_is_one == 0
p->Z_is_one == 0Description
TRUEnever evaluated
FALSEevaluated 2126 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-2126
751 return
never executed: return 0;
0;
never executed: return 0;
0
752-
753-
754 do {-
755 if (!BN_priv_rand(s->Z, BN_num_bits(group->field) - 1,
!BN_priv_rand(...d) - 1, -1, 0)Description
TRUEnever evaluated
FALSEevaluated 2126 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-2126
756 -1, 0)
!BN_priv_rand(...d) - 1, -1, 0)Description
TRUEnever evaluated
FALSEevaluated 2126 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-2126
757 ERR_put_error(16,(288),(3),__FILE__,702);-
758 return
never executed: return 0;
0;
never executed: return 0;
0
759 }-
760 }
executed 2126 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
while (BN_is_zero(s->Z)
BN_is_zero(s->Z)Description
TRUEnever evaluated
FALSEevaluated 2126 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
);
0-2126
761-
762-
763 if ((group->meth->field_encode !=
group->meth->f...!= ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2126 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-2126
764 ((void *)0)
group->meth->f...!= ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2126 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-2126
765 -
766 && !group->meth->field_encode(group, s->Z, s->Z, ctx)
!group->meth->...>Z, s->Z, ctx)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
767 || !group->meth->field_mul(group, s->X, p->X, s->Z, ctx)
!group->meth->...>X, s->Z, ctx)Description
TRUEnever evaluated
FALSEevaluated 2126 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-2126
768 return
never executed: return 0;
0;
never executed: return 0;
0
769-
770-
771 do {-
772 if (!BN_priv_rand(r->Y, BN_num_bits(group->field) - 1,
!BN_priv_rand(...d) - 1, -1, 0)Description
TRUEnever evaluated
FALSEevaluated 2126 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-2126
773 -1, 0)
!BN_priv_rand(...d) - 1, -1, 0)Description
TRUEnever evaluated
FALSEevaluated 2126 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-2126
774 ERR_put_error(16,(288),(3),__FILE__,717);-
775 return
never executed: return 0;
0;
never executed: return 0;
0
776 }-
777 }
executed 2126 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
while (BN_is_zero(r->Y)
BN_is_zero(r->Y)Description
TRUEnever evaluated
FALSEevaluated 2126 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
);
0-2126
778-
779 if ((group->meth->field_encode !=
group->meth->f...!= ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2126 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-2126
780 ((void *)0)
group->meth->f...!= ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2126 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-2126
781 -
782 && !group->meth->field_encode(group, r->Y, r->Y, ctx)
!group->meth->...>Y, r->Y, ctx)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
783 || !group->meth->field_sqr(group, r->Z, p->X, ctx)
!group->meth->...>Z, p->X, ctx)Description
TRUEnever evaluated
FALSEevaluated 2126 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-2126
784 || !group->meth->field_sqr(group, r->X, r->Z, ctx)
!group->meth->...>X, r->Z, ctx)Description
TRUEnever evaluated
FALSEevaluated 2126 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-2126
785 || !BN_GF2m_add(r->X, r->X, group->b)
!BN_GF2m_add(r...->X, group->b)Description
TRUEnever evaluated
FALSEevaluated 2126 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-2126
786 || !group->meth->field_mul(group, r->Z, r->Z, r->Y, ctx)
!group->meth->...>Z, r->Y, ctx)Description
TRUEnever evaluated
FALSEevaluated 2126 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-2126
787 || !group->meth->field_mul(group, r->X, r->X, r->Y, ctx)
!group->meth->...>X, r->Y, ctx)Description
TRUEnever evaluated
FALSEevaluated 2126 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-2126
788 return
never executed: return 0;
0;
never executed: return 0;
0
789-
790 s->Z_is_one = 0;-
791 r->Z_is_one = 0;-
792-
793 return
executed 2126 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 2126 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
2126
794}-
795-
796-
797-
798-
799-
800-
801static-
802int ec_GF2m_simple_ladder_step(const EC_GROUP *group,-
803 EC_POINT *r, EC_POINT *s,-
804 EC_POINT *p, BN_CTX *ctx)-
805{-
806 if (!group->meth->field_mul(group, r->Y, r->Z, s->X, ctx)
!group->meth->...>Z, s->X, ctx)Description
TRUEnever evaluated
FALSEevaluated 556906 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-556906
807 || !group->meth->field_mul(group, s->X, r->X, s->Z, ctx)
!group->meth->...>X, s->Z, ctx)Description
TRUEnever evaluated
FALSEevaluated 556906 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-556906
808 || !group->meth->field_sqr(group, s->Y, r->Z, ctx)
!group->meth->...>Y, r->Z, ctx)Description
TRUEnever evaluated
FALSEevaluated 556906 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-556906
809 || !group->meth->field_sqr(group, r->Z, r->X, ctx)
!group->meth->...>Z, r->X, ctx)Description
TRUEnever evaluated
FALSEevaluated 556906 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-556906
810 || !BN_GF2m_add(s->Z, r->Y, s->X)
!BN_GF2m_add(s->Z, r->Y, s->X)Description
TRUEnever evaluated
FALSEevaluated 556906 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-556906
811 || !group->meth->field_sqr(group, s->Z, s->Z, ctx)
!group->meth->...>Z, s->Z, ctx)Description
TRUEnever evaluated
FALSEevaluated 556906 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-556906
812 || !group->meth->field_mul(group, s->X, r->Y, s->X, ctx)
!group->meth->...>Y, s->X, ctx)Description
TRUEnever evaluated
FALSEevaluated 556906 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-556906
813 || !group->meth->field_mul(group, r->Y, s->Z, p->X, ctx)
!group->meth->...>Z, p->X, ctx)Description
TRUEnever evaluated
FALSEevaluated 556906 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-556906
814 || !BN_GF2m_add(s->X, s->X, r->Y)
!BN_GF2m_add(s->X, s->X, r->Y)Description
TRUEnever evaluated
FALSEevaluated 556906 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-556906
815 || !group->meth->field_sqr(group, r->Y, r->Z, ctx)
!group->meth->...>Y, r->Z, ctx)Description
TRUEnever evaluated
FALSEevaluated 556906 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-556906
816 || !group->meth->field_mul(group, r->Z, r->Z, s->Y, ctx)
!group->meth->...>Z, s->Y, ctx)Description
TRUEnever evaluated
FALSEevaluated 556906 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-556906
817 || !group->meth->field_sqr(group, s->Y, s->Y, ctx)
!group->meth->...>Y, s->Y, ctx)Description
TRUEnever evaluated
FALSEevaluated 556906 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-556906
818 || !group->meth->field_mul(group, s->Y, s->Y, group->b, ctx)
!group->meth->...group->b, ctx)Description
TRUEnever evaluated
FALSEevaluated 556906 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-556906
819 || !BN_GF2m_add(r->X, r->Y, s->Y)
!BN_GF2m_add(r->X, r->Y, s->Y)Description
TRUEnever evaluated
FALSEevaluated 556906 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-556906
820 return
never executed: return 0;
0;
never executed: return 0;
0
821-
822 return
executed 556906 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 556906 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
556906
823}-
824-
825-
826-
827-
828-
829-
830-
831static-
832int ec_GF2m_simple_ladder_post(const EC_GROUP *group,-
833 EC_POINT *r, EC_POINT *s,-
834 EC_POINT *p, BN_CTX *ctx)-
835{-
836 int ret = 0;-
837 BIGNUM *t0, *t1, *t2 = -
838 ((void *)0)-
839 ;-
840-
841 if (BN_is_zero(r->Z)
BN_is_zero(r->Z)Description
TRUEevaluated 348 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1778 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
348-1778
842 return
executed 348 times by 1 test: return EC_POINT_set_to_infinity(group, r);
Executed by:
  • libcrypto.so.1.1
EC_POINT_set_to_infinity(group, r);
executed 348 times by 1 test: return EC_POINT_set_to_infinity(group, r);
Executed by:
  • libcrypto.so.1.1
348
843-
844 if (BN_is_zero(s->Z)
BN_is_zero(s->Z)Description
TRUEevaluated 156 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1622 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
156-1622
845 if (!EC_POINT_copy(r, p)
!EC_POINT_copy(r, p)Description
TRUEnever evaluated
FALSEevaluated 156 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-156
846 || !EC_POINT_invert(group, r, ctx)
!EC_POINT_inve...group, r, ctx)Description
TRUEnever evaluated
FALSEevaluated 156 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-156
847 ERR_put_error(16,(285),(16),__FILE__,786);-
848 return
never executed: return 0;
0;
never executed: return 0;
0
849 }-
850 return
executed 156 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 156 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
156
851 }-
852-
853 BN_CTX_start(ctx);-
854 t0 = BN_CTX_get(ctx);-
855 t1 = BN_CTX_get(ctx);-
856 t2 = BN_CTX_get(ctx);-
857 if (t2 ==
t2 == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 1622 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1622
858 ((void *)0)
t2 == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 1622 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1622
859 ) {-
860 ERR_put_error(16,(285),((1|64)),__FILE__,797);-
861 goto
never executed: goto err;
err;
never executed: goto err;
0
862 }-
863-
864 if (!group->meth->field_mul(group, t0, r->Z, s->Z, ctx)
!group->meth->...>Z, s->Z, ctx)Description
TRUEnever evaluated
FALSEevaluated 1622 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1622
865 || !group->meth->field_mul(group, t1, p->X, r->Z, ctx)
!group->meth->...>X, r->Z, ctx)Description
TRUEnever evaluated
FALSEevaluated 1622 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1622
866 || !BN_GF2m_add(t1, r->X, t1)
!BN_GF2m_add(t1, r->X, t1)Description
TRUEnever evaluated
FALSEevaluated 1622 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1622
867 || !group->meth->field_mul(group, t2, p->X, s->Z, ctx)
!group->meth->...>X, s->Z, ctx)Description
TRUEnever evaluated
FALSEevaluated 1622 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1622
868 || !group->meth->field_mul(group, r->Z, r->X, t2, ctx)
!group->meth->...r->X, t2, ctx)Description
TRUEnever evaluated
FALSEevaluated 1622 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1622
869 || !BN_GF2m_add(t2, t2, s->X)
!BN_GF2m_add(t2, t2, s->X)Description
TRUEnever evaluated
FALSEevaluated 1622 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1622
870 || !group->meth->field_mul(group, t1, t1, t2, ctx)
!group->meth->..., t1, t2, ctx)Description
TRUEnever evaluated
FALSEevaluated 1622 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1622
871 || !group->meth->field_sqr(group, t2, p->X, ctx)
!group->meth->...t2, p->X, ctx)Description
TRUEnever evaluated
FALSEevaluated 1622 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1622
872 || !BN_GF2m_add(t2, p->Y, t2)
!BN_GF2m_add(t2, p->Y, t2)Description
TRUEnever evaluated
FALSEevaluated 1622 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1622
873 || !group->meth->field_mul(group, t2, t2, t0, ctx)
!group->meth->..., t2, t0, ctx)Description
TRUEnever evaluated
FALSEevaluated 1622 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1622
874 || !BN_GF2m_add(t1, t2, t1)
!BN_GF2m_add(t1, t2, t1)Description
TRUEnever evaluated
FALSEevaluated 1622 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1622
875 || !group->meth->field_mul(group, t2, p->X, t0, ctx)
!group->meth->...p->X, t0, ctx)Description
TRUEnever evaluated
FALSEevaluated 1622 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1622
876 || !BN_GF2m_mod_inv(t2, t2, group->field, ctx)
!BN_GF2m_mod_i...p->field, ctx)Description
TRUEnever evaluated
FALSEevaluated 1622 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1622
877 || !group->meth->field_mul(group, t1, t1, t2, ctx)
!group->meth->..., t1, t2, ctx)Description
TRUEnever evaluated
FALSEevaluated 1622 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1622
878 || !group->meth->field_mul(group, r->X, r->Z, t2, ctx)
!group->meth->...r->Z, t2, ctx)Description
TRUEnever evaluated
FALSEevaluated 1622 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1622
879 || !BN_GF2m_add(t2, p->X, r->X)
!BN_GF2m_add(t2, p->X, r->X)Description
TRUEnever evaluated
FALSEevaluated 1622 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1622
880 || !group->meth->field_mul(group, t2, t2, t1, ctx)
!group->meth->..., t2, t1, ctx)Description
TRUEnever evaluated
FALSEevaluated 1622 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1622
881 || !BN_GF2m_add(r->Y, p->Y, t2)
!BN_GF2m_add(r->Y, p->Y, t2)Description
TRUEnever evaluated
FALSEevaluated 1622 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1622
882 || !(BN_set_word((r->Z),1))
!(BN_set_word((r->Z),1))Description
TRUEnever evaluated
FALSEevaluated 1622 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1622
883 goto
never executed: goto err;
err;
never executed: goto err;
0
884-
885 r->Z_is_one = 1;-
886-
887-
888 BN_set_negative(r->X, 0);-
889 BN_set_negative(r->Y, 0);-
890-
891 ret = 1;-
892-
893 err:
code before this statement executed 1622 times by 1 test: err:
Executed by:
  • libcrypto.so.1.1
1622
894 BN_CTX_end(ctx);-
895 return
executed 1622 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 1622 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
1622
896}-
897-
898static-
899int ec_GF2m_simple_points_mul(const EC_GROUP *group, EC_POINT *r,-
900 const BIGNUM *scalar, size_t num,-
901 const EC_POINT *points[],-
902 const BIGNUM *scalars[],-
903 BN_CTX *ctx)-
904{-
905 int ret = 0;-
906 EC_POINT *t = -
907 ((void *)0)-
908 ;-
909 if (num > 1
num > 1Description
TRUEevaluated 212 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1956 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| BN_is_zero(group->order)
BN_is_zero(group->order)Description
TRUEnever evaluated
FALSEevaluated 1956 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| BN_is_zero(group->cofactor)
BN_is_zero(group->cofactor)Description
TRUEnever evaluated
FALSEevaluated 1956 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1956
910 return
executed 212 times by 1 test: return ec_wNAF_mul(group, r, scalar, num, points, scalars, ctx);
Executed by:
  • libcrypto.so.1.1
ec_wNAF_mul(group, r, scalar, num, points, scalars, ctx);
executed 212 times by 1 test: return ec_wNAF_mul(group, r, scalar, num, points, scalars, ctx);
Executed by:
  • libcrypto.so.1.1
212
911-
912 if (scalar !=
scalar != ((void *)0)Description
TRUEevaluated 905 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1051 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
905-1051
913 ((void *)0)
scalar != ((void *)0)Description
TRUEevaluated 905 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1051 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
905-1051
914 && num == 0
num == 0Description
TRUEevaluated 735 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 170 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
170-735
915-
916 return
executed 735 times by 1 test: return ec_scalar_mul_ladder(group, r, scalar, ((void *)0) , ctx);
Executed by:
  • libcrypto.so.1.1
ec_scalar_mul_ladder(group, r, scalar,
executed 735 times by 1 test: return ec_scalar_mul_ladder(group, r, scalar, ((void *)0) , ctx);
Executed by:
  • libcrypto.so.1.1
735
917 ((void *)0)
executed 735 times by 1 test: return ec_scalar_mul_ladder(group, r, scalar, ((void *)0) , ctx);
Executed by:
  • libcrypto.so.1.1
735
918 , ctx);
executed 735 times by 1 test: return ec_scalar_mul_ladder(group, r, scalar, ((void *)0) , ctx);
Executed by:
  • libcrypto.so.1.1
735
919-
920 if (scalar ==
scalar == ((void *)0)Description
TRUEevaluated 1051 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 170 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
170-1051
921 ((void *)0)
scalar == ((void *)0)Description
TRUEevaluated 1051 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 170 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
170-1051
922 && num == 1
num == 1Description
TRUEevaluated 1051 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
)
0-1051
923-
924 return
executed 1051 times by 1 test: return ec_scalar_mul_ladder(group, r, scalars[0], points[0], ctx);
Executed by:
  • libcrypto.so.1.1
ec_scalar_mul_ladder(group, r, scalars[0], points[0], ctx);
executed 1051 times by 1 test: return ec_scalar_mul_ladder(group, r, scalars[0], points[0], ctx);
Executed by:
  • libcrypto.so.1.1
1051
925-
926-
927-
928-
929-
930-
931 if ((
(t = EC_POINT_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 170 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
t = EC_POINT_new(group)) ==
(t = EC_POINT_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 170 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-170
932 ((void *)0)
(t = EC_POINT_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 170 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-170
933 ) {-
934 ERR_put_error(16,(289),((1|64)),__FILE__,876);-
935 return
never executed: return 0;
0;
never executed: return 0;
0
936 }-
937-
938 if (!ec_scalar_mul_ladder(group, t, scalar,
!ec_scalar_mul...id *)0) , ctx)Description
TRUEnever evaluated
FALSEevaluated 170 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-170
939 ((void *)0)
!ec_scalar_mul...id *)0) , ctx)Description
TRUEnever evaluated
FALSEevaluated 170 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-170
940 , ctx)
!ec_scalar_mul...id *)0) , ctx)Description
TRUEnever evaluated
FALSEevaluated 170 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-170
941 || !ec_scalar_mul_ladder(group, r, scalars[0], points[0], ctx)
!ec_scalar_mul...oints[0], ctx)Description
TRUEnever evaluated
FALSEevaluated 170 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-170
942 || !EC_POINT_add(group, r, t, r, ctx)
!EC_POINT_add(... r, t, r, ctx)Description
TRUEnever evaluated
FALSEevaluated 170 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-170
943 goto
never executed: goto err;
err;
never executed: goto err;
0
944-
945 ret = 1;-
946-
947 err:
code before this statement executed 170 times by 1 test: err:
Executed by:
  • libcrypto.so.1.1
170
948 EC_POINT_free(t);-
949 return
executed 170 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 170 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
170
950}-
951-
952const EC_METHOD *EC_GF2m_simple_method(void)-
953{-
954 static const EC_METHOD ret = {-
955 0x1,-
956 407,-
957 ec_GF2m_simple_group_init,-
958 ec_GF2m_simple_group_finish,-
959 ec_GF2m_simple_group_clear_finish,-
960 ec_GF2m_simple_group_copy,-
961 ec_GF2m_simple_group_set_curve,-
962 ec_GF2m_simple_group_get_curve,-
963 ec_GF2m_simple_group_get_degree,-
964 ec_group_simple_order_bits,-
965 ec_GF2m_simple_group_check_discriminant,-
966 ec_GF2m_simple_point_init,-
967 ec_GF2m_simple_point_finish,-
968 ec_GF2m_simple_point_clear_finish,-
969 ec_GF2m_simple_point_copy,-
970 ec_GF2m_simple_point_set_to_infinity,-
971 0,-
972 0,-
973 ec_GF2m_simple_point_set_affine_coordinates,-
974 ec_GF2m_simple_point_get_affine_coordinates,-
975 0,-
976 0,-
977 0,-
978 ec_GF2m_simple_add,-
979 ec_GF2m_simple_dbl,-
980 ec_GF2m_simple_invert,-
981 ec_GF2m_simple_is_at_infinity,-
982 ec_GF2m_simple_is_on_curve,-
983 ec_GF2m_simple_cmp,-
984 ec_GF2m_simple_make_affine,-
985 ec_GF2m_simple_points_make_affine,-
986 ec_GF2m_simple_points_mul,-
987 0,-
988 0,-
989 ec_GF2m_simple_field_mul,-
990 ec_GF2m_simple_field_sqr,-
991 ec_GF2m_simple_field_div,-
992 0,-
993 0,-
994 0,-
995 ec_key_simple_priv2oct,-
996 ec_key_simple_oct2priv,-
997 0,-
998 ec_key_simple_generate_key,-
999 ec_key_simple_check_key,-
1000 ec_key_simple_generate_public_key,-
1001 0,-
1002 0,-
1003 ecdh_simple_compute_key,-
1004 0,-
1005 0,-
1006 ec_GF2m_simple_ladder_pre,-
1007 ec_GF2m_simple_ladder_step,-
1008 ec_GF2m_simple_ladder_post-
1009 };-
1010-
1011 return
executed 9631 times by 1 test: return &ret;
Executed by:
  • libcrypto.so.1.1
&ret;
executed 9631 times by 1 test: return &ret;
Executed by:
  • libcrypto.so.1.1
9631
1012}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2