Branch Coverage

chacha.c
Criterion Covered Total %
branch 55 68 80.8


line true false branch
80 659 0 if (init_buffer) {
102 166800 16680 for (i = 0; i < CHACHA_ROUNDS; i += 2) {
113 266880 16680 for (i = 0; i < 16; i++)
126 0 16248 if (++ctx->state[12] == 0)
132 16176 1128 while (r >= CORESZ) {
138 72 1056 if (r > 0) {
176 288 72 for (i = 0; i < 4; i++) {
177 0 288 if (tv1i[i] != tv1o[i]) croak("QR test 2.1.1 fail %u\n",i);
178 0 288 if (tv2i[i] != tv2o[i]) croak("QR test 2.2.1 fail %u\n",i);
196 2304 72 for (i = 0; i < 32; i++) keys[4][ 0+i] = i;
197 576 72 for (i = 0; i < 8; i++) keys[4][32+i] = i;
198 2304 72 for (i = 0; i < 32; i++) keys[5][ 0+i] = i;
202 432 72 for (test = 0; test < 6; test++) {
208 72 360 if (test == 5) { ctx.state[12]=1; ctx.state[13]=0x09000000; }
210 72 360 if (test == 0) {
211 792 72 for (i = 5; i < 16; i++)
212 0 792 if (ctx.state[i] != 0)
215 27648 432 for (i = 0; i < 64; i++)
218 0 432 if (memcmp(got, expout, 128))
230 2304 72 for (i = 0; i < 32; i++) keys[0][ 0+i] = i;
231 576 72 for (i = 0; i < 8; i++) keys[0][32+i] = i;
232 2304 72 for (i = 0; i < 32; i++) keys[1][ 0+i] = i;
237 144 72 for (test = 0; test < 2; test++) {
245 0 144 if (len > 512) croak("Test vector too large");
248 0 144 if (gen < len) croak("short keystream");
250 31248 144 for (i = 0; i < len; i++)
253 0 144 if (memcmp(got, expout, 2*len))
260 72 0 if (_test_qr() && _test_core() && _test_keystream())
72 0 if (_test_qr() && _test_core() && _test_keystream())
72 0 if (_test_qr() && _test_core() && _test_keystream())
274 0 83 if (bytes < 40) croak("Not enough seed bytes given to ChaCha\n");
280 56 56 while (bytes > 0) {
282 10 46 if (cs->have == 0)
295 974 246895 if (cs->have < 4)