Branch Coverage

chacha.c
Criterion Covered Total %
branch 55 68 80.8


line true false branch
80 632 0 if (init_buffer) {
102 168490 16849 for (i = 0; i < CHACHA_ROUNDS; i += 2) {
113 269584 16849 for (i = 0; i < 16; i++)
126 0 16435 if (++ctx->state[12] == 0)
132 16366 1135 while (r >= CORESZ) {
138 69 1066 if (r > 0) {
176 276 69 for (i = 0; i < 4; i++) {
177 0 276 if (tv1i[i] != tv1o[i]) croak("QR test 2.1.1 fail %u\n",i);
178 0 276 if (tv2i[i] != tv2o[i]) croak("QR test 2.2.1 fail %u\n",i);
196 2208 69 for (i = 0; i < 32; i++) keys[4][ 0+i] = i;
197 552 69 for (i = 0; i < 8; i++) keys[4][32+i] = i;
198 2208 69 for (i = 0; i < 32; i++) keys[5][ 0+i] = i;
202 414 69 for (test = 0; test < 6; test++) {
208 69 345 if (test == 5) { ctx.state[12]=1; ctx.state[13]=0x09000000; }
210 69 345 if (test == 0) {
211 759 69 for (i = 5; i < 16; i++)
212 0 759 if (ctx.state[i] != 0)
215 26496 414 for (i = 0; i < 64; i++)
218 0 414 if (memcmp(got, expout, 128))
230 2208 69 for (i = 0; i < 32; i++) keys[0][ 0+i] = i;
231 552 69 for (i = 0; i < 8; i++) keys[0][32+i] = i;
232 2208 69 for (i = 0; i < 32; i++) keys[1][ 0+i] = i;
237 138 69 for (test = 0; test < 2; test++) {
245 0 138 if (len > 512) croak("Test vector too large");
248 0 138 if (gen < len) croak("short keystream");
250 29946 138 for (i = 0; i < len; i++)
253 0 138 if (memcmp(got, expout, 2*len))
260 69 0 if (_test_qr() && _test_core() && _test_keystream())
69 0 if (_test_qr() && _test_core() && _test_keystream())
69 0 if (_test_qr() && _test_core() && _test_keystream())
274 0 80 if (bytes < 40) croak("Not enough seed bytes given to ChaCha\n");
280 46 45 while (bytes > 0) {
282 11 35 if (cs->have == 0)
295 986 250576 if (cs->have < 4)