OpenCoverage

cfb_enc.c

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

Generated by Squish Coco 4.2.2