OpenCoverage

ec2_oct.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/ec/ec2_oct.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2int ec_GF2m_simple_set_compressed_coordinates(const EC_GROUP *group,-
3 EC_POINT *point,-
4 const BIGNUM *x_, int y_bit,-
5 BN_CTX *ctx)-
6{-
7 BN_CTX *new_ctx = -
8 ((void *)0)-
9 ;-
10 BIGNUM *tmp, *x, *y, *z;-
11 int ret = 0, z0;-
12-
13-
14 ERR_clear_error();-
15-
16 if (ctx ==
ctx == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 6045 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-6045
17 ((void *)0)
ctx == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 6045 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-6045
18 ) {-
19 ctx = new_ctx = BN_CTX_new();-
20 if (ctx ==
ctx == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
21 ((void *)0)
ctx == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
22 )-
23 return
never executed: return 0;
0;
never executed: return 0;
0
24 }
never executed: end of block
0
25-
26 y_bit = (
(y_bit != 0)Description
TRUEevaluated 5754 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 291 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
y_bit != 0)
(y_bit != 0)Description
TRUEevaluated 5754 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 291 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
? 1 : 0;
291-5754
27-
28 BN_CTX_start(ctx);-
29 tmp = BN_CTX_get(ctx);-
30 x = BN_CTX_get(ctx);-
31 y = BN_CTX_get(ctx);-
32 z = BN_CTX_get(ctx);-
33 if (z ==
z == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 6045 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-6045
34 ((void *)0)
z == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 6045 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-6045
35 )-
36 goto
never executed: goto err;
err;
never executed: goto err;
0
37-
38 if (!BN_GF2m_mod_arr(x, x_, group->poly)
!BN_GF2m_mod_a..., group->poly)Description
TRUEnever evaluated
FALSEevaluated 6045 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-6045
39 goto
never executed: goto err;
err;
never executed: goto err;
0
40 if (BN_is_zero(x)
BN_is_zero(x)Description
TRUEevaluated 1111 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4934 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
1111-4934
41 if (!BN_GF2m_mod_sqrt_arr(y, group->b, group->poly, ctx)
!BN_GF2m_mod_s...up->poly, ctx)Description
TRUEnever evaluated
FALSEevaluated 1111 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1111
42 goto
never executed: goto err;
err;
never executed: goto err;
0
43 }
executed 1111 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
1111
44 if (!group->meth->field_sqr(group, tmp, x, ctx)
!group->meth->..., tmp, x, ctx)Description
TRUEnever evaluated
FALSEevaluated 4934 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-4934
45 goto
never executed: goto err;
err;
never executed: goto err;
0
46 if (!group->meth->field_div(group, tmp, group->b, tmp, ctx)
!group->meth->...->b, tmp, ctx)Description
TRUEnever evaluated
FALSEevaluated 4934 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-4934
47 goto
never executed: goto err;
err;
never executed: goto err;
0
48 if (!BN_GF2m_add(tmp, group->a, tmp)
!BN_GF2m_add(t...group->a, tmp)Description
TRUEnever evaluated
FALSEevaluated 4934 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-4934
49 goto
never executed: goto err;
err;
never executed: goto err;
0
50 if (!BN_GF2m_add(tmp, x, tmp)
!BN_GF2m_add(tmp, x, tmp)Description
TRUEnever evaluated
FALSEevaluated 4934 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-4934
51 goto
never executed: goto err;
err;
never executed: goto err;
0
52 if (!BN_GF2m_mod_solve_quad_arr(z, tmp, group->poly, ctx)
!BN_GF2m_mod_s...up->poly, ctx)Description
TRUEevaluated 2314 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2620 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
2314-2620
53 unsigned long err = ERR_peek_last_error();-
54-
55 if ((
(int)(((err) >...& 0x0FFL) == 3Description
TRUEevaluated 2314 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
int)(((err) >> 24L) & 0x0FFL) == 3
(int)(((err) >...& 0x0FFL) == 3Description
TRUEevaluated 2314 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-2314
56 && (
(int)( (err) & 0xFFFL) == 116Description
TRUEevaluated 1483 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 831 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
int)( (err) & 0xFFFL) == 116
(int)( (err) & 0xFFFL) == 116Description
TRUEevaluated 1483 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 831 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
831-1483
57 ERR_clear_error();-
58 ERR_put_error(16,(164),(110),__FILE__,82)-
59 ;-
60 }
executed 1483 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else
1483
61 ERR_put_error(16,(164),(3),__FILE__,85)
executed 831 times by 1 test: ERR_put_error(16,(164),(3),__FILE__,85) ;
Executed by:
  • libcrypto.so.1.1
831
62 ;
executed 831 times by 1 test: ERR_put_error(16,(164),(3),__FILE__,85) ;
Executed by:
  • libcrypto.so.1.1
831
63 goto
executed 2314 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 2314 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
2314
64 }-
65 z0 = (
(BN_is_odd(z))Description
TRUEevaluated 109 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2511 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
BN_is_odd(z))
(BN_is_odd(z))Description
TRUEevaluated 109 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2511 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
? 1 : 0;
109-2511
66 if (!group->meth->field_mul(group, y, x, z, ctx)
!group->meth->... y, x, z, ctx)Description
TRUEnever evaluated
FALSEevaluated 2620 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-2620
67 goto
never executed: goto err;
err;
never executed: goto err;
0
68 if (z0 != y_bit
z0 != y_bitDescription
TRUEevaluated 2402 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 218 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
218-2402
69 if (!BN_GF2m_add(y, y, x)
!BN_GF2m_add(y, y, x)Description
TRUEnever evaluated
FALSEevaluated 2402 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-2402
70 goto
never executed: goto err;
err;
never executed: goto err;
0
71 }
executed 2402 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
2402
72 }
executed 2620 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
2620
73-
74 if (!EC_POINT_set_affine_coordinates(group, point, x, y, ctx)
!EC_POINT_set_...nt, x, y, ctx)Description
TRUEnever evaluated
FALSEevaluated 3731 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-3731
75 goto
never executed: goto err;
err;
never executed: goto err;
0
76-
77 ret = 1;-
78-
79 err:
code before this statement executed 3731 times by 1 test: err:
Executed by:
  • libcrypto.so.1.1
3731
80 BN_CTX_end(ctx);-
81 BN_CTX_free(new_ctx);-
82 return
executed 6045 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 6045 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
6045
83}-
84-
85-
86-
87-
88-
89-
90size_t ec_GF2m_simple_point2oct(const EC_GROUP *group, const EC_POINT *point,-
91 point_conversion_form_t form,-
92 unsigned char *buf, size_t len, BN_CTX *ctx)-
93{-
94 size_t ret;-
95 BN_CTX *new_ctx = -
96 ((void *)0)-
97 ;-
98 int used_ctx = 0;-
99 BIGNUM *x, *y, *yxi;-
100 size_t field_len, i, skip;-
101-
102 if ((
(form != POINT...ON_COMPRESSED)Description
TRUEevaluated 169 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 32 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
form != POINT_CONVERSION_COMPRESSED)
(form != POINT...ON_COMPRESSED)Description
TRUEevaluated 169 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 32 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
32-169
103 && (
(form != POINT..._UNCOMPRESSED)Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 166 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
form != POINT_CONVERSION_UNCOMPRESSED)
(form != POINT..._UNCOMPRESSED)Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 166 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
3-166
104 && (
(form != POINT...ERSION_HYBRID)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
form != POINT_CONVERSION_HYBRID)
(form != POINT...ERSION_HYBRID)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
1-2
105 ERR_put_error(16,(161),(104),__FILE__,126);-
106 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
107 }-
108-
109 if (EC_POINT_is_at_infinity(group, point)
EC_POINT_is_at...(group, point)Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 186 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
14-186
110-
111 if (buf !=
buf != ((void *)0)Description
TRUEevaluated 7 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 7 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
7
112 ((void *)0)
buf != ((void *)0)Description
TRUEevaluated 7 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 7 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
7
113 ) {-
114 if (len < 1
len < 1Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-7
115 ERR_put_error(16,(161),(100),__FILE__,134);-
116 return
never executed: return 0;
0;
never executed: return 0;
0
117 }-
118 buf[0] = 0;-
119 }
executed 7 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
7
120 return
executed 14 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 14 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
14
121 }-
122-
123-
124 field_len = (EC_GROUP_get_degree(group) + 7) / 8;-
125 ret =-
126 (
(form == POINT...ON_COMPRESSED)Description
TRUEevaluated 32 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 154 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
form ==
(form == POINT...ON_COMPRESSED)Description
TRUEevaluated 32 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 154 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
32-154
127 POINT_CONVERSION_COMPRESSED)
(form == POINT...ON_COMPRESSED)Description
TRUEevaluated 32 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 154 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
? 1 + field_len : 1 + 2 * field_len;
32-154
128-
129-
130 if (buf !=
buf != ((void *)0)Description
TRUEevaluated 93 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 93 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
93
131 ((void *)0)
buf != ((void *)0)Description
TRUEevaluated 93 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 93 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
93
132 ) {-
133 if (len < ret
len < retDescription
TRUEnever evaluated
FALSEevaluated 93 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-93
134 ERR_put_error(16,(161),(100),__FILE__,151);-
135 goto
never executed: goto err;
err;
never executed: goto err;
0
136 }-
137-
138 if (ctx ==
ctx == ((void *)0)Description
TRUEevaluated 92 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
1-92
139 ((void *)0)
ctx == ((void *)0)Description
TRUEevaluated 92 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
1-92
140 ) {-
141 ctx = new_ctx = BN_CTX_new();-
142 if (ctx ==
ctx == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 92 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-92
143 ((void *)0)
ctx == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 92 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-92
144 )-
145 return
never executed: return 0;
0;
never executed: return 0;
0
146 }
executed 92 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
92
147-
148 BN_CTX_start(ctx);-
149 used_ctx = 1;-
150 x = BN_CTX_get(ctx);-
151 y = BN_CTX_get(ctx);-
152 yxi = BN_CTX_get(ctx);-
153 if (yxi ==
yxi == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 93 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-93
154 ((void *)0)
yxi == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 93 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-93
155 )-
156 goto
never executed: goto err;
err;
never executed: goto err;
0
157-
158 if (!EC_POINT_get_affine_coordinates(group, point, x, y, ctx)
!EC_POINT_get_...nt, x, y, ctx)Description
TRUEnever evaluated
FALSEevaluated 93 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-93
159 goto
never executed: goto err;
err;
never executed: goto err;
0
160-
161 buf[0] = form;-
162 if ((
(form != POINT..._UNCOMPRESSED)Description
TRUEevaluated 17 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 76 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
form != POINT_CONVERSION_UNCOMPRESSED)
(form != POINT..._UNCOMPRESSED)Description
TRUEevaluated 17 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 76 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& !BN_is_zero(x)
!BN_is_zero(x)Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
1-76
163 if (!group->meth->field_div(group, yxi, y, x, ctx)
!group->meth->...xi, y, x, ctx)Description
TRUEnever evaluated
FALSEevaluated 16 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-16
164 goto
never executed: goto err;
err;
never executed: goto err;
0
165 if (BN_is_odd(yxi)
BN_is_odd(yxi)Description
TRUEevaluated 7 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 9 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
7-9
166 buf[0]++;
executed 7 times by 1 test: buf[0]++;
Executed by:
  • libcrypto.so.1.1
7
167 }
executed 16 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
16
168-
169 i = 1;-
170-
171 skip = field_len - ((BN_num_bits(x)+7)/8);-
172 if (skip > field_len
skip > field_lenDescription
TRUEnever evaluated
FALSEevaluated 93 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-93
173 ERR_put_error(16,(161),((4|64)),__FILE__,184);-
174 goto
never executed: goto err;
err;
never executed: goto err;
0
175 }-
176 while (skip > 0
skip > 0Description
TRUEevaluated 246 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 93 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
93-246
177 buf[i++] = 0;-
178 skip--;-
179 }
executed 246 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
246
180 skip = BN_bn2bin(x, buf + i);-
181 i += skip;-
182 if (i != 1 + field_len
i != 1 + field_lenDescription
TRUEnever evaluated
FALSEevaluated 93 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-93
183 ERR_put_error(16,(161),((4|64)),__FILE__,194);-
184 goto
never executed: goto err;
err;
never executed: goto err;
0
185 }-
186-
187 if (form == POINT_CONVERSION_UNCOMPRESSED
form == POINT_...N_UNCOMPRESSEDDescription
TRUEevaluated 76 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 17 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
17-76
188 || form == POINT_CONVERSION_HYBRID
form == POINT_...VERSION_HYBRIDDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 16 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
1-16
189 skip = field_len - ((BN_num_bits(y)+7)/8);-
190 if (skip > field_len
skip > field_lenDescription
TRUEnever evaluated
FALSEevaluated 77 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-77
191 ERR_put_error(16,(161),((4|64)),__FILE__,202);-
192 goto
never executed: goto err;
err;
never executed: goto err;
0
193 }-
194 while (skip > 0
skip > 0Description
TRUEevaluated 94 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 77 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
77-94
195 buf[i++] = 0;-
196 skip--;-
197 }
executed 94 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
94
198 skip = BN_bn2bin(y, buf + i);-
199 i += skip;-
200 }
executed 77 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
77
201-
202 if (i != ret
i != retDescription
TRUEnever evaluated
FALSEevaluated 93 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-93
203 ERR_put_error(16,(161),((4|64)),__FILE__,214);-
204 goto
never executed: goto err;
err;
never executed: goto err;
0
205 }-
206 }
executed 93 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
93
207-
208 if (used_ctx
used_ctxDescription
TRUEevaluated 93 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 93 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
93
209 BN_CTX_end(ctx);
executed 93 times by 1 test: BN_CTX_end(ctx);
Executed by:
  • libcrypto.so.1.1
93
210 BN_CTX_free(new_ctx);-
211 return
executed 186 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 186 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
186
212-
213 err:-
214 if (used_ctx
used_ctxDescription
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1
215 BN_CTX_end(ctx);
never executed: BN_CTX_end(ctx);
0
216 BN_CTX_free(new_ctx);-
217 return
executed 1 time by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 1 time by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
1
218}-
219-
220-
221-
222-
223-
224int ec_GF2m_simple_oct2point(const EC_GROUP *group, EC_POINT *point,-
225 const unsigned char *buf, size_t len,-
226 BN_CTX *ctx)-
227{-
228 point_conversion_form_t form;-
229 int y_bit;-
230 BN_CTX *new_ctx = -
231 ((void *)0)-
232 ;-
233 BIGNUM *x, *y, *yxi;-
234 size_t field_len, enc_len;-
235 int ret = 0;-
236-
237 if (len == 0
len == 0Description
TRUEevaluated 80 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 9189 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
80-9189
238 ERR_put_error(16,(160),(100),__FILE__,247);-
239 return
executed 80 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 80 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
80
240 }-
241 form = buf[0];-
242 y_bit = form & 1;-
243 form = form & ~1U;-
244 if ((
(form != 0)Description
TRUEevaluated 8841 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 348 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
form != 0)
(form != 0)Description
TRUEevaluated 8841 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 348 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& (
(form != POINT...ON_COMPRESSED)Description
TRUEevaluated 2484 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 6357 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
form != POINT_CONVERSION_COMPRESSED)
(form != POINT...ON_COMPRESSED)Description
TRUEevaluated 2484 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 6357 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
348-8841
245 && (
(form != POINT..._UNCOMPRESSED)Description
TRUEevaluated 1213 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1271 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
form != POINT_CONVERSION_UNCOMPRESSED)
(form != POINT..._UNCOMPRESSED)Description
TRUEevaluated 1213 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1271 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
1213-1271
246 && (
(form != POINT...ERSION_HYBRID)Description
TRUEevaluated 572 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 641 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
form != POINT_CONVERSION_HYBRID)
(form != POINT...ERSION_HYBRID)Description
TRUEevaluated 572 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 641 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
572-641
247 ERR_put_error(16,(160),(102),__FILE__,256);-
248 return
executed 572 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 572 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
572
249 }-
250 if ((form == 0
form == 0Description
TRUEevaluated 348 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 8269 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| form == POINT_CONVERSION_UNCOMPRESSED
form == POINT_...N_UNCOMPRESSEDDescription
TRUEevaluated 1271 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 6998 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) && y_bit
y_bitDescription
TRUEevaluated 75 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1544 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
75-8269
251 ERR_put_error(16,(160),(102),__FILE__,260);-
252 return
executed 75 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 75 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
75
253 }-
254-
255 if (form == 0
form == 0Description
TRUEevaluated 274 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 8268 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
274-8268
256 if (len != 1
len != 1Description
TRUEevaluated 77 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 197 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
77-197
257 ERR_put_error(16,(160),(102),__FILE__,266);-
258 return
executed 77 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 77 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
77
259 }-
260-
261 return
executed 197 times by 1 test: return EC_POINT_set_to_infinity(group, point);
Executed by:
  • libcrypto.so.1.1
EC_POINT_set_to_infinity(group, point);
executed 197 times by 1 test: return EC_POINT_set_to_infinity(group, point);
Executed by:
  • libcrypto.so.1.1
197
262 }-
263-
264 field_len = (EC_GROUP_get_degree(group) + 7) / 8;-
265 enc_len =-
266 (
(form == POINT...ON_COMPRESSED)Description
TRUEevaluated 6357 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1911 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
form ==
(form == POINT...ON_COMPRESSED)Description
TRUEevaluated 6357 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1911 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
1911-6357
267 POINT_CONVERSION_COMPRESSED)
(form == POINT...ON_COMPRESSED)Description
TRUEevaluated 6357 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1911 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
? 1 + field_len : 1 + 2 * field_len;
1911-6357
268-
269 if (len != enc_len
len != enc_lenDescription
TRUEevaluated 258 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 8010 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
258-8010
270 ERR_put_error(16,(160),(102),__FILE__,279);-
271 return
executed 258 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 258 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
258
272 }-
273-
274 if (ctx ==
ctx == ((void *)0)Description
TRUEevaluated 8009 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
1-8009
275 ((void *)0)
ctx == ((void *)0)Description
TRUEevaluated 8009 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
1-8009
276 ) {-
277 ctx = new_ctx = BN_CTX_new();-
278 if (ctx ==
ctx == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 8009 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-8009
279 ((void *)0)
ctx == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 8009 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-8009
280 )-
281 return
never executed: return 0;
0;
never executed: return 0;
0
282 }
executed 8009 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
8009
283-
284 BN_CTX_start(ctx);-
285 x = BN_CTX_get(ctx);-
286 y = BN_CTX_get(ctx);-
287 yxi = BN_CTX_get(ctx);-
288 if (yxi ==
yxi == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 8010 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-8010
289 ((void *)0)
yxi == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 8010 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-8010
290 )-
291 goto
never executed: goto err;
err;
never executed: goto err;
0
292-
293 if (!BN_bin2bn(buf + 1, field_len, x)
!BN_bin2bn(buf... field_len, x)Description
TRUEnever evaluated
FALSEevaluated 8010 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-8010
294 goto
never executed: goto err;
err;
never executed: goto err;
0
295 if (BN_ucmp(x, group->field) >= 0
BN_ucmp(x, group->field) >= 0Description
TRUEevaluated 92 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 7918 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
92-7918
296 ERR_put_error(16,(160),(102),__FILE__,299);-
297 goto
executed 92 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 92 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
92
298 }-
299-
300 if (form == POINT_CONVERSION_COMPRESSED
form == POINT_...ION_COMPRESSEDDescription
TRUEevaluated 6045 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1873 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
1873-6045
301 if (!EC_POINT_set_compressed_coordinates(group, point, x, y_bit, ctx)
!EC_POINT_set_...x, y_bit, ctx)Description
TRUEevaluated 2314 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3731 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
2314-3731
302 goto
executed 2314 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 2314 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
2314
303 }
executed 3731 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
3731
304 if (!BN_bin2bn(buf + 1 + field_len, field_len, y)
!BN_bin2bn(buf... field_len, y)Description
TRUEnever evaluated
FALSEevaluated 1873 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1873
305 goto
never executed: goto err;
err;
never executed: goto err;
0
306 if (BN_ucmp(y, group->field) >= 0
BN_ucmp(y, group->field) >= 0Description
TRUEevaluated 73 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1800 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
73-1800
307 ERR_put_error(16,(160),(102),__FILE__,310);-
308 goto
executed 73 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 73 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
73
309 }-
310 if (form == POINT_CONVERSION_HYBRID
form == POINT_...VERSION_HYBRIDDescription
TRUEevaluated 566 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1234 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
566-1234
311 if (!group->meth->field_div(group, yxi, y, x, ctx)
!group->meth->...xi, y, x, ctx)Description
TRUEevaluated 77 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 489 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
77-489
312 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
313 if (y_bit != BN_is_odd(yxi)
y_bit != BN_is_odd(yxi)Description
TRUEevaluated 98 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 391 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
98-391
314 ERR_put_error(16,(160),(102),__FILE__,317);-
315 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
316 }-
317 }
executed 391 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
391
318-
319-
320-
321-
322-
323 if (!EC_POINT_set_affine_coordinates(group, point, x, y, ctx)
!EC_POINT_set_...nt, x, y, ctx)Description
TRUEevaluated 516 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1109 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
516-1109
324 goto
executed 516 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 516 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
516
325 }
executed 1109 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
1109
326-
327 ret = 1;-
328-
329 err:
code before this statement executed 4840 times by 1 test: err:
Executed by:
  • libcrypto.so.1.1
4840
330 BN_CTX_end(ctx);-
331 BN_CTX_free(new_ctx);-
332 return
executed 8010 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 8010 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
8010
333}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2