Branch Coverage

src/pdfmake_bn.c
Criterion Covered Total %
branch 0 120 0.0


line true false branch
28 0 0 while (a->n > 0 && a->w[a->n - 1] == 0) a->n--;
0 0 while (a->n > 0 && a->w[a->n - 1] == 0) a->n--;
34 0 0 if (a->n > b->n) return 1;
35 0 0 if (a->n < b->n) return -1;
36 0 0 for (i = a->n; i > 0; i--) {
39 0 0 if (av > bv) return 1;
40 0 0 if (av < bv) return -1;
50 0 0 for (i = 0; i < n; i++) {
51 0 0 uint64_t av = (i < a->n) ? a->w[i] : 0;
52 0 0 uint64_t bv = (i < b->n) ? b->w[i] : 0;
65 0 0 for (i = 0; i < a->n; i++) {
70 0 0 if (carry && a->n < PDFMAKE_BN_MAX_WORDS) {
0 0 if (carry && a->n < PDFMAKE_BN_MAX_WORDS) {
81 0 0 if (a->n + b->n > PDFMAKE_BN_MAX_WORDS) return -1;
83 0 0 for (i = 0; i < a->n; i++) {
88 0 0 for (j = 0; j < b->n; j++) {
97 0 0 while (carry) {
99 0 0 if (k >= PDFMAKE_BN_MAX_WORDS) return -1;
125 0 0 if (bn_cmp(a, m) < 0) return;
128 0 0 if (a->n == 0) return;
132 0 0 while ((top & ((uint32_t)1 << top_bit)) == 0) top_bit--;
136 0 0 if (m->n == 0) return;
140 0 0 while ((m_top & ((uint32_t)1 << m_top_bit)) == 0) m_top_bit--;
143 0 0 if (a_bits < m_bits) return; /* already < m */
149 0 0 for (i = 0; i < shift; i++) bn_shl1(&shifted);
151 0 0 for (i = 0; i <= shift; i++) {
154 0 0 if (bn_cmp(a, &shifted) >= 0) {
158 0 0 if (shifted.n == 0) break;
160 0 0 for (j = shifted.n; j > 0; j--) {
176 0 0 if (!a || (!bytes && len > 0)) return -1;
0 0 if (!a || (!bytes && len > 0)) return -1;
0 0 if (!a || (!bytes && len > 0)) return -1;
180 0 0 while (len > 0 && bytes[0] == 0) { bytes++; len--; }
0 0 while (len > 0 && bytes[0] == 0) { bytes++; len--; }
181 0 0 if (len == 0) return 0;
184 0 0 if (nw > PDFMAKE_BN_MAX_WORDS) return -1;
187 0 0 for (i = 0; i < len; i++) {
202 0 0 if (!a || !bytes) return -1;
0 0 if (!a || !bytes) return -1;
206 0 0 if (a->n == 0) return 0;
210 0 0 if ((top >> 24) == 0) need--;
211 0 0 if ((top >> 16) == 0 && need > 0) need--;
0 0 if ((top >> 16) == 0 && need > 0) need--;
212 0 0 if ((top >> 8) == 0 && need > 0) need--;
0 0 if ((top >> 8) == 0 && need > 0) need--;
213 0 0 if (need > out_len) return -1;
215 0 0 for (i = 0; i < a->n; i++) {
218 0 0 for (b = 0; b < 4; b++) {
220 0 0 if (byte_from_end >= out_len) continue;
233 0 0 if (!r || !base || !exp || !mod) return -1;
0 0 if (!r || !base || !exp || !mod) return -1;
0 0 if (!r || !base || !exp || !mod) return -1;
0 0 if (!r || !base || !exp || !mod) return -1;
234 0 0 if (mod->n == 0) return -1;
246 0 0 if (exp->n > 0) {
252 0 0 while ((top & ((uint32_t)1 << top_bit)) == 0) top_bit--;
255 0 0 for (i = e_bits; i > 0; i--) {
262 0 0 if (bn_mul(&tmp, &result, &result) != 0) return -1;
266 0 0 if (bit) {
268 0 0 if (bn_mul(&tmp, &result, &b) != 0) return -1;