OpenCoverage

bn_mul.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/bn/bn_mul.c
Switch to Source codePreprocessed file
LineSourceCount
1unsigned long bn_sub_part_words(unsigned long *r,-
2 const unsigned long *a, const unsigned long *b,-
3 int cl, int dl)-
4{-
5 unsigned long c, t;-
6-
7 -
8 ((void) (0))-
9 ;-
10 c = bn_sub_words(r, a, b, cl);-
11-
12 if (dl == 0
dl == 0Description
TRUEevaluated 565727 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 78753 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
78753-565727
13 return
executed 565727 times by 1 test: return c;
Executed by:
  • libcrypto.so.1.1
c;
executed 565727 times by 1 test: return c;
Executed by:
  • libcrypto.so.1.1
565727
14-
15 r += cl;-
16 a += cl;-
17 b += cl;-
18-
19 if (dl < 0
dl < 0Description
TRUEevaluated 9582 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 69171 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
9582-69171
20 for (;;) {-
21 t = b[0];-
22 r[0] = (0 - t - c) & (0xffffffffffffffffL);-
23 if (t != 0
t != 0Description
TRUEnever evaluated
FALSEevaluated 28644 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-28644
24 c = 1;
never executed: c = 1;
0
25 if (++
++dl >= 0Description
TRUEevaluated 1516 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 27128 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
dl >= 0
++dl >= 0Description
TRUEevaluated 1516 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 27128 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
1516-27128
26 break;
executed 1516 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
1516
27-
28 t = b[1];-
29 r[1] = (0 - t - c) & (0xffffffffffffffffL);-
30 if (t != 0
t != 0Description
TRUEnever evaluated
FALSEevaluated 27128 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-27128
31 c = 1;
never executed: c = 1;
0
32 if (++
++dl >= 0Description
TRUEevaluated 892 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 26236 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
dl >= 0
++dl >= 0Description
TRUEevaluated 892 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 26236 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
892-26236
33 break;
executed 892 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
892
34-
35 t = b[2];-
36 r[2] = (0 - t - c) & (0xffffffffffffffffL);-
37 if (t != 0
t != 0Description
TRUEnever evaluated
FALSEevaluated 26236 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-26236
38 c = 1;
never executed: c = 1;
0
39 if (++
++dl >= 0Description
TRUEevaluated 4109 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 22127 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
dl >= 0
++dl >= 0Description
TRUEevaluated 4109 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 22127 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
4109-22127
40 break;
executed 4109 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
4109
41-
42 t = b[3];-
43 r[3] = (0 - t - c) & (0xffffffffffffffffL);-
44 if (t != 0
t != 0Description
TRUEnever evaluated
FALSEevaluated 22127 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-22127
45 c = 1;
never executed: c = 1;
0
46 if (++
++dl >= 0Description
TRUEevaluated 3065 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 19062 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
dl >= 0
++dl >= 0Description
TRUEevaluated 3065 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 19062 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
3065-19062
47 break;
executed 3065 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
3065
48-
49 b += 4;-
50 r += 4;-
51 }
executed 19062 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
19062
52 }
executed 9582 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
9582
53 int save_dl = dl;-
54 while (c
cDescription
TRUEevaluated 26392 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 60860 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
26392-60860
55 t = a[0];-
56 r[0] = (t - c) & (0xffffffffffffffffL);-
57 if (t != 0
t != 0Description
TRUEevaluated 11118 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 15274 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
11118-15274
58 c = 0;
executed 11118 times by 1 test: c = 0;
Executed by:
  • libcrypto.so.1.1
11118
59 if (--
--dl <= 0Description
TRUEevaluated 2849 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 23543 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
dl <= 0
--dl <= 0Description
TRUEevaluated 2849 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 23543 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
2849-23543
60 break;
executed 2849 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
2849
61-
62 t = a[1];-
63 r[1] = (t - c) & (0xffffffffffffffffL);-
64 if (t != 0
t != 0Description
TRUEevaluated 8763 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 14780 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
8763-14780
65 c = 0;
executed 8763 times by 1 test: c = 0;
Executed by:
  • libcrypto.so.1.1
8763
66 if (--
--dl <= 0Description
TRUEevaluated 2455 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 21088 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
dl <= 0
--dl <= 0Description
TRUEevaluated 2455 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 21088 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
2455-21088
67 break;
executed 2455 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
2455
68-
69 t = a[2];-
70 r[2] = (t - c) & (0xffffffffffffffffL);-
71 if (t != 0
t != 0Description
TRUEevaluated 7522 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 13566 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
7522-13566
72 c = 0;
executed 7522 times by 1 test: c = 0;
Executed by:
  • libcrypto.so.1.1
7522
73 if (--
--dl <= 0Description
TRUEevaluated 1242 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 19846 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
dl <= 0
--dl <= 0Description
TRUEevaluated 1242 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 19846 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
1242-19846
74 break;
executed 1242 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
1242
75-
76 t = a[3];-
77 r[3] = (t - c) & (0xffffffffffffffffL);-
78 if (t != 0
t != 0Description
TRUEevaluated 6476 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 13370 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
6476-13370
79 c = 0;
executed 6476 times by 1 test: c = 0;
Executed by:
  • libcrypto.so.1.1
6476
80 if (--
--dl <= 0Description
TRUEevaluated 1765 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 18081 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
dl <= 0
--dl <= 0Description
TRUEevaluated 1765 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 18081 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
1765-18081
81 break;
executed 1765 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
1765
82-
83 save_dl = dl;-
84 a += 4;-
85 r += 4;-
86 }
executed 18081 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
18081
87 if (dl > 0
dl > 0Description
TRUEevaluated 60860 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 8311 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
8311-60860
88 if (save_dl > dl
save_dl > dlDescription
TRUEnever evaluated
FALSEevaluated 60860 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-60860
89 switch (save_dl - dl) {-
90 case
never executed: case 1:
1:
never executed: case 1:
0
91 r[1] = a[1];-
92 if (--
--dl <= 0Description
TRUEnever evaluated
FALSEnever evaluated
dl <= 0
--dl <= 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
93 break;
never executed: break;
0
94-
95 case
never executed: case 2:
2:
never executed: case 2:
code before this statement never executed: case 2:
0
96 r[2] = a[2];-
97 if (--
--dl <= 0Description
TRUEnever evaluated
FALSEnever evaluated
dl <= 0
--dl <= 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
98 break;
never executed: break;
0
99-
100 case
never executed: case 3:
3:
never executed: case 3:
code before this statement never executed: case 3:
0
101 r[3] = a[3];-
102 if (--
--dl <= 0Description
TRUEnever evaluated
FALSEnever evaluated
dl <= 0
--dl <= 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
103 break;
never executed: break;
0
104 }
never executed: end of block
0
105 a += 4;-
106 r += 4;-
107 }
never executed: end of block
0
108 }
executed 60860 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
60860
109 if (dl > 0
dl > 0Description
TRUEevaluated 60860 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 8311 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
8311-60860
110 for (;;) {-
111 r[0] = a[0];-
112 if (--
--dl <= 0Description
TRUEevaluated 17509 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 250859 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
dl <= 0
--dl <= 0Description
TRUEevaluated 17509 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 250859 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
17509-250859
113 break;
executed 17509 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
17509
114 r[1] = a[1];-
115 if (--
--dl <= 0Description
TRUEevaluated 9171 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 241688 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
dl <= 0
--dl <= 0Description
TRUEevaluated 9171 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 241688 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
9171-241688
116 break;
executed 9171 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
9171
117 r[2] = a[2];-
118 if (--
--dl <= 0Description
TRUEevaluated 18155 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 223533 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
dl <= 0
--dl <= 0Description
TRUEevaluated 18155 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 223533 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
18155-223533
119 break;
executed 18155 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
18155
120 r[3] = a[3];-
121 if (--
--dl <= 0Description
TRUEevaluated 16025 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 207508 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
dl <= 0
--dl <= 0Description
TRUEevaluated 16025 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 207508 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
16025-207508
122 break;
executed 16025 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
16025
123-
124 a += 4;-
125 r += 4;-
126 }
executed 207508 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
207508
127 }
executed 60860 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
60860
128 }
executed 69171 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
69171
129 return
executed 78753 times by 1 test: return c;
Executed by:
  • libcrypto.so.1.1
c;
executed 78753 times by 1 test: return c;
Executed by:
  • libcrypto.so.1.1
78753
130}-
131void bn_mul_recursive(unsigned long *r, unsigned long *a, unsigned long *b, int n2,-
132 int dna, int dnb, unsigned long *t)-
133{-
134 int n = n2 / 2, c1, c2;-
135 int tna = n + dna, tnb = n + dnb;-
136 unsigned int neg, zero;-
137 unsigned long ln, lo, *p;-
138 if (n2 == 8
n2 == 8Description
TRUEevaluated 20495 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 323584 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& dna == 0
dna == 0Description
TRUEevaluated 17135 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3360 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& dnb == 0
dnb == 0Description
TRUEevaluated 13554 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3581 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
3360-323584
139 bn_mul_comba8(r, a, b);-
140 return;
executed 13554 times by 1 test: return;
Executed by:
  • libcrypto.so.1.1
13554
141 }-
142-
143-
144 if (n2 < (16)
n2 < (16)Description
TRUEevaluated 6941 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 323584 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
6941-323584
145 bn_mul_normal(r, a, n2 + dna, b, n2 + dnb);-
146 if ((
(dna + dnb) < 0Description
TRUEevaluated 6941 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
dna + dnb) < 0
(dna + dnb) < 0Description
TRUEevaluated 6941 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
)
0-6941
147 memset(&r[2 * n2 + dna + dnb], 0,
executed 6941 times by 1 test: memset(&r[2 * n2 + dna + dnb], 0, sizeof(unsigned long) * -(dna + dnb));
Executed by:
  • libcrypto.so.1.1
6941
148 sizeof(unsigned long) * -(dna + dnb));
executed 6941 times by 1 test: memset(&r[2 * n2 + dna + dnb], 0, sizeof(unsigned long) * -(dna + dnb));
Executed by:
  • libcrypto.so.1.1
6941
149 return;
executed 6941 times by 1 test: return;
Executed by:
  • libcrypto.so.1.1
6941
150 }-
151-
152 c1 = bn_cmp_part_words(a, &(a[n]), tna, n - tna);-
153 c2 = bn_cmp_part_words(&(b[n]), b, tnb, tnb - n);-
154 zero = neg = 0;-
155 switch (c1 * 3 + c2) {-
156 case
executed 58472 times by 1 test: case -4:
Executed by:
  • libcrypto.so.1.1
-4:
executed 58472 times by 1 test: case -4:
Executed by:
  • libcrypto.so.1.1
58472
157 bn_sub_part_words(t, &(a[n]), a, tna, tna - n);-
158 bn_sub_part_words(&(t[n]), b, &(b[n]), tnb, n - tnb);-
159 break;
executed 58472 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
58472
160 case
executed 5972 times by 1 test: case -3:
Executed by:
  • libcrypto.so.1.1
-3:
executed 5972 times by 1 test: case -3:
Executed by:
  • libcrypto.so.1.1
5972
161 zero = 1;-
162 break;
executed 5972 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
5972
163 case
executed 57836 times by 1 test: case -2:
Executed by:
  • libcrypto.so.1.1
-2:
executed 57836 times by 1 test: case -2:
Executed by:
  • libcrypto.so.1.1
57836
164 bn_sub_part_words(t, &(a[n]), a, tna, tna - n);-
165 bn_sub_part_words(&(t[n]), &(b[n]), b, tnb, tnb - n);-
166 neg = 1;-
167 break;
executed 57836 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
57836
168 case
executed 8391 times by 1 test: case -1:
Executed by:
  • libcrypto.so.1.1
-1:
executed 8391 times by 1 test: case -1:
Executed by:
  • libcrypto.so.1.1
8391
169 case
executed 6341 times by 1 test: case 0:
Executed by:
  • libcrypto.so.1.1
0:
executed 6341 times by 1 test: case 0:
Executed by:
  • libcrypto.so.1.1
6341
170 case
executed 9235 times by 1 test: case 1:
Executed by:
  • libcrypto.so.1.1
1:
executed 9235 times by 1 test: case 1:
Executed by:
  • libcrypto.so.1.1
9235
171 zero = 1;-
172 break;
executed 23967 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
23967
173 case
executed 94853 times by 1 test: case 2:
Executed by:
  • libcrypto.so.1.1
2:
executed 94853 times by 1 test: case 2:
Executed by:
  • libcrypto.so.1.1
94853
174 bn_sub_part_words(t, a, &(a[n]), tna, n - tna);-
175 bn_sub_part_words(&(t[n]), b, &(b[n]), tnb, n - tnb);-
176 neg = 1;-
177 break;
executed 94853 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
94853
178 case
executed 6759 times by 1 test: case 3:
Executed by:
  • libcrypto.so.1.1
3:
executed 6759 times by 1 test: case 3:
Executed by:
  • libcrypto.so.1.1
6759
179 zero = 1;-
180 break;
executed 6759 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
6759
181 case
executed 75725 times by 1 test: case 4:
Executed by:
  • libcrypto.so.1.1
4:
executed 75725 times by 1 test: case 4:
Executed by:
  • libcrypto.so.1.1
75725
182 bn_sub_part_words(t, a, &(a[n]), tna, n - tna);-
183 bn_sub_part_words(&(t[n]), &(b[n]), b, tnb, tnb - n);-
184 break;
executed 75725 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
75725
185 }-
186-
187-
188 if (n == 4
n == 4Description
TRUEnever evaluated
FALSEevaluated 323584 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& dna == 0
dna == 0Description
TRUEnever evaluated
FALSEnever evaluated
&& dnb == 0
dnb == 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0-323584
189-
190 if (!zero
!zeroDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
191 bn_mul_comba4(&(t[n2]), t, &(t[n]));
never executed: bn_mul_comba4(&(t[n2]), t, &(t[n]));
0
192 else-
193 memset(&t[n2], 0, sizeof(*t) * 8);
never executed: memset(&t[n2], 0, sizeof(*t) * 8);
0
194-
195 bn_mul_comba4(r, a, b);-
196 bn_mul_comba4(&(r[n2]), &(a[n]), &(b[n]));-
197 }
never executed: end of block
else if (n == 8
n == 8Description
TRUEevaluated 239618 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 83966 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& dna == 0
dna == 0Description
TRUEevaluated 236508 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3110 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& dnb == 0
dnb == 0Description
TRUEevaluated 233028 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3480 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-239618
198-
199-
200 if (!zero
!zeroDescription
TRUEevaluated 204044 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 28984 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
28984-204044
201 bn_mul_comba8(&(t[n2]), t, &(t[n]));
executed 204044 times by 1 test: bn_mul_comba8(&(t[n2]), t, &(t[n]));
Executed by:
  • libcrypto.so.1.1
204044
202 else-
203 memset(&t[n2], 0, sizeof(*t) * 16);
executed 28984 times by 1 test: memset(&t[n2], 0, sizeof(*t) * 16);
Executed by:
  • libcrypto.so.1.1
28984
204-
205 bn_mul_comba8(r, a, b);-
206 bn_mul_comba8(&(r[n2]), &(a[n]), &(b[n]));-
207 }
executed 233028 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else
233028
208-
209 {-
210 p = &(t[n2 * 2]);-
211 if (!zero
!zeroDescription
TRUEevaluated 82842 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 7714 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
7714-82842
212 bn_mul_recursive(&(t[n2]), t, &(t[n]), n, 0, 0, p);
executed 82842 times by 1 test: bn_mul_recursive(&(t[n2]), t, &(t[n]), n, 0, 0, p);
Executed by:
  • libcrypto.so.1.1
82842
213 else-
214 memset(&t[n2], 0, sizeof(*t) * n2);
executed 7714 times by 1 test: memset(&t[n2], 0, sizeof(*t) * n2);
Executed by:
  • libcrypto.so.1.1
7714
215 bn_mul_recursive(r, a, b, n, 0, 0, p);-
216 bn_mul_recursive(&(r[n2]), &(a[n]), &(b[n]), n, dna, dnb, p);-
217 }
executed 90556 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
90556
218-
219-
220-
221-
222-
223-
224-
225 c1 = (int)(bn_add_words(t, r, &(r[n2]), n2));-
226-
227 if (neg
negDescription
TRUEevaluated 152689 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 170895 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
152689-170895
228 c1 -= (int)(bn_sub_words(&(t[n2]), t, &(t[n2]), n2));-
229 }
executed 152689 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
152689
230-
231 c1 += (int)(bn_add_words(&(t[n2]), &(t[n2]), t, n2));-
232 }
executed 170895 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
170895
233-
234-
235-
236-
237-
238-
239-
240 c1 += (int)(bn_add_words(&(r[n]), &(r[n]), &(t[n2]), n2));-
241 if (c1
c1Description
TRUEevaluated 104120 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 219464 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
104120-219464
242 p = &(r[n + n2]);-
243 lo = *p;-
244 ln = (lo + c1) & (0xffffffffffffffffL);-
245 *p = ln;-
246-
247-
248-
249-
250-
251 if (ln < (unsigned long)c1
ln < (unsigned long)c1Description
TRUEevaluated 980 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 103140 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
980-103140
252 do {-
253 p++;-
254 lo = *p;-
255 ln = (lo + 1) & (0xffffffffffffffffL);-
256 *p = ln;-
257 }
executed 4588 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
while (ln == 0
ln == 0Description
TRUEevaluated 3608 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 980 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
);
980-4588
258 }
executed 980 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
980
259 }
executed 104120 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
104120
260}
executed 323584 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
323584
261-
262-
263-
264-
265-
266void bn_mul_part_recursive(unsigned long *r, unsigned long *a, unsigned long *b, int n,-
267 int tna, int tnb, unsigned long *t)-
268{-
269 int i, j, n2 = n * 2;-
270 int c1, c2, neg;-
271 unsigned long ln, lo, *p;-
272-
273 if (n < 8
n < 8Description
TRUEnever evaluated
FALSEevaluated 35354 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-35354
274 bn_mul_normal(r, a, n + tna, b, n + tnb);-
275 return;
never executed: return;
0
276 }-
277-
278-
279 c1 = bn_cmp_part_words(a, &(a[n]), tna, n - tna);-
280 c2 = bn_cmp_part_words(&(b[n]), b, tnb, tnb - n);-
281 neg = 0;-
282 switch (c1 * 3 + c2) {-
283 case
executed 5260 times by 1 test: case -4:
Executed by:
  • libcrypto.so.1.1
-4:
executed 5260 times by 1 test: case -4:
Executed by:
  • libcrypto.so.1.1
5260
284 bn_sub_part_words(t, &(a[n]), a, tna, tna - n);-
285 bn_sub_part_words(&(t[n]), b, &(b[n]), tnb, n - tnb);-
286 break;
executed 5260 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
5260
287 case
executed 304 times by 1 test: case -3:
Executed by:
  • libcrypto.so.1.1
-3:
executed 304 times by 1 test: case -3:
Executed by:
  • libcrypto.so.1.1
304
288 case
executed 1039 times by 1 test: case -2:
Executed by:
  • libcrypto.so.1.1
-2:
executed 1039 times by 1 test: case -2:
Executed by:
  • libcrypto.so.1.1
1039
289 bn_sub_part_words(t, &(a[n]), a, tna, tna - n);-
290 bn_sub_part_words(&(t[n]), &(b[n]), b, tnb, tnb - n);-
291 neg = 1;-
292 break;
executed 1343 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
1343
293 case
executed 676 times by 1 test: case -1:
Executed by:
  • libcrypto.so.1.1
-1:
executed 676 times by 1 test: case -1:
Executed by:
  • libcrypto.so.1.1
676
294 case
executed 354 times by 1 test: case 0:
Executed by:
  • libcrypto.so.1.1
0:
executed 354 times by 1 test: case 0:
Executed by:
  • libcrypto.so.1.1
354
295 case
executed 234 times by 1 test: case 1:
Executed by:
  • libcrypto.so.1.1
1:
executed 234 times by 1 test: case 1:
Executed by:
  • libcrypto.so.1.1
234
296 case
executed 26345 times by 1 test: case 2:
Executed by:
  • libcrypto.so.1.1
2:
executed 26345 times by 1 test: case 2:
Executed by:
  • libcrypto.so.1.1
26345
297 bn_sub_part_words(t, a, &(a[n]), tna, n - tna);-
298 bn_sub_part_words(&(t[n]), b, &(b[n]), tnb, n - tnb);-
299 neg = 1;-
300 break;
executed 27609 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
27609
301 case
executed 407 times by 1 test: case 3:
Executed by:
  • libcrypto.so.1.1
3:
executed 407 times by 1 test: case 3:
Executed by:
  • libcrypto.so.1.1
407
302 case
executed 735 times by 1 test: case 4:
Executed by:
  • libcrypto.so.1.1
4:
executed 735 times by 1 test: case 4:
Executed by:
  • libcrypto.so.1.1
735
303 bn_sub_part_words(t, a, &(a[n]), tna, n - tna);-
304 bn_sub_part_words(&(t[n]), &(b[n]), b, tnb, tnb - n);-
305 break;
executed 1142 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
1142
306 }-
307 if (n == 8
n == 8Description
TRUEevaluated 6517 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 28837 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
6517-28837
308 bn_mul_comba8(&(t[n2]), t, &(t[n]));-
309 bn_mul_comba8(r, a, b);-
310 bn_mul_normal(&(r[n2]), &(a[n]), tna, &(b[n]), tnb);-
311 memset(&r[n2 + tna + tnb], 0, sizeof(*r) * (n2 - tna - tnb));-
312 }
executed 6517 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
6517
313 p = &(t[n2 * 2]);-
314 bn_mul_recursive(&(t[n2]), t, &(t[n]), n, 0, 0, p);-
315 bn_mul_recursive(r, a, b, n, 0, 0, p);-
316 i = n / 2;-
317-
318-
319-
320 if (tna > tnb
tna > tnbDescription
TRUEevaluated 5237 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 23600 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
5237-23600
321 j = tna - i;
executed 5237 times by 1 test: j = tna - i;
Executed by:
  • libcrypto.so.1.1
5237
322 else-
323 j = tnb - i;
executed 23600 times by 1 test: j = tnb - i;
Executed by:
  • libcrypto.so.1.1
23600
324 if (j == 0
j == 0Description
TRUEevaluated 5516 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 23321 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
5516-23321
325 bn_mul_recursive(&(r[n2]), &(a[n]), &(b[n]),-
326 i, tna - i, tnb - i, p);-
327 memset(&r[n2 + i * 2], 0, sizeof(*r) * (n2 - i * 2));-
328 }
executed 5516 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else if (j > 0
j > 0Description
TRUEevaluated 7072 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 16249 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
5516-16249
329 bn_mul_part_recursive(&(r[n2]), &(a[n]), &(b[n]),-
330 i, tna - i, tnb - i, p);-
331 memset(&(r[n2 + tna + tnb]), 0,-
332 sizeof(unsigned long) * (n2 - tna - tnb));-
333 }
executed 7072 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
7072
334-
335 memset(&r[n2], 0, sizeof(*r) * n2);-
336 if (tna < (16)
tna < (16)Description
TRUEevaluated 14729 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1520 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
1520-14729
337 && tnb < (16)
tnb < (16)Description
TRUEevaluated 14413 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 316 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
316-14413
338 bn_mul_normal(&(r[n2]), &(a[n]), tna, &(b[n]), tnb);-
339 }
executed 14413 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
14413
340 for (;;) {-
341 i /= 2;-
342-
343-
344-
345-
346 if (i < tna
i < tnaDescription
TRUEevaluated 700 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1873 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| i < tnb
i < tnbDescription
TRUEevaluated 282 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1591 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
282-1873
347 bn_mul_part_recursive(&(r[n2]),-
348 &(a[n]), &(b[n]),-
349 i, tna - i, tnb - i, p);-
350 break;
executed 982 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
982
351 } else if (i == tna
i == tnaDescription
TRUEevaluated 538 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1053 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| i == tnb
i == tnbDescription
TRUEevaluated 316 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 737 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
316-1053
352 bn_mul_recursive(&(r[n2]),-
353 &(a[n]), &(b[n]),-
354 i, tna - i, tnb - i, p);-
355 break;
executed 854 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
854
356 }-
357 }
executed 737 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
737
358 }
executed 1836 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
1836
359 }-
360 }-
361-
362-
363-
364-
365-
366-
367-
368 c1 = (int)(bn_add_words(t, r, &(r[n2]), n2));-
369-
370 if (neg
negDescription
TRUEevaluated 28952 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 6402 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
6402-28952
371 c1 -= (int)(bn_sub_words(&(t[n2]), t, &(t[n2]), n2));-
372 }
executed 28952 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
28952
373-
374 c1 += (int)(bn_add_words(&(t[n2]), &(t[n2]), t, n2));-
375 }
executed 6402 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
6402
376-
377-
378-
379-
380-
381-
382-
383 c1 += (int)(bn_add_words(&(r[n]), &(r[n]), &(t[n2]), n2));-
384 if (c1
c1Description
TRUEevaluated 651 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 34703 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
651-34703
385 p = &(r[n + n2]);-
386 lo = *p;-
387 ln = (lo + c1) & (0xffffffffffffffffL);-
388 *p = ln;-
389-
390-
391-
392-
393-
394 if (ln < (unsigned long)c1
ln < (unsigned long)c1Description
TRUEevaluated 359 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 292 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
292-359
395 do {-
396 p++;-
397 lo = *p;-
398 ln = (lo + 1) & (0xffffffffffffffffL);-
399 *p = ln;-
400 }
executed 1491 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
while (ln == 0
ln == 0Description
TRUEevaluated 1132 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 359 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
);
359-1491
401 }
executed 359 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
359
402 }
executed 651 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
651
403}
executed 35354 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
35354
404-
405-
406-
407-
408-
409void bn_mul_low_recursive(unsigned long *r, unsigned long *a, unsigned long *b, int n2,-
410 unsigned long *t)-
411{-
412 int n = n2 / 2;-
413-
414 bn_mul_recursive(r, a, b, n, 0, 0, &(t[0]));-
415 if (n >= (32)
n >= (32)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
416 bn_mul_low_recursive(&(t[0]), &(a[0]), &(b[n]), n, &(t[n2]));-
417 bn_add_words(&(r[n]), &(r[n]), &(t[0]), n);-
418 bn_mul_low_recursive(&(t[0]), &(a[n]), &(b[0]), n, &(t[n2]));-
419 bn_add_words(&(r[n]), &(r[n]), &(t[0]), n);-
420 }
never executed: end of block
else {
0
421 bn_mul_low_normal(&(t[0]), &(a[0]), &(b[n]), n);-
422 bn_mul_low_normal(&(t[n]), &(a[n]), &(b[0]), n);-
423 bn_add_words(&(r[n]), &(r[n]), &(t[0]), n);-
424 bn_add_words(&(r[n]), &(r[n]), &(t[n]), n);-
425 }
never executed: end of block
0
426}-
427-
428-
429int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)-
430{-
431 int ret = bn_mul_fixed_top(r, a, b, ctx);-
432-
433 bn_correct_top(r);-
434 ;-
435-
436 return
executed 2968993 times by 2 tests: return ret;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
ret;
executed 2968993 times by 2 tests: return ret;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
2968993
437}-
438-
439int bn_mul_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)-
440{-
441 int ret = 0;-
442 int top, al, bl;-
443 BIGNUM *rr;-
444-
445 int i;-
446-
447-
448 BIGNUM *t = -
449 ((void *)0)-
450 ;-
451 int j = 0, k;-
452-
453-
454 ;-
455 ;-
456 ;-
457-
458 al = a->top;-
459 bl = b->top;-
460-
461 if ((
(al == 0)Description
TRUEevaluated 45622 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3214734 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
al == 0)
(al == 0)Description
TRUEevaluated 45622 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3214734 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
|| (
(bl == 0)Description
TRUEevaluated 57395 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3157339 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
bl == 0)
(bl == 0)Description
TRUEevaluated 57395 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3157339 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
45622-3214734
462 (BN_set_word((r),0));-
463 return
executed 103017 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 103017 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
103017
464 }-
465 top = al + bl;-
466-
467 BN_CTX_start(ctx);-
468 if ((
(r == a)Description
TRUEevaluated 482 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3156857 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
r == a)
(r == a)Description
TRUEevaluated 482 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3156857 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
|| (
(r == b)Description
TRUEevaluated 196 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3156661 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
r == b)
(r == b)Description
TRUEevaluated 196 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3156661 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
196-3156857
469 if ((
(rr = BN_CTX_g...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 678 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
rr = BN_CTX_get(ctx)) ==
(rr = BN_CTX_g...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 678 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-678
470 ((void *)0)
(rr = BN_CTX_g...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 678 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-678
471 )-
472 goto
never executed: goto err;
err;
never executed: goto err;
0
473 }
executed 678 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else
678
474 rr = r;
executed 3156661 times by 2 tests: rr = r;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
3156661
475-
476-
477 i = al - bl;-
478-
479-
480 if (i == 0
i == 0Description
TRUEevaluated 842610 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 2314729 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
842610-2314729
481 if (al == 8
al == 8Description
TRUEevaluated 161685 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 680925 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
161685-680925
482 if (bn_wexpand(rr, 16) ==
bn_wexpand(rr,...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 161685 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-161685
483 ((void *)0)
bn_wexpand(rr,...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 161685 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-161685
484 )-
485 goto
never executed: goto err;
err;
never executed: goto err;
0
486 rr->top = 16;-
487 bn_mul_comba8(rr->d, a->d, b->d);-
488 goto
executed 161685 times by 1 test: goto end;
Executed by:
  • libcrypto.so.1.1
end;
executed 161685 times by 1 test: goto end;
Executed by:
  • libcrypto.so.1.1
161685
489 }-
490 }
executed 680925 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
680925
491-
492-
493 if ((
(al >= (16))Description
TRUEevaluated 55086 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2940568 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
al >= (16))
(al >= (16))Description
TRUEevaluated 55086 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2940568 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
&& (
(bl >= (16))Description
TRUEevaluated 47811 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 7275 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
bl >= (16))
(bl >= (16))Description
TRUEevaluated 47811 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 7275 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
7275-2940568
494 if (i >= -1
i >= -1Description
TRUEevaluated 47126 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 685 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& i <= 1
i <= 1Description
TRUEevaluated 43381 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3745 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
685-47126
495-
496-
497-
498-
499 if (i >= 0
i >= 0Description
TRUEevaluated 34581 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 8800 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
8800-34581
500 j = BN_num_bits_word((unsigned long)al);-
501 }
executed 34581 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
34581
502 if (i == -1
i == -1Description
TRUEevaluated 8800 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 34581 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
8800-34581
503 j = BN_num_bits_word((unsigned long)bl);-
504 }
executed 8800 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
8800
505 j = 1 << (j - 1);-
506 -
507 ((void) (0))-
508 ;-
509 k = j + j;-
510 t = BN_CTX_get(ctx);-
511 if (t ==
t == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 43381 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-43381
512 ((void *)0)
t == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 43381 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-43381
513 )-
514 goto
never executed: goto err;
err;
never executed: goto err;
0
515 if (al > j
al > jDescription
TRUEevaluated 24246 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 19135 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| bl > j
bl > jDescription
TRUEevaluated 3054 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 16081 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
3054-24246
516 if (bn_wexpand(t, k * 4) ==
bn_wexpand(t, ...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 27300 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-27300
517 ((void *)0)
bn_wexpand(t, ...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 27300 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-27300
518 )-
519 goto
never executed: goto err;
err;
never executed: goto err;
0
520 if (bn_wexpand(rr, k * 4) ==
bn_wexpand(rr,...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 27300 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-27300
521 ((void *)0)
bn_wexpand(rr,...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 27300 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-27300
522 )-
523 goto
never executed: goto err;
err;
never executed: goto err;
0
524 bn_mul_part_recursive(rr->d, a->d, b->d,-
525 j, al - j, bl - j, t->d);-
526 }
executed 27300 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
27300
527-
528 if (bn_wexpand(t, k * 2) ==
bn_wexpand(t, ...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 16081 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-16081
529 ((void *)0)
bn_wexpand(t, ...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 16081 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-16081
530 )-
531 goto
never executed: goto err;
err;
never executed: goto err;
0
532 if (bn_wexpand(rr, k * 2) ==
bn_wexpand(rr,...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 16081 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-16081
533 ((void *)0)
bn_wexpand(rr,...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 16081 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-16081
534 )-
535 goto
never executed: goto err;
err;
never executed: goto err;
0
536 bn_mul_recursive(rr->d, a->d, b->d, j, al - j, bl - j, t->d);-
537 }
executed 16081 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
16081
538 rr->top = top;-
539 goto
executed 43381 times by 1 test: goto end;
Executed by:
  • libcrypto.so.1.1
end;
executed 43381 times by 1 test: goto end;
Executed by:
  • libcrypto.so.1.1
43381
540 }-
541 }
executed 4430 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
4430
542-
543 if (bn_wexpand(rr, top) ==
bn_wexpand(rr,...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2952273 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-2952273
544 ((void *)0)
bn_wexpand(rr,...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2952273 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-2952273
545 )-
546 goto
never executed: goto err;
err;
never executed: goto err;
0
547 rr->top = top;-
548 bn_mul_normal(rr->d, a->d, al, b->d, bl);-
549-
550-
551 end:
code before this statement executed 2952273 times by 2 tests: end:
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
2952273
552-
553 rr->neg = a->neg ^ b->neg;-
554 rr->flags |= 0;-
555 if (r != rr
r != rrDescription
TRUEevaluated 678 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3156661 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
&& BN_copy(r, rr) ==
BN_copy(r, rr) == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 678 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-3156661
556 ((void *)0)
BN_copy(r, rr) == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 678 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-678
557 )-
558 goto
never executed: goto err;
err;
never executed: goto err;
0
559-
560 ret = 1;-
561 err:
code before this statement executed 3157339 times by 2 tests: err:
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
3157339
562 ;-
563 BN_CTX_end(ctx);-
564 return
executed 3157339 times by 2 tests: return ret;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
ret;
executed 3157339 times by 2 tests: return ret;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
3157339
565}-
566-
567void bn_mul_normal(unsigned long *r, unsigned long *a, int na, unsigned long *b, int nb)-
568{-
569 unsigned long *rr;-
570-
571 if (na < nb
na < nbDescription
TRUEevaluated 2235019 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 745125 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
745125-2235019
572 int itmp;-
573 unsigned long *ltmp;-
574-
575 itmp = na;-
576 na = nb;-
577 nb = itmp;-
578 ltmp = a;-
579 a = b;-
580 b = ltmp;-
581-
582 }
executed 2235019 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
2235019
583 rr = &(r[na]);-
584 if (nb <= 0
nb <= 0Description
TRUEevaluated 5119 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2975025 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
5119-2975025
585 (void)bn_mul_words(r, a, na, 0);-
586 return;
executed 5119 times by 1 test: return;
Executed by:
  • libcrypto.so.1.1
5119
587 } else-
588 rr[0] = bn_mul_words(r, a, na, b[0]);
executed 2975025 times by 2 tests: rr[0] = bn_mul_words(r, a, na, b[0]);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
2975025
589-
590 for (;;) {-
591 if (--
--nb <= 0Description
TRUEevaluated 2657449 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 542715 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
nb <= 0
--nb <= 0Description
TRUEevaluated 2657449 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 542715 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
542715-2657449
592 return;
executed 2657449 times by 2 tests: return;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
2657449
593 rr[1] = bn_mul_add_words(&(r[1]), a, na, b[1]);-
594 if (--
--nb <= 0Description
TRUEevaluated 53479 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 489236 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
nb <= 0
--nb <= 0Description
TRUEevaluated 53479 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 489236 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
53479-489236
595 return;
executed 53479 times by 1 test: return;
Executed by:
  • libcrypto.so.1.1
53479
596 rr[2] = bn_mul_add_words(&(r[2]), a, na, b[2]);-
597 if (--
--nb <= 0Description
TRUEevaluated 26815 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 462421 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
nb <= 0
--nb <= 0Description
TRUEevaluated 26815 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 462421 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
26815-462421
598 return;
executed 26815 times by 1 test: return;
Executed by:
  • libcrypto.so.1.1
26815
599 rr[3] = bn_mul_add_words(&(r[3]), a, na, b[3]);-
600 if (--
--nb <= 0Description
TRUEevaluated 237282 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 225139 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
nb <= 0
--nb <= 0Description
TRUEevaluated 237282 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 225139 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
225139-237282
601 return;
executed 237282 times by 2 tests: return;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
237282
602 rr[4] = bn_mul_add_words(&(r[4]), a, na, b[4]);-
603 rr += 4;-
604 r += 4;-
605 b += 4;-
606 }
executed 225139 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
225139
607}
never executed: end of block
0
608-
609void bn_mul_low_normal(unsigned long *r, unsigned long *a, unsigned long *b, int n)-
610{-
611 bn_mul_words(r, a, n, b[0]);-
612-
613 for (;;) {-
614 if (--
--n <= 0Description
TRUEnever evaluated
FALSEnever evaluated
n <= 0
--n <= 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
615 return;
never executed: return;
0
616 bn_mul_add_words(&(r[1]), a, n, b[1]);-
617 if (--
--n <= 0Description
TRUEnever evaluated
FALSEnever evaluated
n <= 0
--n <= 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
618 return;
never executed: return;
0
619 bn_mul_add_words(&(r[2]), a, n, b[2]);-
620 if (--
--n <= 0Description
TRUEnever evaluated
FALSEnever evaluated
n <= 0
--n <= 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
621 return;
never executed: return;
0
622 bn_mul_add_words(&(r[3]), a, n, b[3]);-
623 if (--
--n <= 0Description
TRUEnever evaluated
FALSEnever evaluated
n <= 0
--n <= 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
624 return;
never executed: return;
0
625 bn_mul_add_words(&(r[4]), a, n, b[4]);-
626 r += 4;-
627 b += 4;-
628 }
never executed: end of block
0
629}
never executed: end of block
0
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2