Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/libressl/src/crypto/des/cbc_cksm.c |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||
---|---|---|---|---|---|---|---|---|
1 | - | |||||||
2 | unsigned 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
| 1-4 | ||||||
15 | { | - | ||||||
16 | if (l >= 8
| 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:
| 3 | ||||||
21 | else | - | ||||||
22 | { in+=l; tin0=tin1=0; switch (l) { case never executed: 8:case 8: never executed: tin1 =((unsigned int)(*(--(in))))<<24L; casecase 8: never executed: 7:case 7: never executed: case 7: code before this statement never executed: tin1|=((unsigned int)(*(--(in))))<<16L; casecase 7: never executed: 6:case 6: never executed: case 6: code before this statement never executed: tin1|=((unsigned int)(*(--(in))))<< 8L; casecase 6: never executed: 5:case 5: never executed: case 5: code before this statement never executed: tin1|=((unsigned int)(*(--(in)))); casecase 5: executed 1 time by 1 test: case 4: Executed by:
code before this statement never executed: case 4: executed 1 time by 1 test: 4:case 4: Executed by:
code before this statement never executed: case 4: executed 1 time by 1 test: tin0 =((unsigned int)(*(--(in))))<<24L; casecase 4: Executed by:
never executed: case 3: code before this statement executed 1 time by 1 test: case 3: Executed by:
never executed: 3:case 3: code before this statement executed 1 time by 1 test: case 3: Executed by:
never executed: tin0|=((unsigned int)(*(--(in))))<<16L; casecase 3: never executed: case 2: code before this statement executed 1 time by 1 test: case 2: Executed by:
never executed: 2:case 2: code before this statement executed 1 time by 1 test: case 2: Executed by:
never executed: tin0|=((unsigned int)(*(--(in))))<< 8L; casecase 2: executed 1 time by 1 test: 1:case 1: Executed by:
executed 1 time by 1 test: case 1: Executed by:
code before this statement executed 1 time by 1 test: tin0|=((unsigned int)(*(--(in)))); }case 1: Executed by:
executed 1 time by 1 test: }end of block Executed by:
executed 1 time by 1 test: ;end of block Executed by:
| 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:
| 4 | ||||||
31 | if (out !=
| 0-1 | ||||||
32 | ((void *)0)
| 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:
| 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: (tout1);return(tout1); Executed by:
executed 1 time by 1 test: return(tout1); Executed by:
| 1 | ||||||
49 | } | - | ||||||
Switch to Source code | Preprocessed file |