Branch Coverage

chacha.c
Criterion Covered Total %
branch 51 64 79.6


line true false branch
92 1096 0 if (init_buffer) {
113 134160 13416 for (i = 0; i < CHACHA_ROUNDS; i += 2) {
124 214656 13416 for (i = 0; i < 16; i++)
137 0 12696 if (++ctx->state[12] == 0)
143 12576 981 while (r >= CORESZ) {
149 120 861 if (r > 0) {
186 480 120 for (i = 0; i < 4; i++) {
187 0 480 if (tv1i[i] != tv1o[i]) croak("QR test 2.1.1 fail %u\n",i);
188 0 480 if (tv2i[i] != tv2o[i]) croak("QR test 2.2.1 fail %u\n",i);
207 4800 120 for (i = 0; i < 40; i++) keys[4][i] = (unsigned char) i % 32;
208 3840 120 for (i = 0; i < 32; i++) keys[5][i] = (unsigned char) i;
218 720 120 for (test = 0; test < 6; test++) {
224 120 600 if (test == 5) { ctx.state[12]=1; ctx.state[13]=0x09000000; }
226 120 600 if (test == 0) {
227 1440 120 for (i = 4; i < 16; i++)
228 0 1440 if (ctx.state[i] != 0)
231 46080 720 for (i = 0; i < 64; i++)
234 0 720 if (memcmp(got, expout, 128))
246 4800 120 for (i = 0; i < 40; i++) keys[0][i] = (unsigned char) i % 32;
247 3840 120 for (i = 0; i < 32; i++) keys[1][i] = (unsigned char) i;
252 240 120 for (test = 0; test < 2; test++) {
260 0 240 if (len > 512) croak("Test vector too large");
263 0 240 if (gen < len) croak("short keystream");
265 52080 240 for (i = 0; i < len; i++)
268 0 240 if (memcmp(got, expout, 2*len))
275 120 0 return _test_qr() && _test_core() && _test_keystream();
120 0 return _test_qr() && _test_core() && _test_keystream();
120 0 return _test_qr() && _test_core() && _test_keystream();
287 0 136 if (bytes < 40) croak("Not enough seed bytes given to ChaCha\n");
293 32 33 while (bytes > 0) {
295 8 24 if (cs->have == 0)
308 733 184248 if (cs->have < 4)