OpenCoverage

bn_lib.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/bn/bn_lib.c
Switch to Source codePreprocessed file
LineSourceCount
1static int bn_limit_bits = 0;-
2static int bn_limit_num = 8;-
3static int bn_limit_bits_low = 0;-
4static int bn_limit_num_low = 8;-
5static int bn_limit_bits_high = 0;-
6static int bn_limit_num_high = 8;-
7static int bn_limit_bits_mont = 0;-
8static int bn_limit_num_mont = 8;-
9-
10void BN_set_params(int mult, int high, int low, int mont)-
11{-
12 if (mult >= 0
mult >= 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
13 if (mult > (int)(sizeof(int) * 8) - 1
mult > (int)(s...(int) * 8) - 1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
14 mult = sizeof(int) * 8 - 1;
never executed: mult = sizeof(int) * 8 - 1;
0
15 bn_limit_bits = mult;-
16 bn_limit_num = 1 << mult;-
17 }
never executed: end of block
0
18 if (high >= 0
high >= 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
19 if (high > (int)(sizeof(int) * 8) - 1
high > (int)(s...(int) * 8) - 1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
20 high = sizeof(int) * 8 - 1;
never executed: high = sizeof(int) * 8 - 1;
0
21 bn_limit_bits_high = high;-
22 bn_limit_num_high = 1 << high;-
23 }
never executed: end of block
0
24 if (low >= 0
low >= 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
25 if (low > (int)(sizeof(int) * 8) - 1
low > (int)(si...(int) * 8) - 1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
26 low = sizeof(int) * 8 - 1;
never executed: low = sizeof(int) * 8 - 1;
0
27 bn_limit_bits_low = low;-
28 bn_limit_num_low = 1 << low;-
29 }
never executed: end of block
0
30 if (mont >= 0
mont >= 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
31 if (mont > (int)(sizeof(int) * 8) - 1
mont > (int)(s...(int) * 8) - 1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
32 mont = sizeof(int) * 8 - 1;
never executed: mont = sizeof(int) * 8 - 1;
0
33 bn_limit_bits_mont = mont;-
34 bn_limit_num_mont = 1 << mont;-
35 }
never executed: end of block
0
36}
never executed: end of block
0
37-
38int BN_get_params(int which)-
39{-
40 if (which == 0
which == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
41 return
never executed: return bn_limit_bits;
bn_limit_bits;
never executed: return bn_limit_bits;
0
42 else if (which == 1
which == 1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
43 return
never executed: return bn_limit_bits_high;
bn_limit_bits_high;
never executed: return bn_limit_bits_high;
0
44 else if (which == 2
which == 2Description
TRUEnever evaluated
FALSEnever evaluated
)
0
45 return
never executed: return bn_limit_bits_low;
bn_limit_bits_low;
never executed: return bn_limit_bits_low;
0
46 else if (which == 3
which == 3Description
TRUEnever evaluated
FALSEnever evaluated
)
0
47 return
never executed: return bn_limit_bits_mont;
bn_limit_bits_mont;
never executed: return bn_limit_bits_mont;
0
48 else-
49 return
never executed: return 0;
0;
never executed: return 0;
0
50}-
51-
52-
53const BIGNUM *BN_value_one(void)-
54{-
55 static const unsigned long data_one = 1L;-
56 static const BIGNUM const_one =-
57 { (unsigned long *)&data_one, 1, 1, 0, 0x02 };-
58-
59 return
executed 167455 times by 2 tests: return &const_one;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
&const_one;
executed 167455 times by 2 tests: return &const_one;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
167455
60}-
61-
62int BN_num_bits_word(unsigned long l)-
63{-
64 unsigned long x, mask;-
65 int bits = (l != 0);-
66-
67-
68 x = l >> 32;-
69 mask = (0 - x) & (0xffffffffffffffffL);-
70 mask = (0 - (mask >> ((8 * 8) - 1)));-
71 bits += 32 & mask;-
72 l ^= (x ^ l) & mask;-
73-
74-
75 x = l >> 16;-
76 mask = (0 - x) & (0xffffffffffffffffL);-
77 mask = (0 - (mask >> ((8 * 8) - 1)));-
78 bits += 16 & mask;-
79 l ^= (x ^ l) & mask;-
80-
81 x = l >> 8;-
82 mask = (0 - x) & (0xffffffffffffffffL);-
83 mask = (0 - (mask >> ((8 * 8) - 1)));-
84 bits += 8 & mask;-
85 l ^= (x ^ l) & mask;-
86-
87 x = l >> 4;-
88 mask = (0 - x) & (0xffffffffffffffffL);-
89 mask = (0 - (mask >> ((8 * 8) - 1)));-
90 bits += 4 & mask;-
91 l ^= (x ^ l) & mask;-
92-
93 x = l >> 2;-
94 mask = (0 - x) & (0xffffffffffffffffL);-
95 mask = (0 - (mask >> ((8 * 8) - 1)));-
96 bits += 2 & mask;-
97 l ^= (x ^ l) & mask;-
98-
99 x = l >> 1;-
100 mask = (0 - x) & (0xffffffffffffffffL);-
101 mask = (0 - (mask >> ((8 * 8) - 1)));-
102 bits += 1 & mask;-
103-
104 return
executed 27251278 times by 2 tests: return bits;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
bits;
executed 27251278 times by 2 tests: return bits;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
27251278
105}-
106-
107int BN_num_bits(const BIGNUM *a)-
108{-
109 int i = a->top - 1;-
110 ;-
111-
112 if (BN_is_zero(a)
BN_is_zero(a)Description
TRUEevaluated 11962 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 23356888 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
11962-23356888
113 return
executed 11962 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 11962 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
11962
114 return
executed 23356888 times by 2 tests: return ((i * (8 * 8)) + BN_num_bits_word(a->d[i]));
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
((i * (8 * 8)) + BN_num_bits_word(a->d[i]));
executed 23356888 times by 2 tests: return ((i * (8 * 8)) + BN_num_bits_word(a->d[i]));
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
23356888
115}-
116-
117static void bn_free_d(BIGNUM *a)-
118{-
119 if (BN_get_flags(a, 0x08)
BN_get_flags(a, 0x08)Description
TRUEevaluated 74763 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 4855179 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
74763-4855179
120 CRYPTO_secure_free(a->d, __FILE__, 148);
executed 74763 times by 2 tests: CRYPTO_secure_free(a->d, __FILE__, 148);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
74763
121 else-
122 CRYPTO_free(a->d, __FILE__, 150);
executed 4855179 times by 2 tests: CRYPTO_free(a->d, __FILE__, 150);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
4855179
123}-
124-
125-
126void BN_clear_free(BIGNUM *a)-
127{-
128 if (a ==
a == ((void *)0)Description
TRUEevaluated 346187 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 1926437 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
346187-1926437
129 ((void *)0)
a == ((void *)0)Description
TRUEevaluated 346187 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 1926437 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
346187-1926437
130 )-
131 return;
executed 346187 times by 2 tests: return;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
346187
132 if (a->d !=
a->d != ((void *)0)Description
TRUEevaluated 1763832 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 162605 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
162605-1763832
133 ((void *)0)
a->d != ((void *)0)Description
TRUEevaluated 1763832 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 162605 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
162605-1763832
134 && !BN_get_flags(a, 0x02)
!BN_get_flags(a, 0x02)Description
TRUEevaluated 1763830 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-1763830
135 OPENSSL_cleanse(a->d, a->dmax * sizeof(a->d[0]));-
136 bn_free_d(a);-
137 }
executed 1763830 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
1763830
138 if (BN_get_flags(a, 0x01)
BN_get_flags(a, 0x01)Description
TRUEevaluated 198408 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 1728029 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
198408-1728029
139 OPENSSL_cleanse(a, sizeof(*a));-
140 CRYPTO_free(a, __FILE__, 164);-
141 }
executed 198408 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
198408
142}
executed 1926437 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
1926437
143-
144void BN_free(BIGNUM *a)-
145{-
146 if (a ==
a == ((void *)0)Description
TRUEevaluated 325716 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 1181122 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
325716-1181122
147 ((void *)0)
a == ((void *)0)Description
TRUEevaluated 325716 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 1181122 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
325716-1181122
148 )-
149 return;
executed 325716 times by 2 tests: return;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
325716
150 if (!BN_get_flags(a, 0x02)
!BN_get_flags(a, 0x02)Description
TRUEevaluated 1176667 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 4455 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
4455-1176667
151 bn_free_d(a);
executed 1176667 times by 2 tests: bn_free_d(a);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
1176667
152 if (a->flags & 0x01
a->flags & 0x01Description
TRUEevaluated 1179966 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 1156 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
1156-1179966
153 CRYPTO_free(a, __FILE__, 175);
executed 1179966 times by 2 tests: CRYPTO_free(a, __FILE__, 175);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
1179966
154}
executed 1181122 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
1181122
155-
156void bn_init(BIGNUM *a)-
157{-
158 static BIGNUM nilbn;-
159-
160 *a = nilbn;-
161 ;-
162}
executed 5213480 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
5213480
163-
164BIGNUM *BN_new(void)-
165{-
166 BIGNUM *ret;-
167-
168 if ((
(ret = CRYPTO_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 1378374 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
ret = CRYPTO_zalloc(sizeof(*ret), __FILE__, 190)) ==
(ret = CRYPTO_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 1378374 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-1378374
169 ((void *)0)
(ret = CRYPTO_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 1378374 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-1378374
170 ) {-
171 ERR_put_error(3,(113),((1|64)),__FILE__,191);-
172 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
173 ((void *)0)
never executed: return ((void *)0) ;
0
174 ;
never executed: return ((void *)0) ;
0
175 }-
176 ret->flags = 0x01;-
177 ;-
178 return
executed 1378374 times by 2 tests: return ret;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
ret;
executed 1378374 times by 2 tests: return ret;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
1378374
179}-
180-
181 BIGNUM *BN_secure_new(void)-
182 {-
183 BIGNUM *ret = BN_new();-
184 if (ret !=
ret != ((void *)0)Description
TRUEevaluated 75262 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-75262
185 ((void *)0)
ret != ((void *)0)Description
TRUEevaluated 75262 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-75262
186 )-
187 ret->flags |= 0x08;
executed 75262 times by 1 test: ret->flags |= 0x08;
Executed by:
  • libcrypto.so.1.1
75262
188 return
executed 75262 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 75262 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
75262
189 }-
190-
191-
192-
193static unsigned long *bn_expand_internal(const BIGNUM *b, int words)-
194{-
195 unsigned long *a = -
196 ((void *)0)-
197 ;-
198-
199 if (words > (0x7fffffff / (4 * (8 * 8)))
words > (0x7ff...(4 * (8 * 8)))Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4889508 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
3-4889508
200 ERR_put_error(3,(120),(114),__FILE__,214);-
201 return
executed 3 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
executed 3 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
3
202 ((void *)0)
executed 3 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
3
203 ;
executed 3 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
3
204 }-
205 if (BN_get_flags(b, 0x02)
BN_get_flags(b, 0x02)Description
TRUEnever evaluated
FALSEevaluated 4889508 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
0-4889508
206 ERR_put_error(3,(120),(105),__FILE__,218);-
207 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
208 ((void *)0)
never executed: return ((void *)0) ;
0
209 ;
never executed: return ((void *)0) ;
0
210 }-
211 if (BN_get_flags(b, 0x08)
BN_get_flags(b, 0x08)Description
TRUEevaluated 74760 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 4814748 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
74760-4814748
212 a = CRYPTO_secure_zalloc(words * sizeof(*a), __FILE__, 222);
executed 74760 times by 2 tests: a = CRYPTO_secure_zalloc(words * sizeof(*a), __FILE__, 222);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
74760
213 else-
214 a = CRYPTO_zalloc(words * sizeof(*a), __FILE__, 224);
executed 4814748 times by 2 tests: a = CRYPTO_zalloc(words * sizeof(*a), __FILE__, 224);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
4814748
215 if (a ==
a == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 4889508 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-4889508
216 ((void *)0)
a == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 4889508 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-4889508
217 ) {-
218 ERR_put_error(3,(120),((1|64)),__FILE__,226);-
219 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
220 ((void *)0)
never executed: return ((void *)0) ;
0
221 ;
never executed: return ((void *)0) ;
0
222 }-
223-
224 -
225 ((void) (0))-
226 ;-
227 if (b->top > 0
b->top > 0Description
TRUEevaluated 430883 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 4458625 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
430883-4458625
228 memcpy(a, b->d, sizeof(*a) * b->top);
executed 430883 times by 2 tests: memcpy(a, b->d, sizeof(*a) * b->top);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
430883
229-
230 return
executed 4889508 times by 2 tests: return a;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
a;
executed 4889508 times by 2 tests: return a;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
4889508
231}-
232BIGNUM *bn_expand2(BIGNUM *b, int words)-
233{-
234 if (words > b->dmax
words > b->dmaxDescription
TRUEevaluated 4889511 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEnever evaluated
) {
0-4889511
235 unsigned long *a = bn_expand_internal(b, words);-
236 if (!a
!aDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4889508 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
3-4889508
237 return
executed 3 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
executed 3 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
3
238 ((void *)0)
executed 3 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
3
239 ;
executed 3 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
3
240 if (b->d
b->dDescription
TRUEevaluated 1989445 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 2900063 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
1989445-2900063
241 OPENSSL_cleanse(b->d, b->dmax * sizeof(b->d[0]));-
242 bn_free_d(b);-
243 }
executed 1989445 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
1989445
244 b->d = a;-
245 b->dmax = words;-
246 }
executed 4889508 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
4889508
247-
248 return
executed 4889508 times by 2 tests: return b;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
b;
executed 4889508 times by 2 tests: return b;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
4889508
249}-
250-
251BIGNUM *BN_dup(const BIGNUM *a)-
252{-
253 BIGNUM *t;-
254-
255 if (a ==
a == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 46612 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-46612
256 ((void *)0)
a == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 46612 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-46612
257 )-
258 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
259 ((void *)0)
never executed: return ((void *)0) ;
0
260 ;
never executed: return ((void *)0) ;
0
261 ;-
262-
263 t = BN_get_flags(a, 0x08)
BN_get_flags(a, 0x08)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 46611 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
? BN_secure_new() : BN_new();
1-46611
264 if (t ==
t == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 46612 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-46612
265 ((void *)0)
t == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 46612 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-46612
266 )-
267 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
268 ((void *)0)
never executed: return ((void *)0) ;
0
269 ;
never executed: return ((void *)0) ;
0
270 if (!BN_copy(t, a)
!BN_copy(t, a)Description
TRUEnever evaluated
FALSEevaluated 46612 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
0-46612
271 BN_free(t);-
272 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
273 ((void *)0)
never executed: return ((void *)0) ;
0
274 ;
never executed: return ((void *)0) ;
0
275 }-
276 ;-
277 return
executed 46612 times by 2 tests: return t;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
t;
executed 46612 times by 2 tests: return t;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
46612
278}-
279-
280BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)-
281{-
282 ;-
283-
284 if (a == b
a == bDescription
TRUEevaluated 1712 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3248124 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
1712-3248124
285 return
executed 1712 times by 1 test: return a;
Executed by:
  • libcrypto.so.1.1
a;
executed 1712 times by 1 test: return a;
Executed by:
  • libcrypto.so.1.1
1712
286 if (bn_wexpand(a, b->top) ==
bn_wexpand(a, ...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 3248124 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-3248124
287 ((void *)0)
bn_wexpand(a, ...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 3248124 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-3248124
288 )-
289 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
290 ((void *)0)
never executed: return ((void *)0) ;
0
291 ;
never executed: return ((void *)0) ;
0
292-
293 if (b->top > 0
b->top > 0Description
TRUEevaluated 3168135 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 79989 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
79989-3168135
294 memcpy(a->d, b->d, sizeof(b->d[0]) * b->top);
executed 3168135 times by 2 tests: memcpy(a->d, b->d, sizeof(b->d[0]) * b->top);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
3168135
295-
296 a->neg = b->neg;-
297 a->top = b->top;-
298 a->flags |= b->flags & 0;-
299 ;-
300 return
executed 3248124 times by 2 tests: return a;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
a;
executed 3248124 times by 2 tests: return a;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
3248124
301}-
302-
303-
304-
305-
306-
307-
308-
309void BN_swap(BIGNUM *a, BIGNUM *b)-
310{-
311 int flags_old_a, flags_old_b;-
312 unsigned long *tmp_d;-
313 int tmp_top, tmp_dmax, tmp_neg;-
314-
315 ;-
316 ;-
317-
318 flags_old_a = a->flags;-
319 flags_old_b = b->flags;-
320-
321 tmp_d = a->d;-
322 tmp_top = a->top;-
323 tmp_dmax = a->dmax;-
324 tmp_neg = a->neg;-
325-
326 a->d = b->d;-
327 a->top = b->top;-
328 a->dmax = b->dmax;-
329 a->neg = b->neg;-
330-
331 b->d = tmp_d;-
332 b->top = tmp_top;-
333 b->dmax = tmp_dmax;-
334 b->neg = tmp_neg;-
335-
336 a->flags = ((flags_old_a) & (0x01)) | ((flags_old_b) & (0x02 | 0x04 | 0x08 | 0));-
337 b->flags = ((flags_old_b) & (0x01)) | ((flags_old_a) & (0x02 | 0x04 | 0x08 | 0));-
338 ;-
339 ;-
340}
executed 2 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
2
341-
342void BN_clear(BIGNUM *a)-
343{-
344 ;-
345 if (a->d !=
a->d != ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
346 ((void *)0)
a->d != ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
347 )-
348 OPENSSL_cleanse(a->d, sizeof(*a->d) * a->dmax);
never executed: OPENSSL_cleanse(a->d, sizeof(*a->d) * a->dmax);
0
349 a->neg = 0;-
350 a->top = 0;-
351 a->flags &= ~0;-
352}
never executed: end of block
0
353-
354unsigned long BN_get_word(const BIGNUM *a)-
355{-
356 if (a->top > 1
a->top > 1Description
TRUEevaluated 582 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 879 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
582-879
357 return
executed 582 times by 1 test: return (0xffffffffffffffffL);
Executed by:
  • libcrypto.so.1.1
(0xffffffffffffffffL);
executed 582 times by 1 test: return (0xffffffffffffffffL);
Executed by:
  • libcrypto.so.1.1
582
358 else if (a->top == 1
a->top == 1Description
TRUEevaluated 876 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
3-876
359 return
executed 876 times by 1 test: return a->d[0];
Executed by:
  • libcrypto.so.1.1
a->d[0];
executed 876 times by 1 test: return a->d[0];
Executed by:
  • libcrypto.so.1.1
876
360-
361 return
executed 3 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 3 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
3
362}-
363-
364int BN_set_word(BIGNUM *a, unsigned long w)-
365{-
366 ;-
367 if (bn_expand(a, (int)sizeof(unsigned long) * 8) ==
bn_expand(a, (...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 97681932 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-97681932
368 ((void *)0)
bn_expand(a, (...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 97681932 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-97681932
369 )-
370 return
never executed: return 0;
0;
never executed: return 0;
0
371 a->neg = 0;-
372 a->d[0] = w;-
373 a->top = (w
wDescription
TRUEevaluated 174034 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 97507898 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
? 1 : 0);
174034-97507898
374 a->flags &= ~0;-
375 ;-
376 return
executed 97681932 times by 2 tests: return 1;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
1;
executed 97681932 times by 2 tests: return 1;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
97681932
377}-
378-
379BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret)-
380{-
381 unsigned int i, m;-
382 unsigned int n;-
383 unsigned long l;-
384 BIGNUM *bn = -
385 ((void *)0)-
386 ;-
387-
388 if (ret ==
ret == ((void *)0)Description
TRUEevaluated 228973 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 323799 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
228973-323799
389 ((void *)0)
ret == ((void *)0)Description
TRUEevaluated 228973 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 323799 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
228973-323799
390 )-
391 ret = bn = BN_new();
executed 228973 times by 2 tests: ret = bn = BN_new();
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
228973
392 if (ret ==
ret == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 552772 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-552772
393 ((void *)0)
ret == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 552772 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-552772
394 )-
395 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
396 ((void *)0)
never executed: return ((void *)0) ;
0
397 ;
never executed: return ((void *)0) ;
0
398 ;-
399-
400 for ( ; len > 0
len > 0Description
TRUEevaluated 1060628 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 11110 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& *
*s == 0Description
TRUEevaluated 518966 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 541662 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
s == 0
*s == 0Description
TRUEevaluated 518966 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 541662 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
; s++, len--)
11110-1060628
401 continue;
executed 518966 times by 2 tests: continue;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
518966
402 n = len;-
403 if (n == 0
n == 0Description
TRUEevaluated 11107 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 541665 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
11107-541665
404 ret->top = 0;-
405 return
executed 11107 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 11107 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
11107
406 }-
407 i = ((n - 1) / 8) + 1;-
408 m = ((n - 1) % (8));-
409 if (bn_wexpand(ret, (int)i) ==
bn_wexpand(ret...== ((void *)0)Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 541662 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
3-541662
410 ((void *)0)
bn_wexpand(ret...== ((void *)0)Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 541662 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
3-541662
411 ) {-
412 BN_free(bn);-
413 return
executed 3 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
executed 3 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
3
414 ((void *)0)
executed 3 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
3
415 ;
executed 3 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
3
416 }-
417 ret->top = i;-
418 ret->neg = 0;-
419 l = 0;-
420 while (n--
n--Description
TRUEevaluated 28215531 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 541662 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
541662-28215531
421 l = (l << 8L) | *(s++);-
422 if (m-- == 0
m-- == 0Description
TRUEevaluated 3668371 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 24547160 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
3668371-24547160
423 ret->d[--i] = l;-
424 l = 0;-
425 m = 8 - 1;-
426 }
executed 3668371 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
3668371
427 }
executed 28215531 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
28215531
428-
429-
430-
431-
432 bn_correct_top(ret);-
433 return
executed 541662 times by 2 tests: return ret;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
ret;
executed 541662 times by 2 tests: return ret;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
541662
434}-
435-
436-
437static int bn2binpad(const BIGNUM *a, unsigned char *to, int tolen)-
438{-
439 int n;-
440 size_t i, lasti, j, atop, mask;-
441 unsigned long l;-
442-
443-
444-
445-
446-
447-
448 n = ((BN_num_bits(a)+7)/8);-
449 if (tolen == -1
tolen == -1Description
TRUEevaluated 60919 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 6501 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
6501-60919
450 tolen = n;-
451 }
executed 60919 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
else if (tolen < n
tolen < nDescription
TRUEevaluated 78 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 6423 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
78-60919
452 BIGNUM temp = *a;-
453-
454 bn_correct_top(&temp);-
455 n = ((BN_num_bits(&temp)+7)/8);-
456 if (tolen < n
tolen < nDescription
TRUEevaluated 78 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
)
0-78
457 return
executed 78 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
-1;
executed 78 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
78
458 }
never executed: end of block
0
459-
460-
461 atop = a->dmax * 8;-
462 if (atop == 0
atop == 0Description
TRUEevaluated 807 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 66535 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
807-66535
463 OPENSSL_cleanse(to, tolen);-
464 return
executed 807 times by 1 test: return tolen;
Executed by:
  • libcrypto.so.1.1
tolen;
executed 807 times by 1 test: return tolen;
Executed by:
  • libcrypto.so.1.1
807
465 }-
466-
467 lasti = atop - 1;-
468 atop = a->top * 8;-
469 for (i = 0, j = 0, to += tolen; j < (size_t)tolen
j < (size_t)tolenDescription
TRUEevaluated 3658384 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 66535 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
; j++) {
66535-3658384
470 l = a->d[i / 8];-
471 mask = 0 - ((j - atop) >> (8 * sizeof(i) - 1));-
472 *--to = (unsigned char)(l >> (8 * (i % 8)) & mask);-
473 i += (i - lasti) >> (8 * sizeof(i) - 1);-
474 }
executed 3658384 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
3658384
475-
476 return
executed 66535 times by 2 tests: return tolen;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
tolen;
executed 66535 times by 2 tests: return tolen;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
66535
477}-
478-
479int BN_bn2binpad(const BIGNUM *a, unsigned char *to, int tolen)-
480{-
481 if (tolen < 0
tolen < 0Description
TRUEnever evaluated
FALSEevaluated 6501 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
0-6501
482 return
never executed: return -1;
-1;
never executed: return -1;
0
483 return
executed 6501 times by 2 tests: return bn2binpad(a, to, tolen);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
bn2binpad(a, to, tolen);
executed 6501 times by 2 tests: return bn2binpad(a, to, tolen);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
6501
484}-
485-
486int BN_bn2bin(const BIGNUM *a, unsigned char *to)-
487{-
488 return
executed 60919 times by 2 tests: return bn2binpad(a, to, -1);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
bn2binpad(a, to, -1);
executed 60919 times by 2 tests: return bn2binpad(a, to, -1);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
60919
489}-
490-
491BIGNUM *BN_lebin2bn(const unsigned char *s, int len, BIGNUM *ret)-
492{-
493 unsigned int i, m;-
494 unsigned int n;-
495 unsigned long l;-
496 BIGNUM *bn = -
497 ((void *)0)-
498 ;-
499-
500 if (ret ==
ret == ((void *)0)Description
TRUEevaluated 15 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-15
501 ((void *)0)
ret == ((void *)0)Description
TRUEevaluated 15 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-15
502 )-
503 ret = bn = BN_new();
executed 15 times by 1 test: ret = bn = BN_new();
Executed by:
  • libcrypto.so.1.1
15
504 if (ret ==
ret == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 15 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-15
505 ((void *)0)
ret == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 15 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-15
506 )-
507 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
508 ((void *)0)
never executed: return ((void *)0) ;
0
509 ;
never executed: return ((void *)0) ;
0
510 ;-
511 s += len;-
512-
513 for ( ; len > 0
len > 0Description
TRUEevaluated 15 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
&& s[-1] == 0
s[-1] == 0Description
TRUEnever evaluated
FALSEevaluated 15 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; s--, len--)
0-15
514 continue;
never executed: continue;
0
515 n = len;-
516 if (n == 0
n == 0Description
TRUEnever evaluated
FALSEevaluated 15 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-15
517 ret->top = 0;-
518 return
never executed: return ret;
ret;
never executed: return ret;
0
519 }-
520 i = ((n - 1) / 8) + 1;-
521 m = ((n - 1) % (8));-
522 if (bn_wexpand(ret, (int)i) ==
bn_wexpand(ret...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 15 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-15
523 ((void *)0)
bn_wexpand(ret...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 15 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-15
524 ) {-
525 BN_free(bn);-
526 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
527 ((void *)0)
never executed: return ((void *)0) ;
0
528 ;
never executed: return ((void *)0) ;
0
529 }-
530 ret->top = i;-
531 ret->neg = 0;-
532 l = 0;-
533 while (n--
n--Description
TRUEevaluated 1404 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 15 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
15-1404
534 s--;-
535 l = (l << 8L) | *s;-
536 if (m-- == 0
m-- == 0Description
TRUEevaluated 177 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1227 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
177-1227
537 ret->d[--i] = l;-
538 l = 0;-
539 m = 8 - 1;-
540 }
executed 177 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
177
541 }
executed 1404 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
1404
542-
543-
544-
545-
546 bn_correct_top(ret);-
547 return
executed 15 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 15 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
15
548}-
549-
550int BN_bn2lebinpad(const BIGNUM *a, unsigned char *to, int tolen)-
551{-
552 int i;-
553 unsigned long l;-
554 ;-
555 i = ((BN_num_bits(a)+7)/8);-
556 if (tolen < i
tolen < iDescription
TRUEnever evaluated
FALSEevaluated 24 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-24
557 return
never executed: return -1;
-1;
never executed: return -1;
0
558-
559 if (tolen > i
tolen > iDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
4-20
560 memset(to + i, 0, tolen - i);
executed 4 times by 1 test: memset(to + i, 0, tolen - i);
Executed by:
  • libcrypto.so.1.1
4
561 to += i;-
562 while (i--
i--Description
TRUEevaluated 1884 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 24 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
24-1884
563 l = a->d[i / 8];-
564 to--;-
565 *to = (unsigned char)(l >> (8 * (i % 8))) & 0xff;-
566 }
executed 1884 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
1884
567 return
executed 24 times by 1 test: return tolen;
Executed by:
  • libcrypto.so.1.1
tolen;
executed 24 times by 1 test: return tolen;
Executed by:
  • libcrypto.so.1.1
24
568}-
569-
570int BN_ucmp(const BIGNUM *a, const BIGNUM *b)-
571{-
572 int i;-
573 unsigned long t1, t2, *ap, *bp;-
574-
575 ;-
576 ;-
577-
578 i = a->top - b->top;-
579 if (i != 0
i != 0Description
TRUEevaluated 5553445 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 17957942 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
5553445-17957942
580 return
executed 5553445 times by 2 tests: return i;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
i;
executed 5553445 times by 2 tests: return i;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
5553445
581 ap = a->d;-
582 bp = b->d;-
583 for (i = a->top - 1; i >= 0
i >= 0Description
TRUEevaluated 18873871 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 277374 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
; i--) {
277374-18873871
584 t1 = ap[i];-
585 t2 = bp[i];-
586 if (t1 != t2
t1 != t2Description
TRUEevaluated 17680568 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 1193303 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
1193303-17680568
587 return
executed 17680568 times by 2 tests: return ((t1 > t2) ? 1 : -1);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
((
(t1 > t2)Description
TRUEevaluated 5030131 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 12650437 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
t1 > t2)
(t1 > t2)Description
TRUEevaluated 5030131 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 12650437 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
? 1 : -1);
executed 17680568 times by 2 tests: return ((t1 > t2) ? 1 : -1);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
5030131-17680568
588 }
executed 1193303 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
1193303
589 return
executed 277374 times by 2 tests: return 0;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
0;
executed 277374 times by 2 tests: return 0;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
277374
590}-
591-
592int BN_cmp(const BIGNUM *a, const BIGNUM *b)-
593{-
594 int i;-
595 int gt, lt;-
596 unsigned long t1, t2;-
597-
598 if ((
(a == ((void *)0) )Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3486604 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
a ==
(a == ((void *)0) )Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3486604 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
3-3486604
599 ((void *)0)
(a == ((void *)0) )Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3486604 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
3-3486604
600 )
(a == ((void *)0) )Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3486604 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
|| (
(b == ((void *)0) )Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3486601 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
b ==
(b == ((void *)0) )Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3486601 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
3-3486604
601 ((void *)0)
(b == ((void *)0) )Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3486601 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
3-3486601
602 )
(b == ((void *)0) )Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3486601 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
3-3486601
603 if (a !=
a != ((void *)0)Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
3
604 ((void *)0)
a != ((void *)0)Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
3
605 )-
606 return
executed 3 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
-1;
executed 3 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
3
607 else if (b !=
b != ((void *)0)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
608 ((void *)0)
b != ((void *)0)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
609 )-
610 return
executed 1 time by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 1 time by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1
611 else-
612 return
executed 2 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 2 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
2
613 }-
614-
615 ;-
616 ;-
617-
618 if (a->neg != b->neg
a->neg != b->negDescription
TRUEevaluated 14 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3486587 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
14-3486587
619 if (a->neg
a->negDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 10 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
4-10
620 return
executed 4 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
-1;
executed 4 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
4
621 else-
622 return
executed 10 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 10 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
10
623 }-
624 if (a->neg == 0
a->neg == 0Description
TRUEevaluated 3483236 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 3351 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
3351-3483236
625 gt = 1;-
626 lt = -1;-
627 }
executed 3483236 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
else {
3483236
628 gt = -1;-
629 lt = 1;-
630 }
executed 3351 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
3351
631-
632 if (a->top > b->top
a->top > b->topDescription
TRUEevaluated 816003 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 2670584 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
816003-2670584
633 return
executed 816003 times by 2 tests: return gt;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
gt;
executed 816003 times by 2 tests: return gt;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
816003
634 if (a->top < b->top
a->top < b->topDescription
TRUEevaluated 44279 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2626305 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
44279-2626305
635 return
executed 44279 times by 1 test: return lt;
Executed by:
  • libcrypto.so.1.1
lt;
executed 44279 times by 1 test: return lt;
Executed by:
  • libcrypto.so.1.1
44279
636 for (i = a->top - 1; i >= 0
i >= 0Description
TRUEevaluated 3358288 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 122509 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
; i--) {
122509-3358288
637 t1 = a->d[i];-
638 t2 = b->d[i];-
639 if (t1 > t2
t1 > t2Description
TRUEevaluated 909111 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 2449177 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
909111-2449177
640 return
executed 909111 times by 2 tests: return gt;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
gt;
executed 909111 times by 2 tests: return gt;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
909111
641 if (t1 < t2
t1 < t2Description
TRUEevaluated 1594685 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 854492 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
854492-1594685
642 return
executed 1594685 times by 2 tests: return lt;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
lt;
executed 1594685 times by 2 tests: return lt;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
1594685
643 }
executed 854492 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
854492
644 return
executed 122509 times by 2 tests: return 0;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
0;
executed 122509 times by 2 tests: return 0;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
122509
645}-
646-
647int BN_set_bit(BIGNUM *a, int n)-
648{-
649 int i, j, k;-
650-
651 if (n < 0
n < 0Description
TRUEnever evaluated
FALSEevaluated 170758 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
0-170758
652 return
never executed: return 0;
0;
never executed: return 0;
0
653-
654 i = n / (8 * 8);-
655 j = n % (8 * 8);-
656 if (a->top <= i
a->top <= iDescription
TRUEevaluated 170138 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 620 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
620-170138
657 if (bn_wexpand(a, i + 1) ==
bn_wexpand(a, ...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 170138 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-170138
658 ((void *)0)
bn_wexpand(a, ...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 170138 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-170138
659 )-
660 return
never executed: return 0;
0;
never executed: return 0;
0
661 for (k = a->top; k < i + 1
k < i + 1Description
TRUEevaluated 1585657 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 170138 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
; k++)
170138-1585657
662 a->d[k] = 0;
executed 1585657 times by 2 tests: a->d[k] = 0;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
1585657
663 a->top = i + 1;-
664 a->flags &= ~0;-
665 }
executed 170138 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
170138
666-
667 a->d[i] |= (((unsigned long)1) << j);-
668 ;-
669 return
executed 170758 times by 2 tests: return 1;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
1;
executed 170758 times by 2 tests: return 1;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
170758
670}-
671-
672int BN_clear_bit(BIGNUM *a, int n)-
673{-
674 int i, j;-
675-
676 ;-
677 if (n < 0
n < 0Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-2
678 return
never executed: return 0;
0;
never executed: return 0;
0
679-
680 i = n / (8 * 8);-
681 j = n % (8 * 8);-
682 if (a->top <= i
a->top <= iDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-2
683 return
never executed: return 0;
0;
never executed: return 0;
0
684-
685 a->d[i] &= (~(((unsigned long)1) << j));-
686 bn_correct_top(a);-
687 return
executed 2 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 2 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
2
688}-
689-
690int BN_is_bit_set(const BIGNUM *a, int n)-
691{-
692 int i, j;-
693-
694 ;-
695 if (n < 0
n < 0Description
TRUEevaluated 627 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 20344838 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
627-20344838
696 return
executed 627 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 627 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
627
697 i = n / (8 * 8);-
698 j = n % (8 * 8);-
699 if (a->top <= i
a->top <= iDescription
TRUEevaluated 3521 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 20341317 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
3521-20341317
700 return
executed 3521 times by 2 tests: return 0;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
0;
executed 3521 times by 2 tests: return 0;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
3521
701 return
executed 20341317 times by 2 tests: return (int)(((a->d[i]) >> j) & ((unsigned long)1));
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
(int)(((a->d[i]) >> j) & ((unsigned long)1));
executed 20341317 times by 2 tests: return (int)(((a->d[i]) >> j) & ((unsigned long)1));
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
20341317
702}-
703-
704int BN_mask_bits(BIGNUM *a, int n)-
705{-
706 int b, w;-
707-
708 ;-
709 if (n < 0
n < 0Description
TRUEnever evaluated
FALSEevaluated 106 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-106
710 return
never executed: return 0;
0;
never executed: return 0;
0
711-
712 w = n / (8 * 8);-
713 b = n % (8 * 8);-
714 if (w >= a->top
w >= a->topDescription
TRUEnever evaluated
FALSEevaluated 106 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-106
715 return
never executed: return 0;
0;
never executed: return 0;
0
716 if (b == 0
b == 0Description
TRUEnever evaluated
FALSEevaluated 106 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-106
717 a->top = w;
never executed: a->top = w;
0
718 else {-
719 a->top = w + 1;-
720 a->d[w] &= ~((0xffffffffffffffffL) << b);-
721 }
executed 106 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
106
722 bn_correct_top(a);-
723 return
executed 106 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 106 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
106
724}-
725-
726void BN_set_negative(BIGNUM *a, int b)-
727{-
728 if (b
bDescription
TRUEevaluated 4277 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 273582 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
&& !BN_is_zero(a)
!BN_is_zero(a)Description
TRUEevaluated 4233 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 44 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
44-273582
729 a->neg = 1;
executed 4233 times by 1 test: a->neg = 1;
Executed by:
  • libcrypto.so.1.1
4233
730 else-
731 a->neg = 0;
executed 273626 times by 2 tests: a->neg = 0;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
273626
732}-
733-
734int bn_cmp_words(const unsigned long *a, const unsigned long *b, int n)-
735{-
736 int i;-
737 unsigned long aa, bb;-
738-
739 aa = a[n - 1];-
740 bb = b[n - 1];-
741 if (aa != bb
aa != bbDescription
TRUEevaluated 591616 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 104887 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
104887-591616
742 return
executed 591616 times by 1 test: return ((aa > bb) ? 1 : -1);
Executed by:
  • libcrypto.so.1.1
((
(aa > bb)Description
TRUEevaluated 312691 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 278925 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
aa > bb)
(aa > bb)Description
TRUEevaluated 312691 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 278925 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
? 1 : -1);
executed 591616 times by 1 test: return ((aa > bb) ? 1 : -1);
Executed by:
  • libcrypto.so.1.1
278925-591616
743 for (i = n - 2; i >= 0
i >= 0Description
TRUEevaluated 759648 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 45640 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i--) {
45640-759648
744 aa = a[i];-
745 bb = b[i];-
746 if (aa != bb
aa != bbDescription
TRUEevaluated 59247 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 700401 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
59247-700401
747 return
executed 59247 times by 1 test: return ((aa > bb) ? 1 : -1);
Executed by:
  • libcrypto.so.1.1
((
(aa > bb)Description
TRUEevaluated 36019 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 23228 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
aa > bb)
(aa > bb)Description
TRUEevaluated 36019 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 23228 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
? 1 : -1);
executed 59247 times by 1 test: return ((aa > bb) ? 1 : -1);
Executed by:
  • libcrypto.so.1.1
23228-59247
748 }
executed 700401 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
700401
749 return
executed 45640 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 45640 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
45640
750}-
751int bn_cmp_part_words(const unsigned long *a, const unsigned long *b, int cl, int dl)-
752{-
753 int n, i;-
754 n = cl - 1;-
755-
756 if (dl < 0
dl < 0Description
TRUEevaluated 40010 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 677866 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
40010-677866
757 for (i = dl; i < 0
i < 0Description
TRUEevaluated 66274 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3985 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++) {
3985-66274
758 if (b[n - i] != 0
b[n - i] != 0Description
TRUEevaluated 36025 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 30249 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
30249-36025
759 return
executed 36025 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
-1;
executed 36025 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
36025
760 }
executed 30249 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
30249
761 }
executed 3985 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
3985
762 if (dl > 0
dl > 0Description
TRUEevaluated 38964 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 642887 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
38964-642887
763 for (i = dl; i > 0
i > 0Description
TRUEevaluated 145592 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 8644 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i--) {
8644-145592
764 if (a[n + i] != 0
a[n + i] != 0Description
TRUEevaluated 30320 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 115272 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
30320-115272
765 return
executed 30320 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 30320 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
30320
766 }
executed 115272 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
115272
767 }
executed 8644 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
8644
768 return
executed 651531 times by 1 test: return bn_cmp_words(a, b, cl);
Executed by:
  • libcrypto.so.1.1
bn_cmp_words(a, b, cl);
executed 651531 times by 1 test: return bn_cmp_words(a, b, cl);
Executed by:
  • libcrypto.so.1.1
651531
769}-
770void BN_consttime_swap(unsigned long condition, BIGNUM *a, BIGNUM *b, int nwords)-
771{-
772 unsigned long t;-
773 int i;-
774-
775 ;-
776 ;-
777-
778 -
779 ((void) (0))-
780 ;-
781 -
782 ((void) (0))-
783 ;-
784 -
785 ((void) (0))-
786 ;-
787-
788 condition = ((condition - 1) >> ((8 * 8) - 1)) - 1;-
789-
790 t = (a->top ^ b->top) & condition;-
791 a->top ^= t;-
792 b->top ^= t;-
793-
794 t = (a->neg ^ b->neg) & condition;-
795 a->neg ^= t;-
796 b->neg ^= t;-
797 t = ((a->flags ^ b->flags) & 0x04) & condition;-
798 a->flags ^= t;-
799 b->flags ^= t;-
800 switch (nwords) {-
801 default
executed 8 times by 1 test: default:
Executed by:
  • libcrypto.so.1.1
:
executed 8 times by 1 test: default:
Executed by:
  • libcrypto.so.1.1
8
802 for (i = 10; i < nwords
i < nwordsDescription
TRUEevaluated 38 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++)
8-38
803 do { t = (a->d[i] ^ b->d[i]) & condition; a->d[i] ^= t; b->d[i] ^= t; }
executed 38 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
while (0);
38
804-
805 case
executed 651 times by 1 test: case 10:
Executed by:
  • libcrypto.so.1.1
10:
executed 651 times by 1 test: case 10:
Executed by:
  • libcrypto.so.1.1
code before this statement executed 8 times by 1 test: case 10:
Executed by:
  • libcrypto.so.1.1
8-651
806 do { t = (a->d[9] ^ b->d[9]) & condition; a->d[9] ^= t; b->d[9] ^= t; } while (0);-
807 case
executed 1045899 times by 1 test: case 9:
Executed by:
  • libcrypto.so.1.1
9:
executed 1045899 times by 1 test: case 9:
Executed by:
  • libcrypto.so.1.1
code before this statement executed 659 times by 1 test: case 9:
Executed by:
  • libcrypto.so.1.1
659-1045899
808 do { t = (a->d[8] ^ b->d[8]) & condition; a->d[8] ^= t; b->d[8] ^= t; } while (0);-
809 case
executed 115648 times by 1 test: case 8:
Executed by:
  • libcrypto.so.1.1
8:
executed 115648 times by 1 test: case 8:
Executed by:
  • libcrypto.so.1.1
code before this statement executed 1046558 times by 1 test: case 8:
Executed by:
  • libcrypto.so.1.1
115648-1046558
810 do { t = (a->d[7] ^ b->d[7]) & condition; a->d[7] ^= t; b->d[7] ^= t; } while (0);-
811 case
executed 277790 times by 1 test: case 7:
Executed by:
  • libcrypto.so.1.1
7:
executed 277790 times by 1 test: case 7:
Executed by:
  • libcrypto.so.1.1
code before this statement executed 1162206 times by 1 test: case 7:
Executed by:
  • libcrypto.so.1.1
277790-1162206
812 do { t = (a->d[6] ^ b->d[6]) & condition; a->d[6] ^= t; b->d[6] ^= t; } while (0);-
813 case
executed 451358 times by 1 test: case 6:
Executed by:
  • libcrypto.so.1.1
6:
executed 451358 times by 1 test: case 6:
Executed by:
  • libcrypto.so.1.1
code before this statement executed 1439996 times by 1 test: case 6:
Executed by:
  • libcrypto.so.1.1
451358-1439996
814 do { t = (a->d[5] ^ b->d[5]) & condition; a->d[5] ^= t; b->d[5] ^= t; } while (0);-
815 case
executed 279640 times by 2 tests: case 5:
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
5:
executed 279640 times by 2 tests: case 5:
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
code before this statement executed 1891354 times by 1 test: case 5:
Executed by:
  • libcrypto.so.1.1
279640-1891354
816 do { t = (a->d[4] ^ b->d[4]) & condition; a->d[4] ^= t; b->d[4] ^= t; } while (0);-
817 case
executed 738108 times by 2 tests: case 4:
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
4:
executed 738108 times by 2 tests: case 4:
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
code before this statement executed 2170994 times by 2 tests: case 4:
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
738108-2170994
818 do { t = (a->d[3] ^ b->d[3]) & condition; a->d[3] ^= t; b->d[3] ^= t; } while (0);-
819 case
executed 595031 times by 1 test: case 3:
Executed by:
  • libcrypto.so.1.1
3:
executed 595031 times by 1 test: case 3:
Executed by:
  • libcrypto.so.1.1
code before this statement executed 2909102 times by 2 tests: case 3:
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
595031-2909102
820 do { t = (a->d[2] ^ b->d[2]) & condition; a->d[2] ^= t; b->d[2] ^= t; } while (0);-
821 case
executed 93368 times by 1 test: case 2:
Executed by:
  • libcrypto.so.1.1
2:
executed 93368 times by 1 test: case 2:
Executed by:
  • libcrypto.so.1.1
code before this statement executed 3504133 times by 2 tests: case 2:
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
93368-3504133
822 do { t = (a->d[1] ^ b->d[1]) & condition; a->d[1] ^= t; b->d[1] ^= t; } while (0);-
823 case
executed 3597501 times by 2 tests: case 1:
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
1:
executed 3597501 times by 2 tests: case 1:
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
code before this statement executed 3597501 times by 2 tests: case 1:
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
3597501
824 do { t = (a->d[0] ^ b->d[0]) & condition; a->d[0] ^= t; b->d[0] ^= t; } while (0);-
825 }
executed 3597501 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
3597501
826-
827}-
828-
829-
830-
831int BN_security_bits(int L, int N)-
832{-
833 int secbits, bits;-
834 if (L >= 15360
L >= 15360Description
TRUEnever evaluated
FALSEevaluated 11236 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-11236
835 secbits = 256;
never executed: secbits = 256;
0
836 else if (L >= 7680
L >= 7680Description
TRUEnever evaluated
FALSEevaluated 11236 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-11236
837 secbits = 192;
never executed: secbits = 192;
0
838 else if (L >= 3072
L >= 3072Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 11228 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
8-11228
839 secbits = 128;
executed 8 times by 1 test: secbits = 128;
Executed by:
  • libcrypto.so.1.1
8
840 else if (L >= 2048
L >= 2048Description
TRUEevaluated 8765 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2463 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
2463-8765
841 secbits = 112;
executed 8765 times by 1 test: secbits = 112;
Executed by:
  • libcrypto.so.1.1
8765
842 else if (L >= 1024
L >= 1024Description
TRUEevaluated 2456 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 7 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
7-2456
843 secbits = 80;
executed 2456 times by 1 test: secbits = 80;
Executed by:
  • libcrypto.so.1.1
2456
844 else-
845 return
executed 7 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 7 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
7
846 if (N == -1
N == -1Description
TRUEevaluated 9187 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2042 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
2042-9187
847 return
executed 9187 times by 1 test: return secbits;
Executed by:
  • libcrypto.so.1.1
secbits;
executed 9187 times by 1 test: return secbits;
Executed by:
  • libcrypto.so.1.1
9187
848 bits = N / 2;-
849 if (bits < 80
bits < 80Description
TRUEnever evaluated
FALSEevaluated 2042 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-2042
850 return
never executed: return 0;
0;
never executed: return 0;
0
851 return
executed 2042 times by 1 test: return bits >= secbits ? secbits : bits;
Executed by:
  • libcrypto.so.1.1
bits >= secbits
bits >= secbitsDescription
TRUEevaluated 2042 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
? secbits : bits;
executed 2042 times by 1 test: return bits >= secbits ? secbits : bits;
Executed by:
  • libcrypto.so.1.1
0-2042
852}-
853-
854void BN_zero_ex(BIGNUM *a)-
855{-
856 a->neg = 0;-
857 a->top = 0;-
858 a->flags &= ~0;-
859}
never executed: end of block
0
860-
861int BN_abs_is_word(const BIGNUM *a, const unsigned long w)-
862{-
863 return
executed 3905302 times by 2 tests: return ((a->top == 1) && (a->d[0] == w)) || ((w == 0) && (a->top == 0));
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
((
(a->top == 1)Description
TRUEevaluated 431978 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 3473324 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
a->top == 1)
(a->top == 1)Description
TRUEevaluated 431978 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 3473324 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
&& (
(a->d[0] == w)Description
TRUEevaluated 245241 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 186737 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
a->d[0] == w)
(a->d[0] == w)Description
TRUEevaluated 245241 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 186737 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) || ((
(w == 0)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3660057 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
w == 0)
(w == 0)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3660057 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
&& (
(a->top == 0)Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
a->top == 0)
(a->top == 0)Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
);
executed 3905302 times by 2 tests: return ((a->top == 1) && (a->d[0] == w)) || ((w == 0) && (a->top == 0));
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
1-3905302
864}-
865-
866int BN_is_zero(const BIGNUM *a)-
867{-
868 return
executed 52453965 times by 2 tests: return a->top == 0;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
a->top == 0;
executed 52453965 times by 2 tests: return a->top == 0;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
52453965
869}-
870-
871int BN_is_one(const BIGNUM *a)-
872{-
873 return
executed 3786971 times by 2 tests: return BN_abs_is_word(a, 1) && !a->neg;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
BN_abs_is_word(a, 1)
BN_abs_is_word(a, 1)Description
TRUEevaluated 239441 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 3547530 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
&& !a->neg
!a->negDescription
TRUEevaluated 239441 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEnever evaluated
;
executed 3786971 times by 2 tests: return BN_abs_is_word(a, 1) && !a->neg;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-3786971
874}-
875-
876int BN_is_word(const BIGNUM *a, const unsigned long w)-
877{-
878 return
executed 30470 times by 1 test: return BN_abs_is_word(a, w) && (!w || !a->neg);
Executed by:
  • libcrypto.so.1.1
BN_abs_is_word(a, w)
BN_abs_is_word(a, w)Description
TRUEevaluated 5762 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 24708 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& (!w
!wDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5760 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| !a->neg
!a->negDescription
TRUEevaluated 5759 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
);
executed 30470 times by 1 test: return BN_abs_is_word(a, w) && (!w || !a->neg);
Executed by:
  • libcrypto.so.1.1
1-30470
879}-
880-
881int BN_is_odd(const BIGNUM *a)-
882{-
883 return
executed 5599741 times by 2 tests: return (a->top > 0) && (a->d[0] & 1);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
(
(a->top > 0)Description
TRUEevaluated 5599302 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 439 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
a->top > 0)
(a->top > 0)Description
TRUEevaluated 5599302 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 439 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& (
(a->d[0] & 1)Description
TRUEevaluated 3481920 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 2117382 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
a->d[0] & 1)
(a->d[0] & 1)Description
TRUEevaluated 3481920 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 2117382 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
;
executed 5599741 times by 2 tests: return (a->top > 0) && (a->d[0] & 1);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
439-5599741
884}-
885-
886int BN_is_negative(const BIGNUM *a)-
887{-
888 return
executed 44625 times by 2 tests: return (a->neg != 0);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
(a->neg != 0);
executed 44625 times by 2 tests: return (a->neg != 0);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
44625
889}-
890-
891int BN_to_montgomery(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont,-
892 BN_CTX *ctx)-
893{-
894 return
executed 180462 times by 2 tests: return BN_mod_mul_montgomery(r, a, &(mont->RR), mont, ctx);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
BN_mod_mul_montgomery(r, a, &(mont->RR), mont, ctx);
executed 180462 times by 2 tests: return BN_mod_mul_montgomery(r, a, &(mont->RR), mont, ctx);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
180462
895}-
896-
897void BN_with_flags(BIGNUM *dest, const BIGNUM *b, int flags)-
898{-
899 dest->d = b->d;-
900 dest->top = b->top;-
901 dest->dmax = b->dmax;-
902 dest->neg = b->neg;-
903 dest->flags = ((dest->flags & 0x01)-
904 | (b->flags & ~0x01)-
905 | 0x02 | flags);-
906}
executed 2427751 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
2427751
907-
908BN_GENCB *BN_GENCB_new(void)-
909{-
910 BN_GENCB *ret;-
911-
912 if ((
(ret = CRYPTO_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 23 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
ret = CRYPTO_malloc(sizeof(*ret), __FILE__, 912)) ==
(ret = CRYPTO_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 23 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-23
913 ((void *)0)
(ret = CRYPTO_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 23 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-23
914 ) {-
915 ERR_put_error(3,(143),((1|64)),__FILE__,913);-
916 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
917 ((void *)0)
never executed: return ((void *)0) ;
0
918 ;
never executed: return ((void *)0) ;
0
919 }-
920-
921 return
executed 23 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 23 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
23
922}-
923-
924void BN_GENCB_free(BN_GENCB *cb)-
925{-
926 if (cb ==
cb == ((void *)0)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 23 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
1-23
927 ((void *)0)
cb == ((void *)0)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 23 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
1-23
928 )-
929 return;
executed 1 time by 1 test: return;
Executed by:
  • libcrypto.so.1.1
1
930 CRYPTO_free(cb, __FILE__, 924);-
931}
executed 23 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
23
932-
933void BN_set_flags(BIGNUM *b, int n)-
934{-
935 b->flags |= n;-
936}
executed 71162 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
71162
937-
938int BN_get_flags(const BIGNUM *b, int n)-
939{-
940 return
executed 31803222 times by 2 tests: return b->flags & n;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
b->flags & n;
executed 31803222 times by 2 tests: return b->flags & n;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
31803222
941}-
942-
943-
944void BN_GENCB_set_old(BN_GENCB *gencb, void (*callback) (int, int, void *),-
945 void *cb_arg)-
946{-
947 BN_GENCB *tmp_gencb = gencb;-
948 tmp_gencb->ver = 1;-
949 tmp_gencb->arg = cb_arg;-
950 tmp_gencb->cb.cb_1 = callback;-
951}
never executed: end of block
0
952-
953-
954void BN_GENCB_set(BN_GENCB *gencb, int (*callback) (int, int, BN_GENCB *),-
955 void *cb_arg)-
956{-
957 BN_GENCB *tmp_gencb = gencb;-
958 tmp_gencb->ver = 2;-
959 tmp_gencb->arg = cb_arg;-
960 tmp_gencb->cb.cb_2 = callback;-
961}
executed 23 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
23
962-
963void *BN_GENCB_get_arg(BN_GENCB *cb)-
964{-
965 return
executed 5332 times by 1 test: return cb->arg;
Executed by:
  • libcrypto.so.1.1
cb->arg;
executed 5332 times by 1 test: return cb->arg;
Executed by:
  • libcrypto.so.1.1
5332
966}-
967-
968BIGNUM *bn_wexpand(BIGNUM *a, int words)-
969{-
970 return
executed 244086374 times by 2 tests: return (words <= a->dmax) ? a : bn_expand2(a, words);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
(
(words <= a->dmax)Description
TRUEevaluated 240600694 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 3485680 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
words <= a->dmax)
(words <= a->dmax)Description
TRUEevaluated 240600694 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 3485680 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
? a : bn_expand2(a, words);
executed 244086374 times by 2 tests: return (words <= a->dmax) ? a : bn_expand2(a, words);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
3485680-244086374
971}-
972-
973void bn_correct_top(BIGNUM *a)-
974{-
975 unsigned long *ftl;-
976 int tmp_top = a->top;-
977-
978 if (tmp_top > 0
tmp_top > 0Description
TRUEevaluated 195880464 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 218082 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
218082-195880464
979 for (ftl = &(a->d[tmp_top]); tmp_top > 0
tmp_top > 0Description
TRUEevaluated 634226577 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 459604 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
; tmp_top--) {
459604-634226577
980 ftl--;-
981 if (*
*ftl != 0Description
TRUEevaluated 195420860 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 438805717 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
ftl != 0
*ftl != 0Description
TRUEevaluated 195420860 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 438805717 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
195420860-438805717
982 break;
executed 195420860 times by 2 tests: break;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
195420860
983 }
executed 438805717 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
438805717
984 a->top = tmp_top;-
985 }
executed 195880464 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
195880464
986 if (a->top == 0
a->top == 0Description
TRUEevaluated 677686 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 195420860 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
677686-195420860
987 a->neg = 0;
executed 677686 times by 2 tests: a->neg = 0;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
677686
988 a->flags &= ~0;-
989 ;-
990}
executed 196098546 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
196098546
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2