OpenCoverage

cfb_enc.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/libressl/src/crypto/des/cfb_enc.c
Switch to Source codePreprocessed file
LineSourceCount
1void DES_cfb_encrypt(const unsigned char *in, unsigned char *out, int numbits,-
2 long length, DES_key_schedule *schedule, DES_cblock *ivec,-
3 int enc)-
4 {-
5 unsigned int d0,d1,v0,v1;-
6 unsigned long l=length;-
7 int num=numbits/8,n=(numbits+7)/8,i,rem=numbits%8;-
8 unsigned int ti[2];-
9 unsigned char *iv;-
10-
11-
12-
13 unsigned int sh[4];-
14 unsigned char *ovec=(unsigned char *)sh;-
15-
16-
17 if (numbits<=0
numbits<=0Description
TRUEnever evaluated
FALSEevaluated 62 times by 2 tests
Evaluated by:
  • destest
  • libcrypto.so.44.0.1
|| numbits > 64
numbits > 64Description
TRUEnever evaluated
FALSEevaluated 62 times by 2 tests
Evaluated by:
  • destest
  • libcrypto.so.44.0.1
) return;
never executed: return;
0-62
18 iv = &(*ivec)[0];-
19 (v0 =((unsigned int)(*((iv)++))) , v0|=((unsigned int)(*((iv)++)))<< 8L, v0|=((unsigned int)(*((iv)++)))<<16L, v0|=((unsigned int)(*((iv)++)))<<24L);-
20 (v1 =((unsigned int)(*((iv)++))) , v1|=((unsigned int)(*((iv)++)))<< 8L, v1|=((unsigned int)(*((iv)++)))<<16L, v1|=((unsigned int)(*((iv)++)))<<24L);-
21 if (enc
encDescription
TRUEevaluated 31 times by 2 tests
Evaluated by:
  • destest
  • libcrypto.so.44.0.1
FALSEevaluated 31 times by 2 tests
Evaluated by:
  • destest
  • libcrypto.so.44.0.1
)
31
22 {-
23 while (l >= (unsigned long)n
l >= (unsigned long)nDescription
TRUEevaluated 1849 times by 2 tests
Evaluated by:
  • destest
  • libcrypto.so.44.0.1
FALSEevaluated 31 times by 2 tests
Evaluated by:
  • destest
  • libcrypto.so.44.0.1
)
31-1849
24 {-
25 l-=n;-
26 ti[0]=v0;-
27 ti[1]=v1;-
28 DES_encrypt1((unsigned int *)ti,schedule,1);-
29 { in+=n; d0=d1=0; switch (n) { case
executed 3 times by 1 test: case 8:
Executed by:
  • destest
8:
executed 3 times by 1 test: case 8:
Executed by:
  • destest
d1 =((unsigned int)(*(--(in))))<<24L; case
never executed: case 7:
code before this statement executed 3 times by 1 test: case 7:
Executed by:
  • destest
never executed: case 7:
7:
code before this statement executed 3 times by 1 test: case 7:
Executed by:
  • destest
never executed: case 7:
d1|=((unsigned int)(*(--(in))))<<16L; case
executed 4 times by 1 test: case 6:
Executed by:
  • destest
6:
executed 4 times by 1 test: case 6:
Executed by:
  • destest
code before this statement executed 3 times by 1 test: case 6:
Executed by:
  • destest
d1|=((unsigned int)(*(--(in))))<< 8L; case
never executed: case 5:
code before this statement executed 7 times by 1 test: case 5:
Executed by:
  • destest
never executed: case 5:
5:
code before this statement executed 7 times by 1 test: case 5:
Executed by:
  • destest
never executed: case 5:
d1|=((unsigned int)(*(--(in)))); case
executed 6 times by 1 test: case 4:
Executed by:
  • destest
4:
executed 6 times by 1 test: case 4:
Executed by:
  • destest
code before this statement executed 7 times by 1 test: case 4:
Executed by:
  • destest
d0 =((unsigned int)(*(--(in))))<<24L; case
never executed: case 3:
code before this statement executed 13 times by 1 test: case 3:
Executed by:
  • destest
never executed: case 3:
3:
code before this statement executed 13 times by 1 test: case 3:
Executed by:
  • destest
never executed: case 3:
d0|=((unsigned int)(*(--(in))))<<16L; case
executed 12 times by 1 test: case 2:
Executed by:
  • destest
2:
executed 12 times by 1 test: case 2:
Executed by:
  • destest
code before this statement executed 13 times by 1 test: case 2:
Executed by:
  • destest
d0|=((unsigned int)(*(--(in))))<< 8L; case
executed 1849 times by 2 tests: case 1:
Executed by:
  • destest
  • libcrypto.so.44.0.1
1:
executed 1849 times by 2 tests: case 1:
Executed by:
  • destest
  • libcrypto.so.44.0.1
code before this statement executed 25 times by 1 test: case 1:
Executed by:
  • destest
d0|=((unsigned int)(*(--(in)))); }
executed 1849 times by 2 tests: end of block
Executed by:
  • destest
  • libcrypto.so.44.0.1
};
0-1849
30 in+=n;-
31 d0^=ti[0];-
32 d1^=ti[1];-
33 { out+=n; switch (n) { case
executed 3 times by 1 test: case 8:
Executed by:
  • destest
8:
executed 3 times by 1 test: case 8:
Executed by:
  • destest
*(--(out))=(unsigned char)(((d1)>>24L)&0xff); case
never executed: case 7:
code before this statement executed 3 times by 1 test: case 7:
Executed by:
  • destest
never executed: case 7:
7:
code before this statement executed 3 times by 1 test: case 7:
Executed by:
  • destest
never executed: case 7:
*(--(out))=(unsigned char)(((d1)>>16L)&0xff); case
executed 4 times by 1 test: case 6:
Executed by:
  • destest
6:
executed 4 times by 1 test: case 6:
Executed by:
  • destest
code before this statement executed 3 times by 1 test: case 6:
Executed by:
  • destest
*(--(out))=(unsigned char)(((d1)>> 8L)&0xff); case
never executed: case 5:
code before this statement executed 7 times by 1 test: case 5:
Executed by:
  • destest
never executed: case 5:
5:
code before this statement executed 7 times by 1 test: case 5:
Executed by:
  • destest
never executed: case 5:
*(--(out))=(unsigned char)(((d1) )&0xff); case
executed 6 times by 1 test: case 4:
Executed by:
  • destest
4:
executed 6 times by 1 test: case 4:
Executed by:
  • destest
code before this statement executed 7 times by 1 test: case 4:
Executed by:
  • destest
*(--(out))=(unsigned char)(((d0)>>24L)&0xff); case
never executed: case 3:
code before this statement executed 13 times by 1 test: case 3:
Executed by:
  • destest
never executed: case 3:
3:
code before this statement executed 13 times by 1 test: case 3:
Executed by:
  • destest
never executed: case 3:
*(--(out))=(unsigned char)(((d0)>>16L)&0xff); case
executed 12 times by 1 test: case 2:
Executed by:
  • destest
2:
executed 12 times by 1 test: case 2:
Executed by:
  • destest
code before this statement executed 13 times by 1 test: case 2:
Executed by:
  • destest
*(--(out))=(unsigned char)(((d0)>> 8L)&0xff); case
executed 1849 times by 2 tests: case 1:
Executed by:
  • destest
  • libcrypto.so.44.0.1
1:
executed 1849 times by 2 tests: case 1:
Executed by:
  • destest
  • libcrypto.so.44.0.1
code before this statement executed 25 times by 1 test: case 1:
Executed by:
  • destest
*(--(out))=(unsigned char)(((d0) )&0xff); }
executed 1849 times by 2 tests: end of block
Executed by:
  • destest
  • libcrypto.so.44.0.1
};
0-1849
34 out+=n;-
35-
36-
37 if (numbits == 32
numbits == 32Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • destest
FALSEevaluated 1843 times by 2 tests
Evaluated by:
  • destest
  • libcrypto.so.44.0.1
)
6-1843
38 { v0=v1; v1=d0; }
executed 6 times by 1 test: end of block
Executed by:
  • destest
6
39 else if (numbits == 64
numbits == 64Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • destest
FALSEevaluated 1840 times by 2 tests
Evaluated by:
  • destest
  • libcrypto.so.44.0.1
)
3-1840
40 { v0=d0; v1=d1; }
executed 3 times by 1 test: end of block
Executed by:
  • destest
3
41 else-
42 {-
43-
44-
45-
46-
47-
48-
49-
50 sh[0]=v0, sh[1]=v1, sh[2]=d0, sh[3]=d1;-
51-
52 if (rem==0
rem==0Description
TRUEevaluated 1840 times by 2 tests
Evaluated by:
  • destest
  • libcrypto.so.44.0.1
FALSEnever evaluated
)
0-1840
53 memmove(ovec,ovec+num,8);
executed 1840 times by 2 tests: memmove(ovec,ovec+num,8);
Executed by:
  • destest
  • libcrypto.so.44.0.1
1840
54 else-
55 for(i=0 ; i < 8
i < 8Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
56 ovec[i]=ovec[i+num]<<rem |
never executed: ovec[i]=ovec[i+num]<<rem | ovec[i+num+1]>>(8-rem);
0
57 ovec[i+num+1]>>(8-rem);
never executed: ovec[i]=ovec[i+num]<<rem | ovec[i+num+1]>>(8-rem);
0
58-
59 v0=sh[0], v1=sh[1];-
60-
61-
62-
63-
64-
65 }
executed 1840 times by 2 tests: end of block
Executed by:
  • destest
  • libcrypto.so.44.0.1
1840
66 }-
67 }
executed 31 times by 2 tests: end of block
Executed by:
  • destest
  • libcrypto.so.44.0.1
31
68 else-
69 {-
70 while (l >= (unsigned long)n
l >= (unsigned long)nDescription
TRUEevaluated 1849 times by 2 tests
Evaluated by:
  • destest
  • libcrypto.so.44.0.1
FALSEevaluated 31 times by 2 tests
Evaluated by:
  • destest
  • libcrypto.so.44.0.1
)
31-1849
71 {-
72 l-=n;-
73 ti[0]=v0;-
74 ti[1]=v1;-
75 DES_encrypt1((unsigned int *)ti,schedule,1);-
76 { in+=n; d0=d1=0; switch (n) { case
executed 3 times by 1 test: case 8:
Executed by:
  • destest
8:
executed 3 times by 1 test: case 8:
Executed by:
  • destest
d1 =((unsigned int)(*(--(in))))<<24L; case
never executed: case 7:
code before this statement executed 3 times by 1 test: case 7:
Executed by:
  • destest
never executed: case 7:
7:
code before this statement executed 3 times by 1 test: case 7:
Executed by:
  • destest
never executed: case 7:
d1|=((unsigned int)(*(--(in))))<<16L; case
executed 4 times by 1 test: case 6:
Executed by:
  • destest
6:
executed 4 times by 1 test: case 6:
Executed by:
  • destest
code before this statement executed 3 times by 1 test: case 6:
Executed by:
  • destest
d1|=((unsigned int)(*(--(in))))<< 8L; case
never executed: case 5:
code before this statement executed 7 times by 1 test: case 5:
Executed by:
  • destest
never executed: case 5:
5:
code before this statement executed 7 times by 1 test: case 5:
Executed by:
  • destest
never executed: case 5:
d1|=((unsigned int)(*(--(in)))); case
executed 6 times by 1 test: case 4:
Executed by:
  • destest
4:
executed 6 times by 1 test: case 4:
Executed by:
  • destest
code before this statement executed 7 times by 1 test: case 4:
Executed by:
  • destest
d0 =((unsigned int)(*(--(in))))<<24L; case
never executed: case 3:
code before this statement executed 13 times by 1 test: case 3:
Executed by:
  • destest
never executed: case 3:
3:
code before this statement executed 13 times by 1 test: case 3:
Executed by:
  • destest
never executed: case 3:
d0|=((unsigned int)(*(--(in))))<<16L; case
executed 12 times by 1 test: case 2:
Executed by:
  • destest
2:
executed 12 times by 1 test: case 2:
Executed by:
  • destest
code before this statement executed 13 times by 1 test: case 2:
Executed by:
  • destest
d0|=((unsigned int)(*(--(in))))<< 8L; case
executed 1849 times by 2 tests: case 1:
Executed by:
  • destest
  • libcrypto.so.44.0.1
1:
executed 1849 times by 2 tests: case 1:
Executed by:
  • destest
  • libcrypto.so.44.0.1
code before this statement executed 25 times by 1 test: case 1:
Executed by:
  • destest
d0|=((unsigned int)(*(--(in)))); }
executed 1849 times by 2 tests: end of block
Executed by:
  • destest
  • libcrypto.so.44.0.1
};
0-1849
77 in+=n;-
78-
79-
80 if (numbits == 32
numbits == 32Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • destest
FALSEevaluated 1843 times by 2 tests
Evaluated by:
  • destest
  • libcrypto.so.44.0.1
)
6-1843
81 { v0=v1; v1=d0; }
executed 6 times by 1 test: end of block
Executed by:
  • destest
6
82 else if (numbits == 64
numbits == 64Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • destest
FALSEevaluated 1840 times by 2 tests
Evaluated by:
  • destest
  • libcrypto.so.44.0.1
)
3-1840
83 { v0=d0; v1=d1; }
executed 3 times by 1 test: end of block
Executed by:
  • destest
3
84 else-
85 {-
86-
87-
88-
89-
90-
91-
92-
93 sh[0]=v0, sh[1]=v1, sh[2]=d0, sh[3]=d1;-
94-
95 if (rem==0
rem==0Description
TRUEevaluated 1840 times by 2 tests
Evaluated by:
  • destest
  • libcrypto.so.44.0.1
FALSEnever evaluated
)
0-1840
96 memmove(ovec,ovec+num,8);
executed 1840 times by 2 tests: memmove(ovec,ovec+num,8);
Executed by:
  • destest
  • libcrypto.so.44.0.1
1840
97 else-
98 for(i=0 ; i < 8
i < 8Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
99 ovec[i]=ovec[i+num]<<rem |
never executed: ovec[i]=ovec[i+num]<<rem | ovec[i+num+1]>>(8-rem);
0
100 ovec[i+num+1]>>(8-rem);
never executed: ovec[i]=ovec[i+num]<<rem | ovec[i+num+1]>>(8-rem);
0
101-
102 v0=sh[0], v1=sh[1];-
103-
104-
105-
106-
107-
108 }
executed 1840 times by 2 tests: end of block
Executed by:
  • destest
  • libcrypto.so.44.0.1
1840
109 d0^=ti[0];-
110 d1^=ti[1];-
111 { out+=n; switch (n) { case
executed 3 times by 1 test: case 8:
Executed by:
  • destest
8:
executed 3 times by 1 test: case 8:
Executed by:
  • destest
*(--(out))=(unsigned char)(((d1)>>24L)&0xff); case
never executed: case 7:
code before this statement executed 3 times by 1 test: case 7:
Executed by:
  • destest
never executed: case 7:
7:
code before this statement executed 3 times by 1 test: case 7:
Executed by:
  • destest
never executed: case 7:
*(--(out))=(unsigned char)(((d1)>>16L)&0xff); case
executed 4 times by 1 test: case 6:
Executed by:
  • destest
6:
executed 4 times by 1 test: case 6:
Executed by:
  • destest
code before this statement executed 3 times by 1 test: case 6:
Executed by:
  • destest
*(--(out))=(unsigned char)(((d1)>> 8L)&0xff); case
never executed: case 5:
code before this statement executed 7 times by 1 test: case 5:
Executed by:
  • destest
never executed: case 5:
5:
code before this statement executed 7 times by 1 test: case 5:
Executed by:
  • destest
never executed: case 5:
*(--(out))=(unsigned char)(((d1) )&0xff); case
executed 6 times by 1 test: case 4:
Executed by:
  • destest
4:
executed 6 times by 1 test: case 4:
Executed by:
  • destest
code before this statement executed 7 times by 1 test: case 4:
Executed by:
  • destest
*(--(out))=(unsigned char)(((d0)>>24L)&0xff); case
never executed: case 3:
code before this statement executed 13 times by 1 test: case 3:
Executed by:
  • destest
never executed: case 3:
3:
code before this statement executed 13 times by 1 test: case 3:
Executed by:
  • destest
never executed: case 3:
*(--(out))=(unsigned char)(((d0)>>16L)&0xff); case
executed 12 times by 1 test: case 2:
Executed by:
  • destest
2:
executed 12 times by 1 test: case 2:
Executed by:
  • destest
code before this statement executed 13 times by 1 test: case 2:
Executed by:
  • destest
*(--(out))=(unsigned char)(((d0)>> 8L)&0xff); case
executed 1849 times by 2 tests: case 1:
Executed by:
  • destest
  • libcrypto.so.44.0.1
1:
executed 1849 times by 2 tests: case 1:
Executed by:
  • destest
  • libcrypto.so.44.0.1
code before this statement executed 25 times by 1 test: case 1:
Executed by:
  • destest
*(--(out))=(unsigned char)(((d0) )&0xff); }
executed 1849 times by 2 tests: end of block
Executed by:
  • destest
  • libcrypto.so.44.0.1
};
0-1849
112 out+=n;-
113 }
executed 1849 times by 2 tests: end of block
Executed by:
  • destest
  • libcrypto.so.44.0.1
1849
114 }
executed 31 times by 2 tests: end of block
Executed by:
  • destest
  • libcrypto.so.44.0.1
31
115 iv = &(*ivec)[0];-
116 (*((iv)++)=(unsigned char)(((v0) )&0xff), *((iv)++)=(unsigned char)(((v0)>> 8L)&0xff), *((iv)++)=(unsigned char)(((v0)>>16L)&0xff), *((iv)++)=(unsigned char)(((v0)>>24L)&0xff));-
117 (*((iv)++)=(unsigned char)(((v1) )&0xff), *((iv)++)=(unsigned char)(((v1)>> 8L)&0xff), *((iv)++)=(unsigned char)(((v1)>>16L)&0xff), *((iv)++)=(unsigned char)(((v1)>>24L)&0xff));-
118 v0=v1=d0=d1=ti[0]=ti[1]=0;-
119 }
executed 62 times by 2 tests: end of block
Executed by:
  • destest
  • libcrypto.so.44.0.1
62
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2