Branch Coverage

src/sha3.c
Criterion Covered Total %
branch 76 94 80.8


line true false branch
33 5888 736 for (i = 0; i < 8; i++, w >>= 8)
60 908568 37857 for (i = 0; i < 24; i++, rc++) {
157 500597 37841 for (i = 0; i < s->blocksize/64; i++, block += 8)
159 189205 37841 for (x = 0; x < 5; x++)
160 689799 3 for (y = 0; y < 5; y++) {
161 189202 500597 if (x + y*5 >= s->blocksize/64)
175 45 45 while (outbits > 0) {
176 225 45 for (y = 0; y < 5; y++)
177 836 125 for (x = 0; x < 5; x++, Z += 8) {
178 100 736 if (x + y*5 >= s->blocksize/64)
182 0 45 if ((outbits -= (int) s->blocksize) > 0)
208 16 31 if (s->alg == SHA3_224) SHA3_INIT(s, SHA3_224, 0);
209 9 22 else if (s->alg == SHA3_256) SHA3_INIT(s, SHA3_256, 0);
210 9 13 else if (s->alg == SHA3_384) SHA3_INIT(s, SHA3_384, 0);
211 9 4 else if (s->alg == SHA3_512) SHA3_INIT(s, SHA3_512, 0);
212 2 2 else if (s->alg == SHAKE128) SHA3_INIT(s, SHAKE128, 1);
213 2 0 else if (s->alg == SHAKE256) SHA3_INIT(s, SHAKE256, 1);
219 22 8 if (alg != SHA3_224 && alg != SHA3_256 &&
16 6 if (alg != SHA3_224 && alg != SHA3_256 &&
10 6 if (alg != SHA3_224 && alg != SHA3_256 &&
220 4 6 alg != SHA3_384 && alg != SHA3_512 &&
2 2 alg != SHA3_384 && alg != SHA3_512 &&
221 0 2 alg != SHAKE128 && alg != SHAKE256)
233 37583 277 while (bitcnt >= s->blocksize) {
238 258 19 if (bitcnt > 0) {
253 225 0 if (s->blockcnt + bitcnt >= s->blocksize) {
273 73 23 for (i = 0UL; i < bitcnt; i++) {
274 56 17 if (BITSET(bitstr, i))
278 0 73 if (++s->blockcnt == s->blocksize)
287 0 300 if (!bitcnt)
289 52 248 if (s->blockcnt == 0)
291 225 23 else if (s->blockcnt % 8 == 0)
300 2512 33 while (s->blockcnt < s->blocksize)
309 16 29 UCHR domain = s->shake ? 0x1f : 0x06;
311 12 33 if (s->padded)
314 12 21 if (s->blockcnt % 8 == 0) {
320 4 17 shawrite((UCHR *) &domain, s->shake ? 5 : 3, s);
321 73 21 while (s->blockcnt % 8)
329 8 8 if (s->alg != SHAKE128 && s->alg != SHAKE256)
0 8 if (s->alg != SHAKE128 && s->alg != SHAKE256)
351 0 29 if (HEXLEN((size_t) s->digestlen) >= sizeof(s->hex))
353 1172 29 for (i = 0, h = s->hex; i < s->digestlen; i++) {
371 0 0 if (n < 1 || n > 3)
0 0 if (n < 1 || n > 3)
390 0 0 if (B64LEN((size_t) s->digestlen) >= sizeof(s->base64))
0 0 if (B64LEN((size_t) s->digestlen) >= sizeof(s->base64))
392 0 0 for (n = s->digestlen; n > 3; n -= 3, q += 3) {