OpenCoverage

ec_lib.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/ec/ec_lib.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7EC_GROUP *EC_GROUP_new(const EC_METHOD *meth)-
8{-
9 EC_GROUP *ret;-
10-
11 if (meth ==
meth == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 69938 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-69938
12 ((void *)0)
meth == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 69938 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-69938
13 ) {-
14 ERR_put_error(16,(108),(108),__FILE__,25);-
15 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
16 ((void *)0)
never executed: return ((void *)0) ;
0
17 ;
never executed: return ((void *)0) ;
0
18 }-
19 if (meth->group_init == 0
meth->group_init == 0Description
TRUEnever evaluated
FALSEevaluated 69938 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
0-69938
20 ERR_put_error(16,(108),((2|64)),__FILE__,29);-
21 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
22 ((void *)0)
never executed: return ((void *)0) ;
0
23 ;
never executed: return ((void *)0) ;
0
24 }-
25-
26 ret = CRYPTO_zalloc(sizeof(*ret), __FILE__, 33);-
27 if (ret ==
ret == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 69938 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-69938
28 ((void *)0)
ret == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 69938 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-69938
29 ) {-
30 ERR_put_error(16,(108),((1|64)),__FILE__,35);-
31 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
32 ((void *)0)
never executed: return ((void *)0) ;
0
33 ;
never executed: return ((void *)0) ;
0
34 }-
35-
36 ret->meth = meth;-
37 if ((
(ret->meth->flags & 0x2) == 0Description
TRUEevaluated 69938 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEnever evaluated
ret->meth->flags & 0x2) == 0
(ret->meth->flags & 0x2) == 0Description
TRUEevaluated 69938 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEnever evaluated
) {
0-69938
38 ret->order = BN_new();-
39 if (ret->order ==
ret->order == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 69938 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-69938
40 ((void *)0)
ret->order == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 69938 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-69938
41 )-
42 goto
never executed: goto err;
err;
never executed: goto err;
0
43 ret->cofactor = BN_new();-
44 if (ret->cofactor ==
ret->cofactor == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 69938 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-69938
45 ((void *)0)
ret->cofactor == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 69938 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-69938
46 )-
47 goto
never executed: goto err;
err;
never executed: goto err;
0
48 }
executed 69938 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
69938
49 ret->asn1_flag = 0x001;-
50 ret->asn1_form = POINT_CONVERSION_UNCOMPRESSED;-
51 if (!meth->group_init(ret)
!meth->group_init(ret)Description
TRUEnever evaluated
FALSEevaluated 69938 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
0-69938
52 goto
never executed: goto err;
err;
never executed: goto err;
0
53 return
executed 69938 times by 2 tests: return ret;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
ret;
executed 69938 times by 2 tests: return ret;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
69938
54-
55 err:-
56 BN_free(ret->order);-
57 BN_free(ret->cofactor);-
58 CRYPTO_free(ret, __FILE__, 57);-
59 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
60 ((void *)0)
never executed: return ((void *)0) ;
0
61 ;
never executed: return ((void *)0) ;
0
62}-
63-
64void EC_pre_comp_free(EC_GROUP *group)-
65{-
66 switch (group->pre_comp_type) {-
67 case
executed 69933 times by 2 tests: case PCT_none:
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
PCT_none:
executed 69933 times by 2 tests: case PCT_none:
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
69933
68 break;
executed 69933 times by 2 tests: break;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
69933
69 case
never executed: case PCT_nistz256:
PCT_nistz256:
never executed: case PCT_nistz256:
0
70-
71 EC_nistz256_pre_comp_free(group->pre_comp.nistz256);-
72-
73 break;
never executed: break;
0
74 case
never executed: case PCT_nistp224:
PCT_nistp224:
never executed: case PCT_nistp224:
0
75 case
never executed: case PCT_nistp256:
PCT_nistp256:
never executed: case PCT_nistp256:
0
76 case
never executed: case PCT_nistp521:
PCT_nistp521:
never executed: case PCT_nistp521:
0
77 break;
never executed: break;
0
78-
79 case
executed 51 times by 1 test: case PCT_ec:
Executed by:
  • libcrypto.so.1.1
PCT_ec:
executed 51 times by 1 test: case PCT_ec:
Executed by:
  • libcrypto.so.1.1
51
80 EC_ec_pre_comp_free(group->pre_comp.ec);-
81 break;
executed 51 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
51
82 }-
83 group->pre_comp.ec = -
84 ((void *)0)-
85 ;-
86}
executed 69984 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
69984
87-
88void EC_GROUP_free(EC_GROUP *group)-
89{-
90 if (!group
!groupDescription
TRUEevaluated 44578 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 69232 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
44578-69232
91 return;
executed 44578 times by 2 tests: return;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
44578
92-
93 if (group->meth->group_finish != 0
group->meth->group_finish != 0Description
TRUEevaluated 69232 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEnever evaluated
)
0-69232
94 group->meth->group_finish(group);
executed 69232 times by 2 tests: group->meth->group_finish(group);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
69232
95-
96 EC_pre_comp_free(group);-
97 BN_MONT_CTX_free(group->mont_data);-
98 EC_POINT_free(group->generator);-
99 BN_free(group->order);-
100 BN_free(group->cofactor);-
101 CRYPTO_free(group->seed, __FILE__, 107);-
102 CRYPTO_free(group, __FILE__, 108);-
103}
executed 69232 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
69232
104-
105void EC_GROUP_clear_free(EC_GROUP *group)-
106{-
107 if (!group
!groupDescription
TRUEevaluated 2751 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 706 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
706-2751
108 return;
executed 2751 times by 1 test: return;
Executed by:
  • libcrypto.so.1.1
2751
109-
110 if (group->meth->group_clear_finish != 0
group->meth->g...ar_finish != 0Description
TRUEevaluated 706 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
)
0-706
111 group->meth->group_clear_finish(group);
executed 706 times by 1 test: group->meth->group_clear_finish(group);
Executed by:
  • libcrypto.so.1.1
706
112 else if (group->meth->group_finish != 0
group->meth->group_finish != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
113 group->meth->group_finish(group);
never executed: group->meth->group_finish(group);
0
114-
115 EC_pre_comp_free(group);-
116 BN_MONT_CTX_free(group->mont_data);-
117 EC_POINT_clear_free(group->generator);-
118 BN_clear_free(group->order);-
119 BN_clear_free(group->cofactor);-
120 CRYPTO_clear_free(group->seed, group->seed_len, __FILE__, 126);-
121 CRYPTO_clear_free(group, sizeof(*group), __FILE__, 127);-
122}
executed 706 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
706
123-
124int EC_GROUP_copy(EC_GROUP *dest, const EC_GROUP *src)-
125{-
126 if (dest->meth->group_copy == 0
dest->meth->group_copy == 0Description
TRUEnever evaluated
FALSEevaluated 33939 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
0-33939
127 ERR_put_error(16,(106),((2|64)),__FILE__,133);-
128 return
never executed: return 0;
0;
never executed: return 0;
0
129 }-
130 if (dest->meth != src->meth
dest->meth != src->methDescription
TRUEnever evaluated
FALSEevaluated 33939 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
0-33939
131 ERR_put_error(16,(106),(101),__FILE__,137);-
132 return
never executed: return 0;
0;
never executed: return 0;
0
133 }-
134 if (dest == src
dest == srcDescription
TRUEnever evaluated
FALSEevaluated 33939 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
0-33939
135 return
never executed: return 1;
1;
never executed: return 1;
0
136-
137 dest->curve_name = src->curve_name;-
138-
139-
140 dest->pre_comp_type = src->pre_comp_type;-
141 switch (src->pre_comp_type) {-
142 case
executed 33933 times by 2 tests: case PCT_none:
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
PCT_none:
executed 33933 times by 2 tests: case PCT_none:
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
33933
143 dest->pre_comp.ec = -
144 ((void *)0)-
145 ;-
146 break;
executed 33933 times by 2 tests: break;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
33933
147 case
never executed: case PCT_nistz256:
PCT_nistz256:
never executed: case PCT_nistz256:
0
148-
149 dest->pre_comp.nistz256 = EC_nistz256_pre_comp_dup(src->pre_comp.nistz256);-
150-
151 break;
never executed: break;
0
152 case
never executed: case PCT_nistp224:
PCT_nistp224:
never executed: case PCT_nistp224:
0
153 case
never executed: case PCT_nistp256:
PCT_nistp256:
never executed: case PCT_nistp256:
0
154 case
never executed: case PCT_nistp521:
PCT_nistp521:
never executed: case PCT_nistp521:
0
155 break;
never executed: break;
0
156-
157 case
executed 6 times by 1 test: case PCT_ec:
Executed by:
  • libcrypto.so.1.1
PCT_ec:
executed 6 times by 1 test: case PCT_ec:
Executed by:
  • libcrypto.so.1.1
6
158 dest->pre_comp.ec = EC_ec_pre_comp_dup(src->pre_comp.ec);-
159 break;
executed 6 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
6
160 }-
161-
162 if (src->mont_data !=
src->mont_data != ((void *)0)Description
TRUEevaluated 33936 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
3-33936
163 ((void *)0)
src->mont_data != ((void *)0)Description
TRUEevaluated 33936 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
3-33936
164 ) {-
165 if (dest->mont_data ==
dest->mont_data == ((void *)0)Description
TRUEevaluated 33936 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEnever evaluated
0-33936
166 ((void *)0)
dest->mont_data == ((void *)0)Description
TRUEevaluated 33936 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEnever evaluated
0-33936
167 ) {-
168 dest->mont_data = BN_MONT_CTX_new();-
169 if (dest->mont_data ==
dest->mont_data == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 33936 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-33936
170 ((void *)0)
dest->mont_data == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 33936 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-33936
171 )-
172 return
never executed: return 0;
0;
never executed: return 0;
0
173 }
executed 33936 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
33936
174 if (!BN_MONT_CTX_copy(dest->mont_data, src->mont_data)
!BN_MONT_CTX_c...rc->mont_data)Description
TRUEnever evaluated
FALSEevaluated 33936 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
0-33936
175 return
never executed: return 0;
0;
never executed: return 0;
0
176 }
executed 33936 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
else {
33936
177-
178 BN_MONT_CTX_free(dest->mont_data);-
179 dest->mont_data = -
180 ((void *)0)-
181 ;-
182 }
executed 3 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
3
183-
184 if (src->generator !=
src->generator != ((void *)0)Description
TRUEevaluated 33937 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
2-33937
185 ((void *)0)
src->generator != ((void *)0)Description
TRUEevaluated 33937 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
2-33937
186 ) {-
187 if (dest->generator ==
dest->generator == ((void *)0)Description
TRUEevaluated 33937 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEnever evaluated
0-33937
188 ((void *)0)
dest->generator == ((void *)0)Description
TRUEevaluated 33937 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEnever evaluated
0-33937
189 ) {-
190 dest->generator = EC_POINT_new(dest);-
191 if (dest->generator ==
dest->generator == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 33937 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-33937
192 ((void *)0)
dest->generator == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 33937 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-33937
193 )-
194 return
never executed: return 0;
0;
never executed: return 0;
0
195 }
executed 33937 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
33937
196 if (!EC_POINT_copy(dest->generator, src->generator)
!EC_POINT_copy...rc->generator)Description
TRUEnever evaluated
FALSEevaluated 33937 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
0-33937
197 return
never executed: return 0;
0;
never executed: return 0;
0
198 }
executed 33937 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
else {
33937
199-
200 EC_POINT_clear_free(dest->generator);-
201 dest->generator = -
202 ((void *)0)-
203 ;-
204 }
executed 2 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
2
205-
206 if ((
(src->meth->flags & 0x2) == 0Description
TRUEevaluated 33939 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEnever evaluated
src->meth->flags & 0x2) == 0
(src->meth->flags & 0x2) == 0Description
TRUEevaluated 33939 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEnever evaluated
) {
0-33939
207 if (!BN_copy(dest->order, src->order)
!BN_copy(dest-...r, src->order)Description
TRUEnever evaluated
FALSEevaluated 33939 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
0-33939
208 return
never executed: return 0;
0;
never executed: return 0;
0
209 if (!BN_copy(dest->cofactor, src->cofactor)
!BN_copy(dest-...src->cofactor)Description
TRUEnever evaluated
FALSEevaluated 33939 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
0-33939
210 return
never executed: return 0;
0;
never executed: return 0;
0
211 }
executed 33939 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
33939
212-
213 dest->asn1_flag = src->asn1_flag;-
214 dest->asn1_form = src->asn1_form;-
215-
216 if (src->seed
src->seedDescription
TRUEevaluated 24335 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 9604 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
9604-24335
217 CRYPTO_free(dest->seed, __FILE__, 216);-
218 if ((
(dest->seed = ...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 24335 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
dest->seed = CRYPTO_malloc(src->seed_len, __FILE__, 217)) ==
(dest->seed = ...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 24335 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-24335
219 ((void *)0)
(dest->seed = ...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 24335 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-24335
220 ) {-
221 ERR_put_error(16,(106),((1|64)),__FILE__,218);-
222 return
never executed: return 0;
0;
never executed: return 0;
0
223 }-
224 if (!memcpy(dest->seed, src->seed, src->seed_len)
!memcpy(dest->...src->seed_len)Description
TRUEnever evaluated
FALSEevaluated 24335 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-24335
225 return
never executed: return 0;
0;
never executed: return 0;
0
226 dest->seed_len = src->seed_len;-
227 }
executed 24335 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
24335
228 CRYPTO_free(dest->seed, __FILE__, 225);-
229 dest->seed = -
230 ((void *)0)-
231 ;-
232 dest->seed_len = 0;-
233 }
executed 9604 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
9604
234-
235 return
executed 33939 times by 2 tests: return dest->meth->group_copy(dest, src);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
dest->meth->group_copy(dest, src);
executed 33939 times by 2 tests: return dest->meth->group_copy(dest, src);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
33939
236}-
237-
238EC_GROUP *EC_GROUP_dup(const EC_GROUP *a)-
239{-
240 EC_GROUP *t = -
241 ((void *)0)-
242 ;-
243 int ok = 0;-
244-
245 if (a ==
a == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 33500 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-33500
246 ((void *)0)
a == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 33500 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-33500
247 )-
248 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
249 ((void *)0)
never executed: return ((void *)0) ;
0
250 ;
never executed: return ((void *)0) ;
0
251-
252 if ((
(t = EC_GROUP_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 33500 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
t = EC_GROUP_new(a->meth)) ==
(t = EC_GROUP_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 33500 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-33500
253 ((void *)0)
(t = EC_GROUP_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 33500 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-33500
254 )-
255 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
256 ((void *)0)
never executed: return ((void *)0) ;
0
257 ;
never executed: return ((void *)0) ;
0
258 if (!EC_GROUP_copy(t, a)
!EC_GROUP_copy(t, a)Description
TRUEnever evaluated
FALSEevaluated 33500 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
0-33500
259 goto
never executed: goto err;
err;
never executed: goto err;
0
260-
261 ok = 1;-
262-
263 err:
code before this statement executed 33500 times by 2 tests: err:
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
33500
264 if (!ok
!okDescription
TRUEnever evaluated
FALSEevaluated 33500 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
0-33500
265 EC_GROUP_free(t);-
266 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
267 ((void *)0)
never executed: return ((void *)0) ;
0
268 ;
never executed: return ((void *)0) ;
0
269 }-
270 return
executed 33500 times by 2 tests: return t;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
t;
executed 33500 times by 2 tests: return t;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
33500
271}-
272-
273const EC_METHOD *EC_GROUP_method_of(const EC_GROUP *group)-
274{-
275 return
executed 12520 times by 1 test: return group->meth;
Executed by:
  • libcrypto.so.1.1
group->meth;
executed 12520 times by 1 test: return group->meth;
Executed by:
  • libcrypto.so.1.1
12520
276}-
277-
278int EC_METHOD_get_field_type(const EC_METHOD *meth)-
279{-
280 return
executed 12081 times by 1 test: return meth->field_type;
Executed by:
  • libcrypto.so.1.1
meth->field_type;
executed 12081 times by 1 test: return meth->field_type;
Executed by:
  • libcrypto.so.1.1
12081
281}-
282-
283static int ec_precompute_mont_data(EC_GROUP *);-
284-
285int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator,-
286 const BIGNUM *order, const BIGNUM *cofactor)-
287{-
288 if (generator ==
generator == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 35297 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-35297
289 ((void *)0)
generator == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 35297 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-35297
290 ) {-
291 ERR_put_error(16,(111),((3|64)),__FILE__,272);-
292 return
never executed: return 0;
0;
never executed: return 0;
0
293 }-
294-
295 if (group->generator ==
group->generat...== ((void *)0)Description
TRUEevaluated 35292 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
5-35292
296 ((void *)0)
group->generat...== ((void *)0)Description
TRUEevaluated 35292 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
5-35292
297 ) {-
298 group->generator = EC_POINT_new(group);-
299 if (group->generator ==
group->generat...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 35292 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-35292
300 ((void *)0)
group->generat...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 35292 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-35292
301 )-
302 return
never executed: return 0;
0;
never executed: return 0;
0
303 }
executed 35292 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
35292
304 if (!EC_POINT_copy(group->generator, generator)
!EC_POINT_copy...or, generator)Description
TRUEnever evaluated
FALSEevaluated 35297 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
0-35297
305 return
never executed: return 0;
0;
never executed: return 0;
0
306-
307 if (order !=
order != ((void *)0)Description
TRUEevaluated 35297 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEnever evaluated
0-35297
308 ((void *)0)
order != ((void *)0)Description
TRUEevaluated 35297 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEnever evaluated
0-35297
309 ) {-
310 if (!BN_copy(group->order, order)
!BN_copy(group->order, order)Description
TRUEnever evaluated
FALSEevaluated 35297 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
0-35297
311 return
never executed: return 0;
0;
never executed: return 0;
0
312 }
executed 35297 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
else
35297
313 (
never executed: (BN_set_word((group->order),0));
BN_set_word((group->order),0));
never executed: (BN_set_word((group->order),0));
0
314-
315 if (cofactor !=
cofactor != ((void *)0)Description
TRUEevaluated 35257 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 40 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
40-35257
316 ((void *)0)
cofactor != ((void *)0)Description
TRUEevaluated 35257 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 40 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
40-35257
317 ) {-
318 if (!BN_copy(group->cofactor, cofactor)
!BN_copy(group...tor, cofactor)Description
TRUEnever evaluated
FALSEevaluated 35257 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
0-35257
319 return
never executed: return 0;
0;
never executed: return 0;
0
320 }
executed 35257 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
else
35257
321 (
executed 40 times by 1 test: (BN_set_word((group->cofactor),0));
Executed by:
  • libcrypto.so.1.1
BN_set_word((group->cofactor),0));
executed 40 times by 1 test: (BN_set_word((group->cofactor),0));
Executed by:
  • libcrypto.so.1.1
40
322-
323-
324-
325-
326-
327-
328 if (BN_is_odd(group->order)
BN_is_odd(group->order)Description
TRUEevaluated 35165 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 132 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
132-35165
329 return
executed 35165 times by 2 tests: return ec_precompute_mont_data(group);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
ec_precompute_mont_data(group);
executed 35165 times by 2 tests: return ec_precompute_mont_data(group);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
35165
330 }-
331-
332 BN_MONT_CTX_free(group->mont_data);-
333 group->mont_data = -
334 ((void *)0)-
335 ;-
336 return
executed 132 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 132 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
132
337}-
338-
339const EC_POINT *EC_GROUP_get0_generator(const EC_GROUP *group)-
340{-
341 return
executed 13407 times by 2 tests: return group->generator;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
group->generator;
executed 13407 times by 2 tests: return group->generator;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
13407
342}-
343-
344BN_MONT_CTX *EC_GROUP_get_mont_data(const EC_GROUP *group)-
345{-
346 return
never executed: return group->mont_data;
group->mont_data;
never executed: return group->mont_data;
0
347}-
348-
349int EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx)-
350{-
351 if (group->order ==
group->order == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 99 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-99
352 ((void *)0)
group->order == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 99 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-99
353 )-
354 return
never executed: return 0;
0;
never executed: return 0;
0
355 if (!BN_copy(order, group->order)
!BN_copy(order, group->order)Description
TRUEnever evaluated
FALSEevaluated 99 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-99
356 return
never executed: return 0;
0;
never executed: return 0;
0
357-
358 return
executed 99 times by 1 test: return !BN_is_zero(order);
Executed by:
  • libcrypto.so.1.1
!BN_is_zero(order);
executed 99 times by 1 test: return !BN_is_zero(order);
Executed by:
  • libcrypto.so.1.1
99
359}-
360-
361const BIGNUM *EC_GROUP_get0_order(const EC_GROUP *group)-
362{-
363 return
executed 14676 times by 2 tests: return group->order;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
group->order;
executed 14676 times by 2 tests: return group->order;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
14676
364}-
365-
366int EC_GROUP_order_bits(const EC_GROUP *group)-
367{-
368 return
executed 4444 times by 1 test: return group->meth->group_order_bits(group);
Executed by:
  • libcrypto.so.1.1
group->meth->group_order_bits(group);
executed 4444 times by 1 test: return group->meth->group_order_bits(group);
Executed by:
  • libcrypto.so.1.1
4444
369}-
370-
371int EC_GROUP_get_cofactor(const EC_GROUP *group, BIGNUM *cofactor,-
372 BN_CTX *ctx)-
373{-
374-
375 if (group->cofactor ==
group->cofactor == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 421 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-421
376 ((void *)0)
group->cofactor == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 421 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-421
377 )-
378 return
never executed: return 0;
0;
never executed: return 0;
0
379 if (!BN_copy(cofactor, group->cofactor)
!BN_copy(cofac...oup->cofactor)Description
TRUEnever evaluated
FALSEevaluated 421 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-421
380 return
never executed: return 0;
0;
never executed: return 0;
0
381-
382 return
executed 421 times by 1 test: return !BN_is_zero(group->cofactor);
Executed by:
  • libcrypto.so.1.1
!BN_is_zero(group->cofactor);
executed 421 times by 1 test: return !BN_is_zero(group->cofactor);
Executed by:
  • libcrypto.so.1.1
421
383}-
384-
385const BIGNUM *EC_GROUP_get0_cofactor(const EC_GROUP *group)-
386{-
387 return
executed 12076 times by 1 test: return group->cofactor;
Executed by:
  • libcrypto.so.1.1
group->cofactor;
executed 12076 times by 1 test: return group->cofactor;
Executed by:
  • libcrypto.so.1.1
12076
388}-
389-
390void EC_GROUP_set_curve_name(EC_GROUP *group, int nid)-
391{-
392 group->curve_name = nid;-
393}
executed 35045 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
35045
394-
395int EC_GROUP_get_curve_name(const EC_GROUP *group)-
396{-
397 return
executed 38680 times by 1 test: return group->curve_name;
Executed by:
  • libcrypto.so.1.1
group->curve_name;
executed 38680 times by 1 test: return group->curve_name;
Executed by:
  • libcrypto.so.1.1
38680
398}-
399-
400void EC_GROUP_set_asn1_flag(EC_GROUP *group, int flag)-
401{-
402 group->asn1_flag = flag;-
403}
executed 34077 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
34077
404-
405int EC_GROUP_get_asn1_flag(const EC_GROUP *group)-
406{-
407 return
executed 13625 times by 1 test: return group->asn1_flag;
Executed by:
  • libcrypto.so.1.1
group->asn1_flag;
executed 13625 times by 1 test: return group->asn1_flag;
Executed by:
  • libcrypto.so.1.1
13625
408}-
409-
410void EC_GROUP_set_point_conversion_form(EC_GROUP *group,-
411 point_conversion_form_t form)-
412{-
413 group->asn1_form = form;-
414}
executed 513 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
513
415-
416point_conversion_form_t EC_GROUP_get_point_conversion_form(const EC_GROUP-
417 *group)-
418{-
419 return
executed 92 times by 1 test: return group->asn1_form;
Executed by:
  • libcrypto.so.1.1
group->asn1_form;
executed 92 times by 1 test: return group->asn1_form;
Executed by:
  • libcrypto.so.1.1
92
420}-
421-
422size_t EC_GROUP_set_seed(EC_GROUP *group, const unsigned char *p, size_t len)-
423{-
424 CRYPTO_free(group->seed, __FILE__, 391);-
425 group->seed = -
426 ((void *)0)-
427 ;-
428 group->seed_len = 0;-
429-
430 if (!len
!lenDescription
TRUEnever evaluated
FALSEevaluated 25552 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| !p
!pDescription
TRUEnever evaluated
FALSEevaluated 25552 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-25552
431 return
never executed: return 1;
1;
never executed: return 1;
0
432-
433 if ((
(group->seed =...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 25552 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
group->seed = CRYPTO_malloc(len, __FILE__, 398)) ==
(group->seed =...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 25552 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-25552
434 ((void *)0)
(group->seed =...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 25552 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-25552
435 ) {-
436 ERR_put_error(16,(286),((1|64)),__FILE__,399);-
437 return
never executed: return 0;
0;
never executed: return 0;
0
438 }-
439 memcpy(group->seed, p, len);-
440 group->seed_len = len;-
441-
442 return
executed 25552 times by 1 test: return len;
Executed by:
  • libcrypto.so.1.1
len;
executed 25552 times by 1 test: return len;
Executed by:
  • libcrypto.so.1.1
25552
443}-
444-
445unsigned char *EC_GROUP_get0_seed(const EC_GROUP *group)-
446{-
447 return
executed 45 times by 1 test: return group->seed;
Executed by:
  • libcrypto.so.1.1
group->seed;
executed 45 times by 1 test: return group->seed;
Executed by:
  • libcrypto.so.1.1
45
448}-
449-
450size_t EC_GROUP_get_seed_len(const EC_GROUP *group)-
451{-
452 return
executed 17 times by 1 test: return group->seed_len;
Executed by:
  • libcrypto.so.1.1
group->seed_len;
executed 17 times by 1 test: return group->seed_len;
Executed by:
  • libcrypto.so.1.1
17
453}-
454-
455int EC_GROUP_set_curve(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a,-
456 const BIGNUM *b, BN_CTX *ctx)-
457{-
458 if (group->meth->group_set_curve == 0
group->meth->g...set_curve == 0Description
TRUEnever evaluated
FALSEevaluated 17925 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
0-17925
459 ERR_put_error(16,(292),((2|64)),__FILE__,422);-
460 return
never executed: return 0;
0;
never executed: return 0;
0
461 }-
462 return
executed 17925 times by 2 tests: return group->meth->group_set_curve(group, p, a, b, ctx);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
group->meth->group_set_curve(group, p, a, b, ctx);
executed 17925 times by 2 tests: return group->meth->group_set_curve(group, p, a, b, ctx);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
17925
463}-
464-
465int EC_GROUP_get_curve(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b,-
466 BN_CTX *ctx)-
467{-
468 if (group->meth->group_get_curve ==
group->meth->g...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 158 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-158
469 ((void *)0)
group->meth->g...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 158 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-158
470 ) {-
471 ERR_put_error(16,(291),((2|64)),__FILE__,432);-
472 return
never executed: return 0;
0;
never executed: return 0;
0
473 }-
474 return
executed 158 times by 2 tests: return group->meth->group_get_curve(group, p, a, b, ctx);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
group->meth->group_get_curve(group, p, a, b, ctx);
executed 158 times by 2 tests: return group->meth->group_get_curve(group, p, a, b, ctx);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
158
475}-
476-
477-
478int EC_GROUP_set_curve_GFp(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a,-
479 const BIGNUM *b, BN_CTX *ctx)-
480{-
481 return
never executed: return EC_GROUP_set_curve(group, p, a, b, ctx);
EC_GROUP_set_curve(group, p, a, b, ctx);
never executed: return EC_GROUP_set_curve(group, p, a, b, ctx);
0
482}-
483-
484int EC_GROUP_get_curve_GFp(const EC_GROUP *group, BIGNUM *p, BIGNUM *a,-
485 BIGNUM *b, BN_CTX *ctx)-
486{-
487 return
never executed: return EC_GROUP_get_curve(group, p, a, b, ctx);
EC_GROUP_get_curve(group, p, a, b, ctx);
never executed: return EC_GROUP_get_curve(group, p, a, b, ctx);
0
488}-
489-
490-
491int EC_GROUP_set_curve_GF2m(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a,-
492 const BIGNUM *b, BN_CTX *ctx)-
493{-
494 return
never executed: return EC_GROUP_set_curve(group, p, a, b, ctx);
EC_GROUP_set_curve(group, p, a, b, ctx);
never executed: return EC_GROUP_set_curve(group, p, a, b, ctx);
0
495}-
496-
497int EC_GROUP_get_curve_GF2m(const EC_GROUP *group, BIGNUM *p, BIGNUM *a,-
498 BIGNUM *b, BN_CTX *ctx)-
499{-
500 return
never executed: return EC_GROUP_get_curve(group, p, a, b, ctx);
EC_GROUP_get_curve(group, p, a, b, ctx);
never executed: return EC_GROUP_get_curve(group, p, a, b, ctx);
0
501}-
502-
503-
504-
505int EC_GROUP_get_degree(const EC_GROUP *group)-
506{-
507 if (group->meth->group_get_degree == 0
group->meth->g...et_degree == 0Description
TRUEnever evaluated
FALSEevaluated 10931 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-10931
508 ERR_put_error(16,(173),((2|64)),__FILE__,469);-
509 return
never executed: return 0;
0;
never executed: return 0;
0
510 }-
511 return
executed 10931 times by 1 test: return group->meth->group_get_degree(group);
Executed by:
  • libcrypto.so.1.1
group->meth->group_get_degree(group);
executed 10931 times by 1 test: return group->meth->group_get_degree(group);
Executed by:
  • libcrypto.so.1.1
10931
512}-
513-
514int EC_GROUP_check_discriminant(const EC_GROUP *group, BN_CTX *ctx)-
515{-
516 if (group->meth->group_check_discriminant == 0
group->meth->g...criminant == 0Description
TRUEnever evaluated
FALSEevaluated 216 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-216
517 ERR_put_error(16,(171),((2|64)),__FILE__,479)-
518 ;-
519 return
never executed: return 0;
0;
never executed: return 0;
0
520 }-
521 return
executed 216 times by 1 test: return group->meth->group_check_discriminant(group, ctx);
Executed by:
  • libcrypto.so.1.1
group->meth->group_check_discriminant(group, ctx);
executed 216 times by 1 test: return group->meth->group_check_discriminant(group, ctx);
Executed by:
  • libcrypto.so.1.1
216
522}-
523-
524int EC_GROUP_cmp(const EC_GROUP *a, const EC_GROUP *b, BN_CTX *ctx)-
525{-
526 int r = 0;-
527 BIGNUM *a1, *a2, *a3, *b1, *b2, *b3;-
528 BN_CTX *ctx_new = -
529 ((void *)0)-
530 ;-
531-
532-
533 if (EC_METHOD_get_field_type(EC_GROUP_method_of(a)) !=
EC_METHOD_get_..._method_of(b))Description
TRUEnever evaluated
FALSEevaluated 5992 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-5992
534 EC_METHOD_get_field_type(EC_GROUP_method_of(b))
EC_METHOD_get_..._method_of(b))Description
TRUEnever evaluated
FALSEevaluated 5992 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-5992
535 return
never executed: return 1;
1;
never executed: return 1;
0
536-
537 if (EC_GROUP_get_curve_name(a)
EC_GROUP_get_curve_name(a)Description
TRUEevaluated 5992 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
&& EC_GROUP_get_curve_name(b)
EC_GROUP_get_curve_name(b)Description
TRUEevaluated 5991 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
&&
0-5992
538 EC_GROUP_get_curve_name(a) != EC_GROUP_get_curve_name(b)
EC_GROUP_get_c..._curve_name(b)Description
TRUEnever evaluated
FALSEevaluated 5991 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-5991
539 return
never executed: return 1;
1;
never executed: return 1;
0
540 if (a->meth->flags & 0x2
a->meth->flags & 0x2Description
TRUEnever evaluated
FALSEevaluated 5992 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-5992
541 return
never executed: return 0;
0;
never executed: return 0;
0
542-
543 if (ctx ==
ctx == ((void *)0)Description
TRUEevaluated 5992 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-5992
544 ((void *)0)
ctx == ((void *)0)Description
TRUEevaluated 5992 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-5992
545 )-
546 ctx_new = ctx = BN_CTX_new();
executed 5992 times by 1 test: ctx_new = ctx = BN_CTX_new();
Executed by:
  • libcrypto.so.1.1
5992
547 if (ctx ==
ctx == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 5992 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-5992
548 ((void *)0)
ctx == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 5992 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-5992
549 )-
550 return
never executed: return -1;
-1;
never executed: return -1;
0
551-
552 BN_CTX_start(ctx);-
553 a1 = BN_CTX_get(ctx);-
554 a2 = BN_CTX_get(ctx);-
555 a3 = BN_CTX_get(ctx);-
556 b1 = BN_CTX_get(ctx);-
557 b2 = BN_CTX_get(ctx);-
558 b3 = BN_CTX_get(ctx);-
559 if (b3 ==
b3 == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 5992 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-5992
560 ((void *)0)
b3 == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 5992 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-5992
561 ) {-
562 BN_CTX_end(ctx);-
563 BN_CTX_free(ctx_new);-
564 return
never executed: return -1;
-1;
never executed: return -1;
0
565 }-
566-
567-
568-
569-
570-
571 if (!a->meth->group_get_curve(a, a1, a2, a3, ctx)
!a->meth->grou..., a2, a3, ctx)Description
TRUEnever evaluated
FALSEevaluated 5992 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
||
0-5992
572 !b->meth->group_get_curve(b, b1, b2, b3, ctx)
!b->meth->grou..., b2, b3, ctx)Description
TRUEnever evaluated
FALSEevaluated 5992 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-5992
573 r = 1;
never executed: r = 1;
0
574-
575 if (r
rDescription
TRUEnever evaluated
FALSEevaluated 5992 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| BN_cmp(a1, b1)
BN_cmp(a1, b1)Description
TRUEnever evaluated
FALSEevaluated 5992 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| BN_cmp(a2, b2)
BN_cmp(a2, b2)Description
TRUEnever evaluated
FALSEevaluated 5992 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| BN_cmp(a3, b3)
BN_cmp(a3, b3)Description
TRUEnever evaluated
FALSEevaluated 5992 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-5992
576 r = 1;
never executed: r = 1;
0
577-
578-
579 if (r
rDescription
TRUEnever evaluated
FALSEevaluated 5992 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| EC_POINT_cmp(a, EC_GROUP_get0_generator(a),
EC_POINT_cmp(a...rator(b), ctx)Description
TRUEnever evaluated
FALSEevaluated 5992 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-5992
580 EC_GROUP_get0_generator(b), ctx)
EC_POINT_cmp(a...rator(b), ctx)Description
TRUEnever evaluated
FALSEevaluated 5992 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-5992
581 r = 1;
never executed: r = 1;
0
582-
583 if (!r
!rDescription
TRUEevaluated 5992 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-5992
584 const BIGNUM *ao, *bo, *ac, *bc;-
585-
586 ao = EC_GROUP_get0_order(a);-
587 bo = EC_GROUP_get0_order(b);-
588 ac = EC_GROUP_get0_cofactor(a);-
589 bc = EC_GROUP_get0_cofactor(b);-
590 if (ao ==
ao == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 5992 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-5992
591 ((void *)0)
ao == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 5992 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-5992
592 || bo ==
bo == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 5992 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-5992
593 ((void *)0)
bo == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 5992 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-5992
594 ) {-
595 BN_CTX_end(ctx);-
596 BN_CTX_free(ctx_new);-
597 return
never executed: return -1;
-1;
never executed: return -1;
0
598 }-
599 if (BN_cmp(ao, bo)
BN_cmp(ao, bo)Description
TRUEnever evaluated
FALSEevaluated 5992 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| BN_cmp(ac, bc)
BN_cmp(ac, bc)Description
TRUEnever evaluated
FALSEevaluated 5992 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-5992
600 r = 1;
never executed: r = 1;
0
601 }
executed 5992 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
5992
602-
603 BN_CTX_end(ctx);-
604 BN_CTX_free(ctx_new);-
605-
606 return
executed 5992 times by 1 test: return r;
Executed by:
  • libcrypto.so.1.1
r;
executed 5992 times by 1 test: return r;
Executed by:
  • libcrypto.so.1.1
5992
607}-
608-
609-
610-
611EC_POINT *EC_POINT_new(const EC_GROUP *group)-
612{-
613 EC_POINT *ret;-
614-
615 if (group ==
group == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 175336 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-175336
616 ((void *)0)
group == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 175336 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-175336
617 ) {-
618 ERR_put_error(16,(121),((3|64)),__FILE__,565);-
619 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
620 ((void *)0)
never executed: return ((void *)0) ;
0
621 ;
never executed: return ((void *)0) ;
0
622 }-
623 if (group->meth->point_init ==
group->meth->p...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 175336 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-175336
624 ((void *)0)
group->meth->p...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 175336 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-175336
625 ) {-
626 ERR_put_error(16,(121),((2|64)),__FILE__,569);-
627 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
628 ((void *)0)
never executed: return ((void *)0) ;
0
629 ;
never executed: return ((void *)0) ;
0
630 }-
631-
632 ret = CRYPTO_zalloc(sizeof(*ret), __FILE__, 573);-
633 if (ret ==
ret == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 175336 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-175336
634 ((void *)0)
ret == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 175336 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-175336
635 ) {-
636 ERR_put_error(16,(121),((1|64)),__FILE__,575);-
637 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
638 ((void *)0)
never executed: return ((void *)0) ;
0
639 ;
never executed: return ((void *)0) ;
0
640 }-
641-
642 ret->meth = group->meth;-
643 ret->curve_name = group->curve_name;-
644-
645 if (!ret->meth->point_init(ret)
!ret->meth->point_init(ret)Description
TRUEnever evaluated
FALSEevaluated 175336 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
0-175336
646 CRYPTO_free(ret, __FILE__, 583);-
647 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
648 ((void *)0)
never executed: return ((void *)0) ;
0
649 ;
never executed: return ((void *)0) ;
0
650 }-
651-
652 return
executed 175336 times by 2 tests: return ret;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
ret;
executed 175336 times by 2 tests: return ret;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
175336
653}-
654-
655void EC_POINT_free(EC_POINT *point)-
656{-
657 if (!point
!pointDescription
TRUEevaluated 6352 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 163636 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
6352-163636
658 return;
executed 6352 times by 2 tests: return;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
6352
659-
660 if (point->meth->point_finish != 0
point->meth->point_finish != 0Description
TRUEevaluated 163636 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEnever evaluated
)
0-163636
661 point->meth->point_finish(point);
executed 163636 times by 2 tests: point->meth->point_finish(point);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
163636
662 CRYPTO_free(point, __FILE__, 597);-
663}
executed 163636 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
163636
664-
665void EC_POINT_clear_free(EC_POINT *point)-
666{-
667 if (!point
!pointDescription
TRUEevaluated 3724 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 11700 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
3724-11700
668 return;
executed 3724 times by 1 test: return;
Executed by:
  • libcrypto.so.1.1
3724
669-
670 if (point->meth->point_clear_finish != 0
point->meth->p...ar_finish != 0Description
TRUEevaluated 11700 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEnever evaluated
)
0-11700
671 point->meth->point_clear_finish(point);
executed 11700 times by 2 tests: point->meth->point_clear_finish(point);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
11700
672 else if (point->meth->point_finish != 0
point->meth->point_finish != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
673 point->meth->point_finish(point);
never executed: point->meth->point_finish(point);
0
674 CRYPTO_clear_free(point, sizeof(*point), __FILE__, 609);-
675}
executed 11700 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
11700
676-
677int EC_POINT_copy(EC_POINT *dest, const EC_POINT *src)-
678{-
679 if (dest->meth->point_copy == 0
dest->meth->point_copy == 0Description
TRUEnever evaluated
FALSEevaluated 124373 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
0-124373
680 ERR_put_error(16,(114),((2|64)),__FILE__,615);-
681 return
never executed: return 0;
0;
never executed: return 0;
0
682 }-
683 if (dest->meth != src->meth
dest->meth != src->methDescription
TRUEnever evaluated
FALSEevaluated 124373 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-124373
684 || (dest->curve_name != src->curve_name
dest->curve_na...rc->curve_nameDescription
TRUEnever evaluated
FALSEevaluated 124373 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-124373
685 && dest->curve_name != 0
dest->curve_name != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
686 && src->curve_name != 0
src->curve_name != 0Description
TRUEnever evaluated
FALSEnever evaluated
)) {
0
687 ERR_put_error(16,(114),(101),__FILE__,622);-
688 return
never executed: return 0;
0;
never executed: return 0;
0
689 }-
690 if (dest == src
dest == srcDescription
TRUEevaluated 38995 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 85378 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
38995-85378
691 return
executed 38995 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 38995 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
38995
692 return
executed 85378 times by 2 tests: return dest->meth->point_copy(dest, src);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
dest->meth->point_copy(dest, src);
executed 85378 times by 2 tests: return dest->meth->point_copy(dest, src);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
85378
693}-
694-
695EC_POINT *EC_POINT_dup(const EC_POINT *a, const EC_GROUP *group)-
696{-
697 EC_POINT *t;-
698 int r;-
699-
700 if (a ==
a == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • sm2_internal_test
0-3
701 ((void *)0)
a == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • sm2_internal_test
0-3
702 )-
703 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
704 ((void *)0)
never executed: return ((void *)0) ;
0
705 ;
never executed: return ((void *)0) ;
0
706-
707 t = EC_POINT_new(group);-
708 if (t ==
t == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • sm2_internal_test
0-3
709 ((void *)0)
t == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • sm2_internal_test
0-3
710 )-
711 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
712 ((void *)0)
never executed: return ((void *)0) ;
0
713 ;
never executed: return ((void *)0) ;
0
714 r = EC_POINT_copy(t, a);-
715 if (!r
!rDescription
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • sm2_internal_test
) {
0-3
716 EC_POINT_free(t);-
717 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
718 ((void *)0)
never executed: return ((void *)0) ;
0
719 ;
never executed: return ((void *)0) ;
0
720 }-
721 return
executed 3 times by 1 test: return t;
Executed by:
  • sm2_internal_test
t;
executed 3 times by 1 test: return t;
Executed by:
  • sm2_internal_test
3
722}-
723-
724const EC_METHOD *EC_POINT_method_of(const EC_POINT *point)-
725{-
726 return
never executed: return point->meth;
point->meth;
never executed: return point->meth;
0
727}-
728-
729int EC_POINT_set_to_infinity(const EC_GROUP *group, EC_POINT *point)-
730{-
731 if (group->meth->point_set_to_infinity == 0
group->meth->p..._infinity == 0Description
TRUEnever evaluated
FALSEevaluated 1380 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-1380
732 ERR_put_error(16,(127),((2|64)),__FILE__,658)-
733 ;-
734 return
never executed: return 0;
0;
never executed: return 0;
0
735 }-
736 if (group->meth != point->meth
group->meth != point->methDescription
TRUEnever evaluated
FALSEevaluated 1380 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-1380
737 ERR_put_error(16,(127),(101),__FILE__,662);-
738 return
never executed: return 0;
0;
never executed: return 0;
0
739 }-
740 return
executed 1380 times by 1 test: return group->meth->point_set_to_infinity(group, point);
Executed by:
  • libcrypto.so.1.1
group->meth->point_set_to_infinity(group, point);
executed 1380 times by 1 test: return group->meth->point_set_to_infinity(group, point);
Executed by:
  • libcrypto.so.1.1
1380
741}-
742-
743int EC_POINT_set_Jprojective_coordinates_GFp(const EC_GROUP *group,-
744 EC_POINT *point, const BIGNUM *x,-
745 const BIGNUM *y, const BIGNUM *z,-
746 BN_CTX *ctx)-
747{-
748 if (group->meth->point_set_Jprojective_coordinates_GFp == 0
group->meth->p...nates_GFp == 0Description
TRUEnever evaluated
FALSEevaluated 47761 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
0-47761
749 ERR_put_error(16,(126),((2|64)),__FILE__,675)-
750 ;-
751 return
never executed: return 0;
0;
never executed: return 0;
0
752 }-
753 if (!ec_point_is_compat(point, group)
!ec_point_is_c...(point, group)Description
TRUEnever evaluated
FALSEevaluated 47761 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
0-47761
754 ERR_put_error(16,(126),(101),__FILE__,680)-
755 ;-
756 return
never executed: return 0;
0;
never executed: return 0;
0
757 }-
758 return
executed 47761 times by 2 tests: return group->meth->point_set_Jprojective_coordinates_GFp(group, point, x, y, z, ctx);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
group->meth->point_set_Jprojective_coordinates_GFp(group, point, x,
executed 47761 times by 2 tests: return group->meth->point_set_Jprojective_coordinates_GFp(group, point, x, y, z, ctx);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
47761
759 y, z, ctx);
executed 47761 times by 2 tests: return group->meth->point_set_Jprojective_coordinates_GFp(group, point, x, y, z, ctx);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
47761
760}-
761-
762int EC_POINT_get_Jprojective_coordinates_GFp(const EC_GROUP *group,-
763 const EC_POINT *point, BIGNUM *x,-
764 BIGNUM *y, BIGNUM *z,-
765 BN_CTX *ctx)-
766{-
767 if (group->meth->point_get_Jprojective_coordinates_GFp == 0
group->meth->p...nates_GFp == 0Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-1
768 ERR_put_error(16,(117),((2|64)),__FILE__,694)-
769 ;-
770 return
never executed: return 0;
0;
never executed: return 0;
0
771 }-
772 if (!ec_point_is_compat(point, group)
!ec_point_is_c...(point, group)Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-1
773 ERR_put_error(16,(117),(101),__FILE__,699)-
774 ;-
775 return
never executed: return 0;
0;
never executed: return 0;
0
776 }-
777 return
executed 1 time by 1 test: return group->meth->point_get_Jprojective_coordinates_GFp(group, point, x, y, z, ctx);
Executed by:
  • libcrypto.so.1.1
group->meth->point_get_Jprojective_coordinates_GFp(group, point, x,
executed 1 time by 1 test: return group->meth->point_get_Jprojective_coordinates_GFp(group, point, x, y, z, ctx);
Executed by:
  • libcrypto.so.1.1
1
778 y, z, ctx);
executed 1 time by 1 test: return group->meth->point_get_Jprojective_coordinates_GFp(group, point, x, y, z, ctx);
Executed by:
  • libcrypto.so.1.1
1
779}-
780-
781int EC_POINT_set_affine_coordinates(const EC_GROUP *group, EC_POINT *point,-
782 const BIGNUM *x, const BIGNUM *y,-
783 BN_CTX *ctx)-
784{-
785 if (group->meth->point_set_affine_coordinates ==
group->meth->p...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 128367 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-128367
786 ((void *)0)
group->meth->p...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 128367 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-128367
787 ) {-
788 ERR_put_error(16,(294),((2|64)),__FILE__,712)-
789 ;-
790 return
never executed: return 0;
0;
never executed: return 0;
0
791 }-
792 if (!ec_point_is_compat(point, group)
!ec_point_is_c...(point, group)Description
TRUEnever evaluated
FALSEevaluated 128367 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
0-128367
793 ERR_put_error(16,(294),(101),__FILE__,716);-
794 return
never executed: return 0;
0;
never executed: return 0;
0
795 }-
796 if (!group->meth->point_set_affine_coordinates(group, point, x, y, ctx)
!group->meth->...nt, x, y, ctx)Description
TRUEnever evaluated
FALSEevaluated 128367 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
0-128367
797 return
never executed: return 0;
0;
never executed: return 0;
0
798-
799 if (EC_POINT_is_on_curve(group, point, ctx) <= 0
EC_POINT_is_on...int, ctx) <= 0Description
TRUEevaluated 1011 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 127356 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
1011-127356
800 ERR_put_error(16,(294),(107),__FILE__,723);-
801 return
executed 1011 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 1011 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
1011
802 }-
803 return
executed 127356 times by 2 tests: return 1;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
1;
executed 127356 times by 2 tests: return 1;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
127356
804}-
805-
806-
807int EC_POINT_set_affine_coordinates_GFp(const EC_GROUP *group,-
808 EC_POINT *point, const BIGNUM *x,-
809 const BIGNUM *y, BN_CTX *ctx)-
810{-
811 return
never executed: return EC_POINT_set_affine_coordinates(group, point, x, y, ctx);
EC_POINT_set_affine_coordinates(group, point, x, y, ctx);
never executed: return EC_POINT_set_affine_coordinates(group, point, x, y, ctx);
0
812}-
813-
814-
815int EC_POINT_set_affine_coordinates_GF2m(const EC_GROUP *group,-
816 EC_POINT *point, const BIGNUM *x,-
817 const BIGNUM *y, BN_CTX *ctx)-
818{-
819 return
never executed: return EC_POINT_set_affine_coordinates(group, point, x, y, ctx);
EC_POINT_set_affine_coordinates(group, point, x, y, ctx);
never executed: return EC_POINT_set_affine_coordinates(group, point, x, y, ctx);
0
820}-
821-
822-
823-
824int EC_POINT_get_affine_coordinates(const EC_GROUP *group,-
825 const EC_POINT *point, BIGNUM *x, BIGNUM *y,-
826 BN_CTX *ctx)-
827{-
828 if (group->meth->point_get_affine_coordinates ==
group->meth->p...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 16573 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-16573
829 ((void *)0)
group->meth->p...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 16573 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-16573
830 ) {-
831 ERR_put_error(16,(293),((2|64)),__FILE__,753)-
832 ;-
833 return
never executed: return 0;
0;
never executed: return 0;
0
834 }-
835 if (!ec_point_is_compat(point, group)
!ec_point_is_c...(point, group)Description
TRUEnever evaluated
FALSEevaluated 16573 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
0-16573
836 ERR_put_error(16,(293),(101),__FILE__,757);-
837 return
never executed: return 0;
0;
never executed: return 0;
0
838 }-
839 if (EC_POINT_is_at_infinity(group, point)
EC_POINT_is_at...(group, point)Description
TRUEevaluated 93 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 16480 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
93-16480
840 ERR_put_error(16,(293),(106),__FILE__,761);-
841 return
executed 93 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 93 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
93
842 }-
843 return
executed 16480 times by 2 tests: return group->meth->point_get_affine_coordinates(group, point, x, y, ctx);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
group->meth->point_get_affine_coordinates(group, point, x, y, ctx);
executed 16480 times by 2 tests: return group->meth->point_get_affine_coordinates(group, point, x, y, ctx);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
16480
844}-
845-
846-
847int EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *group,-
848 const EC_POINT *point, BIGNUM *x,-
849 BIGNUM *y, BN_CTX *ctx)-
850{-
851 return
never executed: return EC_POINT_get_affine_coordinates(group, point, x, y, ctx);
EC_POINT_get_affine_coordinates(group, point, x, y, ctx);
never executed: return EC_POINT_get_affine_coordinates(group, point, x, y, ctx);
0
852}-
853-
854-
855int EC_POINT_get_affine_coordinates_GF2m(const EC_GROUP *group,-
856 const EC_POINT *point, BIGNUM *x,-
857 BIGNUM *y, BN_CTX *ctx)-
858{-
859 return
never executed: return EC_POINT_get_affine_coordinates(group, point, x, y, ctx);
EC_POINT_get_affine_coordinates(group, point, x, y, ctx);
never executed: return EC_POINT_get_affine_coordinates(group, point, x, y, ctx);
0
860}-
861-
862-
863-
864int EC_POINT_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a,-
865 const EC_POINT *b, BN_CTX *ctx)-
866{-
867 if (group->meth->add == 0
group->meth->add == 0Description
TRUEnever evaluated
FALSEevaluated 108182 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
0-108182
868 ERR_put_error(16,(112),((2|64)),__FILE__,789);-
869 return
never executed: return 0;
0;
never executed: return 0;
0
870 }-
871 if (!ec_point_is_compat(r, group)
!ec_point_is_compat(r, group)Description
TRUEnever evaluated
FALSEevaluated 108182 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
|| !ec_point_is_compat(a, group)
!ec_point_is_compat(a, group)Description
TRUEnever evaluated
FALSEevaluated 108182 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-108182
872 || !ec_point_is_compat(b, group)
!ec_point_is_compat(b, group)Description
TRUEnever evaluated
FALSEevaluated 108182 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
0-108182
873 ERR_put_error(16,(112),(101),__FILE__,794);-
874 return
never executed: return 0;
0;
never executed: return 0;
0
875 }-
876 return
executed 108182 times by 2 tests: return group->meth->add(group, r, a, b, ctx);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
group->meth->add(group, r, a, b, ctx);
executed 108182 times by 2 tests: return group->meth->add(group, r, a, b, ctx);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
108182
877}-
878-
879int EC_POINT_dbl(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a,-
880 BN_CTX *ctx)-
881{-
882 if (group->meth->dbl == 0
group->meth->dbl == 0Description
TRUEnever evaluated
FALSEevaluated 202847 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
0-202847
883 ERR_put_error(16,(115),((2|64)),__FILE__,804);-
884 return
never executed: return 0;
0;
never executed: return 0;
0
885 }-
886 if (!ec_point_is_compat(r, group)
!ec_point_is_compat(r, group)Description
TRUEnever evaluated
FALSEevaluated 202847 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
|| !ec_point_is_compat(a, group)
!ec_point_is_compat(a, group)Description
TRUEnever evaluated
FALSEevaluated 202847 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
0-202847
887 ERR_put_error(16,(115),(101),__FILE__,808);-
888 return
never executed: return 0;
0;
never executed: return 0;
0
889 }-
890 return
executed 202847 times by 2 tests: return group->meth->dbl(group, r, a, ctx);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
group->meth->dbl(group, r, a, ctx);
executed 202847 times by 2 tests: return group->meth->dbl(group, r, a, ctx);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
202847
891}-
892-
893int EC_POINT_invert(const EC_GROUP *group, EC_POINT *a, BN_CTX *ctx)-
894{-
895 if (group->meth->invert == 0
group->meth->invert == 0Description
TRUEnever evaluated
FALSEevaluated 26993 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
0-26993
896 ERR_put_error(16,(210),((2|64)),__FILE__,817);-
897 return
never executed: return 0;
0;
never executed: return 0;
0
898 }-
899 if (!ec_point_is_compat(a, group)
!ec_point_is_compat(a, group)Description
TRUEnever evaluated
FALSEevaluated 26993 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
0-26993
900 ERR_put_error(16,(210),(101),__FILE__,821);-
901 return
never executed: return 0;
0;
never executed: return 0;
0
902 }-
903 return
executed 26993 times by 2 tests: return group->meth->invert(group, a, ctx);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
group->meth->invert(group, a, ctx);
executed 26993 times by 2 tests: return group->meth->invert(group, a, ctx);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
26993
904}-
905-
906int EC_POINT_is_at_infinity(const EC_GROUP *group, const EC_POINT *point)-
907{-
908 if (group->meth->is_at_infinity == 0
group->meth->i..._infinity == 0Description
TRUEnever evaluated
FALSEevaluated 724940 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
0-724940
909 ERR_put_error(16,(118),((2|64)),__FILE__,831)-
910 ;-
911 return
never executed: return 0;
0;
never executed: return 0;
0
912 }-
913 if (!ec_point_is_compat(point, group)
!ec_point_is_c...(point, group)Description
TRUEnever evaluated
FALSEevaluated 724940 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
0-724940
914 ERR_put_error(16,(118),(101),__FILE__,835);-
915 return
never executed: return 0;
0;
never executed: return 0;
0
916 }-
917 return
executed 724940 times by 2 tests: return group->meth->is_at_infinity(group, point);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
group->meth->is_at_infinity(group, point);
executed 724940 times by 2 tests: return group->meth->is_at_infinity(group, point);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
724940
918}-
919int EC_POINT_is_on_curve(const EC_GROUP *group, const EC_POINT *point,-
920 BN_CTX *ctx)-
921{-
922 if (group->meth->is_on_curve == 0
group->meth->is_on_curve == 0Description
TRUEnever evaluated
FALSEevaluated 128674 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
0-128674
923 ERR_put_error(16,(119),((2|64)),__FILE__,852);-
924 return
never executed: return 0;
0;
never executed: return 0;
0
925 }-
926 if (!ec_point_is_compat(point, group)
!ec_point_is_c...(point, group)Description
TRUEnever evaluated
FALSEevaluated 128674 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
0-128674
927 ERR_put_error(16,(119),(101),__FILE__,856);-
928 return
never executed: return 0;
0;
never executed: return 0;
0
929 }-
930 return
executed 128674 times by 2 tests: return group->meth->is_on_curve(group, point, ctx);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
group->meth->is_on_curve(group, point, ctx);
executed 128674 times by 2 tests: return group->meth->is_on_curve(group, point, ctx);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
128674
931}-
932-
933int EC_POINT_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT *b,-
934 BN_CTX *ctx)-
935{-
936 if (group->meth->point_cmp == 0
group->meth->point_cmp == 0Description
TRUEnever evaluated
FALSEevaluated 9899 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-9899
937 ERR_put_error(16,(113),((2|64)),__FILE__,866);-
938 return
never executed: return -1;
-1;
never executed: return -1;
0
939 }-
940 if (!ec_point_is_compat(a, group)
!ec_point_is_compat(a, group)Description
TRUEnever evaluated
FALSEevaluated 9899 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| !ec_point_is_compat(b, group)
!ec_point_is_compat(b, group)Description
TRUEnever evaluated
FALSEevaluated 9899 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-9899
941 ERR_put_error(16,(113),(101),__FILE__,870);-
942 return
never executed: return -1;
-1;
never executed: return -1;
0
943 }-
944 return
executed 9899 times by 1 test: return group->meth->point_cmp(group, a, b, ctx);
Executed by:
  • libcrypto.so.1.1
group->meth->point_cmp(group, a, b, ctx);
executed 9899 times by 1 test: return group->meth->point_cmp(group, a, b, ctx);
Executed by:
  • libcrypto.so.1.1
9899
945}-
946-
947int EC_POINT_make_affine(const EC_GROUP *group, EC_POINT *point, BN_CTX *ctx)-
948{-
949 if (group->meth->make_affine == 0
group->meth->make_affine == 0Description
TRUEnever evaluated
FALSEevaluated 6230 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-6230
950 ERR_put_error(16,(120),((2|64)),__FILE__,879);-
951 return
never executed: return 0;
0;
never executed: return 0;
0
952 }-
953 if (!ec_point_is_compat(point, group)
!ec_point_is_c...(point, group)Description
TRUEnever evaluated
FALSEevaluated 6230 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-6230
954 ERR_put_error(16,(120),(101),__FILE__,883);-
955 return
never executed: return 0;
0;
never executed: return 0;
0
956 }-
957 return
executed 6230 times by 1 test: return group->meth->make_affine(group, point, ctx);
Executed by:
  • libcrypto.so.1.1
group->meth->make_affine(group, point, ctx);
executed 6230 times by 1 test: return group->meth->make_affine(group, point, ctx);
Executed by:
  • libcrypto.so.1.1
6230
958}-
959-
960int EC_POINTs_make_affine(const EC_GROUP *group, size_t num,-
961 EC_POINT *points[], BN_CTX *ctx)-
962{-
963 size_t i;-
964-
965 if (group->meth->points_make_affine == 0
group->meth->p...ke_affine == 0Description
TRUEnever evaluated
FALSEevaluated 775 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
0-775
966 ERR_put_error(16,(136),((2|64)),__FILE__,895);-
967 return
never executed: return 0;
0;
never executed: return 0;
0
968 }-
969 for (i = 0; i < num
i < numDescription
TRUEevaluated 22692 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 775 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
; i++) {
775-22692
970 if (!ec_point_is_compat(points[i], group)
!ec_point_is_c...nts[i], group)Description
TRUEnever evaluated
FALSEevaluated 22692 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
0-22692
971 ERR_put_error(16,(136),(101),__FILE__,900);-
972 return
never executed: return 0;
0;
never executed: return 0;
0
973 }-
974 }
executed 22692 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
22692
975 return
executed 775 times by 2 tests: return group->meth->points_make_affine(group, num, points, ctx);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
group->meth->points_make_affine(group, num, points, ctx);
executed 775 times by 2 tests: return group->meth->points_make_affine(group, num, points, ctx);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
775
976}-
977-
978-
979-
980-
981-
982-
983-
984int EC_POINTs_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar,-
985 size_t num, const EC_POINT *points[],-
986 const BIGNUM *scalars[], BN_CTX *ctx)-
987{-
988 int ret = 0;-
989 size_t i = 0;-
990 BN_CTX *new_ctx = -
991 ((void *)0)-
992 ;-
993-
994 if ((
(scalar == ((void *)0) )Description
TRUEevaluated 2473 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 3244 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
scalar ==
(scalar == ((void *)0) )Description
TRUEevaluated 2473 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 3244 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
2473-3244
995 ((void *)0)
(scalar == ((void *)0) )Description
TRUEevaluated 2473 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 3244 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
2473-3244
996 )
(scalar == ((void *)0) )Description
TRUEevaluated 2473 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 3244 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
&& (
(num == 0)Description
TRUEnever evaluated
FALSEevaluated 2473 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
num == 0)
(num == 0)Description
TRUEnever evaluated
FALSEevaluated 2473 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
0-3244
997 return
never executed: return EC_POINT_set_to_infinity(group, r);
EC_POINT_set_to_infinity(group, r);
never executed: return EC_POINT_set_to_infinity(group, r);
0
998 }-
999-
1000 if (!ec_point_is_compat(r, group)
!ec_point_is_compat(r, group)Description
TRUEnever evaluated
FALSEevaluated 5717 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
0-5717
1001 ERR_put_error(16,(290),(101),__FILE__,926);-
1002 return
never executed: return 0;
0;
never executed: return 0;
0
1003 }-
1004 for (i = 0; i < num
i < numDescription
TRUEevaluated 4252 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 5717 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
; i++) {
4252-5717
1005 if (!ec_point_is_compat(points[i], group)
!ec_point_is_c...nts[i], group)Description
TRUEnever evaluated
FALSEevaluated 4252 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
0-4252
1006 ERR_put_error(16,(290),(101),__FILE__,931);-
1007 return
never executed: return 0;
0;
never executed: return 0;
0
1008 }-
1009 }
executed 4252 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
4252
1010-
1011 if (ctx ==
ctx == ((void *)0)Description
TRUEevaluated 402 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 5315 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
402-5315
1012 ((void *)0)
ctx == ((void *)0)Description
TRUEevaluated 402 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 5315 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
402-5315
1013 && (
(ctx = new_ctx...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 402 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
ctx = new_ctx = BN_CTX_secure_new()) ==
(ctx = new_ctx...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 402 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-402
1014 ((void *)0)
(ctx = new_ctx...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 402 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-402
1015 ) {-
1016 ERR_put_error(16,(290),((4|64)),__FILE__,937);-
1017 return
never executed: return 0;
0;
never executed: return 0;
0
1018 }-
1019-
1020 if (group->meth->mul !=
group->meth->m...!= ((void *)0)Description
TRUEevaluated 3188 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2529 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
2529-3188
1021 ((void *)0)
group->meth->m...!= ((void *)0)Description
TRUEevaluated 3188 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2529 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
2529-3188
1022 )-
1023 ret = group->meth->mul(group, r, scalar, num, points, scalars, ctx);
executed 3188 times by 1 test: ret = group->meth->mul(group, r, scalar, num, points, scalars, ctx);
Executed by:
  • libcrypto.so.1.1
3188
1024 else-
1025-
1026 ret = ec_wNAF_mul(group, r, scalar, num, points, scalars, ctx);
executed 2529 times by 2 tests: ret = ec_wNAF_mul(group, r, scalar, num, points, scalars, ctx);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
2529
1027-
1028 BN_CTX_free(new_ctx);-
1029 return
executed 5717 times by 2 tests: return ret;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
ret;
executed 5717 times by 2 tests: return ret;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
5717
1030}-
1031-
1032int EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *g_scalar,-
1033 const EC_POINT *point, const BIGNUM *p_scalar, BN_CTX *ctx)-
1034{-
1035-
1036-
1037 const EC_POINT *points[1];-
1038 const BIGNUM *scalars[1];-
1039-
1040 points[0] = point;-
1041 scalars[0] = p_scalar;-
1042-
1043 return
executed 5317 times by 2 tests: return EC_POINTs_mul(group, r, g_scalar, (point != ((void *)0) && p_scalar != ((void *)0) ), points, scalars, ctx);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
EC_POINTs_mul(group, r, g_scalar,
executed 5317 times by 2 tests: return EC_POINTs_mul(group, r, g_scalar, (point != ((void *)0) && p_scalar != ((void *)0) ), points, scalars, ctx);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
5317
1044 (point !=
executed 5317 times by 2 tests: return EC_POINTs_mul(group, r, g_scalar, (point != ((void *)0) && p_scalar != ((void *)0) ), points, scalars, ctx);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
5317
1045 ((void *)0)
executed 5317 times by 2 tests: return EC_POINTs_mul(group, r, g_scalar, (point != ((void *)0) && p_scalar != ((void *)0) ), points, scalars, ctx);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
5317
1046
executed 5317 times by 2 tests: return EC_POINTs_mul(group, r, g_scalar, (point != ((void *)0) && p_scalar != ((void *)0) ), points, scalars, ctx);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
5317
1047 && p_scalar !=
executed 5317 times by 2 tests: return EC_POINTs_mul(group, r, g_scalar, (point != ((void *)0) && p_scalar != ((void *)0) ), points, scalars, ctx);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
5317
1048 ((void *)0)
executed 5317 times by 2 tests: return EC_POINTs_mul(group, r, g_scalar, (point != ((void *)0) && p_scalar != ((void *)0) ), points, scalars, ctx);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
5317
1049 ), points, scalars, ctx);
executed 5317 times by 2 tests: return EC_POINTs_mul(group, r, g_scalar, (point != ((void *)0) && p_scalar != ((void *)0) ), points, scalars, ctx);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
5317
1050}-
1051-
1052int EC_GROUP_precompute_mult(EC_GROUP *group, BN_CTX *ctx)-
1053{-
1054 if (group->meth->mul == 0
group->meth->mul == 0Description
TRUEevaluated 45 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 53 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
45-53
1055-
1056 return
executed 45 times by 1 test: return ec_wNAF_precompute_mult(group, ctx);
Executed by:
  • libcrypto.so.1.1
ec_wNAF_precompute_mult(group, ctx);
executed 45 times by 1 test: return ec_wNAF_precompute_mult(group, ctx);
Executed by:
  • libcrypto.so.1.1
45
1057-
1058 if (group->meth->precompute_mult != 0
group->meth->p...pute_mult != 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 52 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
1-52
1059 return
executed 1 time by 1 test: return group->meth->precompute_mult(group, ctx);
Executed by:
  • libcrypto.so.1.1
group->meth->precompute_mult(group, ctx);
executed 1 time by 1 test: return group->meth->precompute_mult(group, ctx);
Executed by:
  • libcrypto.so.1.1
1
1060 else-
1061 return
executed 52 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 52 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
52
1062}-
1063-
1064int EC_GROUP_have_precompute_mult(const EC_GROUP *group)-
1065{-
1066 if (group->meth->mul == 0
group->meth->mul == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1067-
1068 return
never executed: return ec_wNAF_have_precompute_mult(group);
ec_wNAF_have_precompute_mult(group);
never executed: return ec_wNAF_have_precompute_mult(group);
0
1069-
1070 if (group->meth->have_precompute_mult != 0
group->meth->h...pute_mult != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1071 return
never executed: return group->meth->have_precompute_mult(group);
group->meth->have_precompute_mult(group);
never executed: return group->meth->have_precompute_mult(group);
0
1072 else-
1073 return
never executed: return 0;
0;
never executed: return 0;
0
1074-
1075}-
1076-
1077-
1078-
1079-
1080-
1081static int ec_precompute_mont_data(EC_GROUP *group)-
1082{-
1083 BN_CTX *ctx = BN_CTX_new();-
1084 int ret = 0;-
1085-
1086 BN_MONT_CTX_free(group->mont_data);-
1087 group->mont_data = -
1088 ((void *)0)-
1089 ;-
1090-
1091 if (ctx ==
ctx == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 35165 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-35165
1092 ((void *)0)
ctx == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 35165 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-35165
1093 )-
1094 goto
never executed: goto err;
err;
never executed: goto err;
0
1095-
1096 group->mont_data = BN_MONT_CTX_new();-
1097 if (group->mont_data ==
group->mont_da...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 35165 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-35165
1098 ((void *)0)
group->mont_da...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 35165 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-35165
1099 )-
1100 goto
never executed: goto err;
err;
never executed: goto err;
0
1101-
1102 if (!BN_MONT_CTX_set(group->mont_data, group->order, ctx)
!BN_MONT_CTX_s...p->order, ctx)Description
TRUEnever evaluated
FALSEevaluated 35165 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
0-35165
1103 BN_MONT_CTX_free(group->mont_data);-
1104 group->mont_data = -
1105 ((void *)0)-
1106 ;-
1107 goto
never executed: goto err;
err;
never executed: goto err;
0
1108 }-
1109-
1110 ret = 1;-
1111-
1112 err:
code before this statement executed 35165 times by 2 tests: err:
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
35165
1113-
1114 BN_CTX_free(ctx);-
1115 return
executed 35165 times by 2 tests: return ret;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
ret;
executed 35165 times by 2 tests: return ret;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
35165
1116}-
1117-
1118int EC_KEY_set_ex_data(EC_KEY *key, int idx, void *arg)-
1119{-
1120 return
never executed: return CRYPTO_set_ex_data(&key->ex_data, idx, arg);
CRYPTO_set_ex_data(&key->ex_data, idx, arg);
never executed: return CRYPTO_set_ex_data(&key->ex_data, idx, arg);
0
1121}-
1122-
1123void *EC_KEY_get_ex_data(const EC_KEY *key, int idx)-
1124{-
1125 return
never executed: return CRYPTO_get_ex_data(&key->ex_data, idx);
CRYPTO_get_ex_data(&key->ex_data, idx);
never executed: return CRYPTO_get_ex_data(&key->ex_data, idx);
0
1126}-
1127-
1128int ec_group_simple_order_bits(const EC_GROUP *group)-
1129{-
1130 if (group->order ==
group->order == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 4444 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4444
1131 ((void *)0)
group->order == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 4444 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4444
1132 )-
1133 return
never executed: return 0;
0;
never executed: return 0;
0
1134 return
executed 4444 times by 1 test: return BN_num_bits(group->order);
Executed by:
  • libcrypto.so.1.1
BN_num_bits(group->order);
executed 4444 times by 1 test: return BN_num_bits(group->order);
Executed by:
  • libcrypto.so.1.1
4444
1135}-
1136-
1137static int ec_field_inverse_mod_ord(const EC_GROUP *group, BIGNUM *r,-
1138 const BIGNUM *x, BN_CTX *ctx)-
1139{-
1140 BIGNUM *e = -
1141 ((void *)0)-
1142 ;-
1143 BN_CTX *new_ctx = -
1144 ((void *)0)-
1145 ;-
1146 int ret = 0;-
1147-
1148 if (group->mont_data ==
group->mont_da...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 541 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-541
1149 ((void *)0)
group->mont_da...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 541 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-541
1150 )-
1151 return
never executed: return 0;
0;
never executed: return 0;
0
1152-
1153 if (ctx ==
ctx == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 541 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-541
1154 ((void *)0)
ctx == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 541 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-541
1155 && (
(ctx = new_ctx...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
ctx = new_ctx = BN_CTX_secure_new()) ==
(ctx = new_ctx...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1156 ((void *)0)
(ctx = new_ctx...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1157 )-
1158 return
never executed: return 0;
0;
never executed: return 0;
0
1159-
1160 BN_CTX_start(ctx);-
1161 if ((
(e = BN_CTX_ge...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 541 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
e = BN_CTX_get(ctx)) ==
(e = BN_CTX_ge...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 541 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-541
1162 ((void *)0)
(e = BN_CTX_ge...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 541 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-541
1163 )-
1164 goto
never executed: goto err;
err;
never executed: goto err;
0
1165-
1166-
1167-
1168-
1169-
1170 if (!BN_set_word(e, 2)
!BN_set_word(e, 2)Description
TRUEnever evaluated
FALSEevaluated 541 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
0-541
1171 goto
never executed: goto err;
err;
never executed: goto err;
0
1172 if (!BN_sub(e, group->order, e)
!BN_sub(e, group->order, e)Description
TRUEnever evaluated
FALSEevaluated 541 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
0-541
1173 goto
never executed: goto err;
err;
never executed: goto err;
0
1174-
1175-
1176-
1177-
1178 if (!BN_mod_exp_mont(r, x, e, group->order, ctx, group->mont_data)
!BN_mod_exp_mo...up->mont_data)Description
TRUEnever evaluated
FALSEevaluated 541 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
0-541
1179 goto
never executed: goto err;
err;
never executed: goto err;
0
1180-
1181 ret = 1;-
1182-
1183 err:
code before this statement executed 541 times by 2 tests: err:
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
541
1184 if (ctx !=
ctx != ((void *)0)Description
TRUEevaluated 541 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEnever evaluated
0-541
1185 ((void *)0)
ctx != ((void *)0)Description
TRUEevaluated 541 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEnever evaluated
0-541
1186 )-
1187 BN_CTX_end(ctx);
executed 541 times by 2 tests: BN_CTX_end(ctx);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
541
1188 BN_CTX_free(new_ctx);-
1189 return
executed 541 times by 2 tests: return ret;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
ret;
executed 541 times by 2 tests: return ret;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
541
1190}-
1191int ec_group_do_inverse_ord(const EC_GROUP *group, BIGNUM *res,-
1192 const BIGNUM *x, BN_CTX *ctx)-
1193{-
1194 if (group->meth->field_inverse_mod_ord !=
group->meth->f...!= ((void *)0)Description
TRUEevaluated 413 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 541 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
413-541
1195 ((void *)0)
group->meth->f...!= ((void *)0)Description
TRUEevaluated 413 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 541 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
413-541
1196 )-
1197 return
executed 413 times by 1 test: return group->meth->field_inverse_mod_ord(group, res, x, ctx);
Executed by:
  • libcrypto.so.1.1
group->meth->field_inverse_mod_ord(group, res, x, ctx);
executed 413 times by 1 test: return group->meth->field_inverse_mod_ord(group, res, x, ctx);
Executed by:
  • libcrypto.so.1.1
413
1198 else-
1199 return
executed 541 times by 2 tests: return ec_field_inverse_mod_ord(group, res, x, ctx);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
ec_field_inverse_mod_ord(group, res, x, ctx);
executed 541 times by 2 tests: return ec_field_inverse_mod_ord(group, res, x, ctx);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
541
1200}-
1201int ec_point_blind_coordinates(const EC_GROUP *group, EC_POINT *p, BN_CTX *ctx)-
1202{-
1203 if (group->meth->blind_coordinates ==
group->meth->b...== ((void *)0)Description
TRUEevaluated 2126 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2004 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
2004-2126
1204 ((void *)0)
group->meth->b...== ((void *)0)Description
TRUEevaluated 2126 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2004 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
2004-2126
1205 )-
1206 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
1207-
1208 return
executed 2004 times by 2 tests: return group->meth->blind_coordinates(group, p, ctx);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
group->meth->blind_coordinates(group, p, ctx);
executed 2004 times by 2 tests: return group->meth->blind_coordinates(group, p, ctx);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
2004
1209}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2