OpenCoverage

cbc_cksm.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/libressl/src/crypto/des/cbc_cksm.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2unsigned int DES_cbc_cksum(const unsigned char *in, DES_cblock *output,-
3 long length, DES_key_schedule *schedule,-
4 const_DES_cblock *ivec)-
5 {-
6 unsigned int tout0,tout1,tin0,tin1;-
7 long l=length;-
8 unsigned int tin[2];-
9 unsigned char *out = &(*output)[0];-
10 const unsigned char *iv = &(*ivec)[0];-
11-
12 (tout0 =((unsigned int)(*((iv)++))) , tout0|=((unsigned int)(*((iv)++)))<< 8L, tout0|=((unsigned int)(*((iv)++)))<<16L, tout0|=((unsigned int)(*((iv)++)))<<24L);-
13 (tout1 =((unsigned int)(*((iv)++))) , tout1|=((unsigned int)(*((iv)++)))<< 8L, tout1|=((unsigned int)(*((iv)++)))<<16L, tout1|=((unsigned int)(*((iv)++)))<<24L);-
14 for (; l>0
l>0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • destest
FALSEevaluated 1 time by 1 test
Evaluated by:
  • destest
; l-=8)
1-4
15 {-
16 if (l >= 8
l >= 8Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • destest
FALSEevaluated 1 time by 1 test
Evaluated by:
  • destest
)
1-3
17 {-
18 (tin0 =((unsigned int)(*((in)++))) , tin0|=((unsigned int)(*((in)++)))<< 8L, tin0|=((unsigned int)(*((in)++)))<<16L, tin0|=((unsigned int)(*((in)++)))<<24L);-
19 (tin1 =((unsigned int)(*((in)++))) , tin1|=((unsigned int)(*((in)++)))<< 8L, tin1|=((unsigned int)(*((in)++)))<<16L, tin1|=((unsigned int)(*((in)++)))<<24L);-
20 }
executed 3 times by 1 test: end of block
Executed by:
  • destest
3
21 else-
22 { in+=l; tin0=tin1=0; switch (l) { case
never executed: case 8:
8:
never executed: case 8:
tin1 =((unsigned int)(*(--(in))))<<24L; case
never executed: case 7:
7:
never executed: case 7:
code before this statement never executed: case 7:
tin1|=((unsigned int)(*(--(in))))<<16L; case
never executed: case 6:
6:
never executed: case 6:
code before this statement never executed: case 6:
tin1|=((unsigned int)(*(--(in))))<< 8L; case
never executed: case 5:
5:
never executed: case 5:
code before this statement never executed: case 5:
tin1|=((unsigned int)(*(--(in)))); case
executed 1 time by 1 test: case 4:
Executed by:
  • destest
code before this statement never executed: case 4:
executed 1 time by 1 test: case 4:
Executed by:
  • destest
4:
code before this statement never executed: case 4:
executed 1 time by 1 test: case 4:
Executed by:
  • destest
tin0 =((unsigned int)(*(--(in))))<<24L; case
never executed: case 3:
code before this statement executed 1 time by 1 test: case 3:
Executed by:
  • destest
never executed: case 3:
3:
code before this statement executed 1 time by 1 test: case 3:
Executed by:
  • destest
never executed: case 3:
tin0|=((unsigned int)(*(--(in))))<<16L; case
never executed: case 2:
code before this statement executed 1 time by 1 test: case 2:
Executed by:
  • destest
never executed: case 2:
2:
code before this statement executed 1 time by 1 test: case 2:
Executed by:
  • destest
never executed: case 2:
tin0|=((unsigned int)(*(--(in))))<< 8L; case
executed 1 time by 1 test: case 1:
Executed by:
  • destest
1:
executed 1 time by 1 test: case 1:
Executed by:
  • destest
code before this statement executed 1 time by 1 test: case 1:
Executed by:
  • destest
tin0|=((unsigned int)(*(--(in)))); }
executed 1 time by 1 test: end of block
Executed by:
  • destest
}
executed 1 time by 1 test: end of block
Executed by:
  • destest
;
0-1
23-
24 tin0^=tout0; tin[0]=tin0;-
25 tin1^=tout1; tin[1]=tin1;-
26 DES_encrypt1((unsigned int *)tin,schedule,1);-
27-
28 tout0=tin[0];-
29 tout1=tin[1];-
30 }
executed 4 times by 1 test: end of block
Executed by:
  • destest
4
31 if (out !=
out != ((void *)0)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • destest
FALSEnever evaluated
0-1
32 ((void *)0)
out != ((void *)0)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • destest
FALSEnever evaluated
0-1
33 )-
34 {-
35 (*((out)++)=(unsigned char)(((tout0) )&0xff), *((out)++)=(unsigned char)(((tout0)>> 8L)&0xff), *((out)++)=(unsigned char)(((tout0)>>16L)&0xff), *((out)++)=(unsigned char)(((tout0)>>24L)&0xff));-
36 (*((out)++)=(unsigned char)(((tout1) )&0xff), *((out)++)=(unsigned char)(((tout1)>> 8L)&0xff), *((out)++)=(unsigned char)(((tout1)>>16L)&0xff), *((out)++)=(unsigned char)(((tout1)>>24L)&0xff));-
37 }
executed 1 time by 1 test: end of block
Executed by:
  • destest
1
38 tout0=tin0=tin1=tin[0]=tin[1]=0;-
39-
40-
41-
42-
43-
44 tout1 = ((tout1 >> 24L) & 0x000000FF)-
45 | ((tout1 >> 8L) & 0x0000FF00)-
46 | ((tout1 << 8L) & 0x00FF0000)-
47 | ((tout1 << 24L) & 0xFF000000);-
48 return
executed 1 time by 1 test: return(tout1);
Executed by:
  • destest
(tout1);
executed 1 time by 1 test: return(tout1);
Executed by:
  • destest
1
49 }-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2