Branch Coverage

chacha.c
Criterion Covered Total %
branch 55 68 80.8


line true false branch
80 443 0 if (init_buffer) {
102 164640 16464 for (i = 0; i < CHACHA_ROUNDS; i += 2) {
113 263424 16464 for (i = 0; i < 16; i++)
126 0 16176 if (++ctx->state[12] == 0)
132 16128 1086 while (r >= CORESZ) {
138 48 1038 if (r > 0) {
176 192 48 for (i = 0; i < 4; i++) {
177 0 192 if (tv1i[i] != tv1o[i]) croak("QR test 2.1.1 fail %u\n",i);
178 0 192 if (tv2i[i] != tv2o[i]) croak("QR test 2.2.1 fail %u\n",i);
196 1536 48 for (i = 0; i < 32; i++) keys[4][ 0+i] = i;
197 384 48 for (i = 0; i < 8; i++) keys[4][32+i] = i;
198 1536 48 for (i = 0; i < 32; i++) keys[5][ 0+i] = i;
202 288 48 for (test = 0; test < 6; test++) {
208 48 240 if (test == 5) { ctx.state[12]=1; ctx.state[13]=0x09000000; }
210 48 240 if (test == 0) {
211 528 48 for (i = 5; i < 16; i++)
212 0 528 if (ctx.state[i] != 0)
215 18432 288 for (i = 0; i < 64; i++)
218 0 288 if (memcmp(got, expout, 128))
230 1536 48 for (i = 0; i < 32; i++) keys[0][ 0+i] = i;
231 384 48 for (i = 0; i < 8; i++) keys[0][32+i] = i;
232 1536 48 for (i = 0; i < 32; i++) keys[1][ 0+i] = i;
237 96 48 for (test = 0; test < 2; test++) {
245 0 96 if (len > 512) croak("Test vector too large");
248 0 96 if (gen < len) croak("short keystream");
250 20832 96 for (i = 0; i < len; i++)
253 0 96 if (memcmp(got, expout, 2*len))
260 48 0 if (_test_qr() && _test_core() && _test_keystream())
48 0 if (_test_qr() && _test_core() && _test_keystream())
48 0 if (_test_qr() && _test_core() && _test_keystream())
274 0 59 if (bytes < 40) croak("Not enough seed bytes given to ChaCha\n");
280 36 37 while (bytes > 0) {
282 8 28 if (cs->have == 0)
295 982 249318 if (cs->have < 4)