OpenCoverage

cfb64ede.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/des/cfb64ede.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8void DES_ede3_cfb64_encrypt(const unsigned char *in, unsigned char *out,-
9 long length, DES_key_schedule *ks1,-
10 DES_key_schedule *ks2, DES_key_schedule *ks3,-
11 DES_cblock *ivec, int *num, int enc)-
12{-
13 register DES_LONG v0, v1;-
14 register long l = length;-
15 register int n = *num;-
16 DES_LONG ti[2];-
17 unsigned char *iv, c, cc;-
18-
19 iv = &(*ivec)[0];-
20 if (enc
encDescription
TRUEevaluated 84 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 60 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
60-84
21 while (l--
l--Description
TRUEevaluated 12580 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 84 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
84-12580
22 if (n == 0
n == 0Description
TRUEevaluated 1573 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 11007 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
1573-11007
23 (v0 =((DES_LONG)(*((iv)++))) , v0|=((DES_LONG)(*((iv)++)))<< 8L, v0|=((DES_LONG)(*((iv)++)))<<16L, v0|=((DES_LONG)(*((iv)++)))<<24L);-
24 (v1 =((DES_LONG)(*((iv)++))) , v1|=((DES_LONG)(*((iv)++)))<< 8L, v1|=((DES_LONG)(*((iv)++)))<<16L, v1|=((DES_LONG)(*((iv)++)))<<24L);-
25-
26 ti[0] = v0;-
27 ti[1] = v1;-
28 DES_encrypt3(ti, ks1, ks2, ks3);-
29 v0 = ti[0];-
30 v1 = ti[1];-
31-
32 iv = &(*ivec)[0];-
33 (*((iv)++)=(unsigned char)(((v0) )&0xff), *((iv)++)=(unsigned char)(((v0)>> 8L)&0xff), *((iv)++)=(unsigned char)(((v0)>>16L)&0xff), *((iv)++)=(unsigned char)(((v0)>>24L)&0xff));-
34 (*((iv)++)=(unsigned char)(((v1) )&0xff), *((iv)++)=(unsigned char)(((v1)>> 8L)&0xff), *((iv)++)=(unsigned char)(((v1)>>16L)&0xff), *((iv)++)=(unsigned char)(((v1)>>24L)&0xff));-
35 iv = &(*ivec)[0];-
36 }
executed 1573 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
1573
37 c = *(in++) ^ iv[n];-
38 *(out++) = c;-
39 iv[n] = c;-
40 n = (n + 1) & 0x07;-
41 }
executed 12580 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
12580
42 }
executed 84 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
84
43 while (l--
l--Description
TRUEevaluated 12580 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 60 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
60-12580
44 if (n == 0
n == 0Description
TRUEevaluated 1573 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 11007 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
1573-11007
45 (v0 =((DES_LONG)(*((iv)++))) , v0|=((DES_LONG)(*((iv)++)))<< 8L, v0|=((DES_LONG)(*((iv)++)))<<16L, v0|=((DES_LONG)(*((iv)++)))<<24L);-
46 (v1 =((DES_LONG)(*((iv)++))) , v1|=((DES_LONG)(*((iv)++)))<< 8L, v1|=((DES_LONG)(*((iv)++)))<<16L, v1|=((DES_LONG)(*((iv)++)))<<24L);-
47-
48 ti[0] = v0;-
49 ti[1] = v1;-
50 DES_encrypt3(ti, ks1, ks2, ks3);-
51 v0 = ti[0];-
52 v1 = ti[1];-
53-
54 iv = &(*ivec)[0];-
55 (*((iv)++)=(unsigned char)(((v0) )&0xff), *((iv)++)=(unsigned char)(((v0)>> 8L)&0xff), *((iv)++)=(unsigned char)(((v0)>>16L)&0xff), *((iv)++)=(unsigned char)(((v0)>>24L)&0xff));-
56 (*((iv)++)=(unsigned char)(((v1) )&0xff), *((iv)++)=(unsigned char)(((v1)>> 8L)&0xff), *((iv)++)=(unsigned char)(((v1)>>16L)&0xff), *((iv)++)=(unsigned char)(((v1)>>24L)&0xff));-
57 iv = &(*ivec)[0];-
58 }
executed 1573 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
1573
59 cc = *(in++);-
60 c = iv[n];-
61 iv[n] = cc;-
62 *(out++) = c ^ cc;-
63 n = (n + 1) & 0x07;-
64 }
executed 12580 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
12580
65 }
executed 60 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
60
66 v0 = v1 = ti[0] = ti[1] = c = cc = 0;-
67 *num = n;-
68}
executed 144 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
144
69-
70-
71-
72-
73-
74-
75void DES_ede3_cfb_encrypt(const unsigned char *in, unsigned char *out,-
76 int numbits, long length, DES_key_schedule *ks1,-
77 DES_key_schedule *ks2, DES_key_schedule *ks3,-
78 DES_cblock *ivec, int enc)-
79{-
80 register DES_LONG d0, d1, v0, v1;-
81 register unsigned long l = length, n = ((unsigned int)numbits + 7) / 8;-
82 register int num = numbits, i;-
83 DES_LONG ti[2];-
84 unsigned char *iv;-
85 unsigned char ovec[16];-
86-
87 if (num > 64
num > 64Description
TRUEnever evaluated
FALSEevaluated 34530 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-34530
88 return;
never executed: return;
0
89 iv = &(*ivec)[0];-
90 (v0 =((DES_LONG)(*((iv)++))) , v0|=((DES_LONG)(*((iv)++)))<< 8L, v0|=((DES_LONG)(*((iv)++)))<<16L, v0|=((DES_LONG)(*((iv)++)))<<24L);-
91 (v1 =((DES_LONG)(*((iv)++))) , v1|=((DES_LONG)(*((iv)++)))<< 8L, v1|=((DES_LONG)(*((iv)++)))<<16L, v1|=((DES_LONG)(*((iv)++)))<<24L);-
92 if (enc
encDescription
TRUEevaluated 16737 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 17793 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
16737-17793
93 while (l >= n
l >= nDescription
TRUEevaluated 18696 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 16737 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
16737-18696
94 l -= n;-
95 ti[0] = v0;-
96 ti[1] = v1;-
97 DES_encrypt3(ti, ks1, ks2, ks3);-
98 { in+=n; d0=d1=0; switch (n) { case
never executed: case 8:
8:
never executed: case 8:
d1 =((DES_LONG)(*(--(in))))<<24L; case
never executed: case 7:
7:
never executed: case 7:
code before this statement never executed: case 7:
d1|=((DES_LONG)(*(--(in))))<<16L; case
never executed: case 6:
6:
never executed: case 6:
code before this statement never executed: case 6:
d1|=((DES_LONG)(*(--(in))))<< 8L; case
never executed: case 5:
5:
never executed: case 5:
code before this statement never executed: case 5:
d1|=((DES_LONG)(*(--(in)))); case
never executed: case 4:
4:
never executed: case 4:
code before this statement never executed: case 4:
d0 =((DES_LONG)(*(--(in))))<<24L; case
never executed: case 3:
3:
never executed: case 3:
code before this statement never executed: case 3:
d0|=((DES_LONG)(*(--(in))))<<16L; case
never executed: case 2:
2:
never executed: case 2:
code before this statement never executed: case 2:
d0|=((DES_LONG)(*(--(in))))<< 8L; case
executed 18696 times by 1 test: case 1:
Executed by:
  • libcrypto.so.1.1
code before this statement never executed: case 1:
executed 18696 times by 1 test: case 1:
Executed by:
  • libcrypto.so.1.1
1:
code before this statement never executed: case 1:
executed 18696 times by 1 test: case 1:
Executed by:
  • libcrypto.so.1.1
d0|=((DES_LONG)(*(--(in)))); }
executed 18696 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
};
0-18696
99 in += n;-
100 d0 ^= ti[0];-
101 d1 ^= ti[1];-
102 { out+=n; switch (n) { case
never executed: case 8:
8:
never executed: case 8:
*(--(out))=(unsigned char)(((d1)>>24L)&0xff); case
never executed: case 7:
7:
never executed: case 7:
code before this statement never executed: case 7:
*(--(out))=(unsigned char)(((d1)>>16L)&0xff); case
never executed: case 6:
6:
never executed: case 6:
code before this statement never executed: case 6:
*(--(out))=(unsigned char)(((d1)>> 8L)&0xff); case
never executed: case 5:
5:
never executed: case 5:
code before this statement never executed: case 5:
*(--(out))=(unsigned char)(((d1) )&0xff); case
never executed: case 4:
4:
never executed: case 4:
code before this statement never executed: case 4:
*(--(out))=(unsigned char)(((d0)>>24L)&0xff); case
never executed: case 3:
3:
never executed: case 3:
code before this statement never executed: case 3:
*(--(out))=(unsigned char)(((d0)>>16L)&0xff); case
never executed: case 2:
2:
never executed: case 2:
code before this statement never executed: case 2:
*(--(out))=(unsigned char)(((d0)>> 8L)&0xff); case
executed 18696 times by 1 test: case 1:
Executed by:
  • libcrypto.so.1.1
code before this statement never executed: case 1:
executed 18696 times by 1 test: case 1:
Executed by:
  • libcrypto.so.1.1
1:
code before this statement never executed: case 1:
executed 18696 times by 1 test: case 1:
Executed by:
  • libcrypto.so.1.1
*(--(out))=(unsigned char)(((d0) )&0xff); }
executed 18696 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
};
0-18696
103 out += n;-
104-
105-
106-
107-
108 if (num == 32
num == 32Description
TRUEnever evaluated
FALSEevaluated 18696 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-18696
109 v0 = v1;-
110 v1 = d0;-
111 }
never executed: end of block
else if (num == 64
num == 64Description
TRUEnever evaluated
FALSEevaluated 18696 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-18696
112 v0 = d0;-
113 v1 = d1;-
114 }
never executed: end of block
else {
0
115 iv = &ovec[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 (*((iv)++)=(unsigned char)(((d0) )&0xff), *((iv)++)=(unsigned char)(((d0)>> 8L)&0xff), *((iv)++)=(unsigned char)(((d0)>>16L)&0xff), *((iv)++)=(unsigned char)(((d0)>>24L)&0xff));-
119 (*((iv)++)=(unsigned char)(((d1) )&0xff), *((iv)++)=(unsigned char)(((d1)>> 8L)&0xff), *((iv)++)=(unsigned char)(((d1)>>16L)&0xff), *((iv)++)=(unsigned char)(((d1)>>24L)&0xff));-
120-
121 memmove(ovec, ovec + num / 8, 8 + (num % 8 ? 1 : 0));-
122-
123 if (num % 8 != 0
num % 8 != 0Description
TRUEevaluated 16736 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1960 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
1960-16736
124 for (i = 0; i < 8
i < 8Description
TRUEevaluated 133888 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 16736 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; ++i) {
16736-133888
125 ovec[i] <<= num % 8;-
126 ovec[i] |= ovec[i + 1] >> (8 - num % 8);-
127 }
executed 133888 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
133888
128 iv = &ovec[0];-
129 (v0 =((DES_LONG)(*((iv)++))) , v0|=((DES_LONG)(*((iv)++)))<< 8L, v0|=((DES_LONG)(*((iv)++)))<<16L, v0|=((DES_LONG)(*((iv)++)))<<24L);-
130 (v1 =((DES_LONG)(*((iv)++))) , v1|=((DES_LONG)(*((iv)++)))<< 8L, v1|=((DES_LONG)(*((iv)++)))<<16L, v1|=((DES_LONG)(*((iv)++)))<<24L);-
131 }
executed 18696 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
18696
132 }-
133 }
executed 16737 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
16737
134 while (l >= n
l >= nDescription
TRUEevaluated 19752 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 17793 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
17793-19752
135 l -= n;-
136 ti[0] = v0;-
137 ti[1] = v1;-
138 DES_encrypt3(ti, ks1, ks2, ks3);-
139 { in+=n; d0=d1=0; switch (n) { case
never executed: case 8:
8:
never executed: case 8:
d1 =((DES_LONG)(*(--(in))))<<24L; case
never executed: case 7:
7:
never executed: case 7:
code before this statement never executed: case 7:
d1|=((DES_LONG)(*(--(in))))<<16L; case
never executed: case 6:
6:
never executed: case 6:
code before this statement never executed: case 6:
d1|=((DES_LONG)(*(--(in))))<< 8L; case
never executed: case 5:
5:
never executed: case 5:
code before this statement never executed: case 5:
d1|=((DES_LONG)(*(--(in)))); case
never executed: case 4:
4:
never executed: case 4:
code before this statement never executed: case 4:
d0 =((DES_LONG)(*(--(in))))<<24L; case
never executed: case 3:
3:
never executed: case 3:
code before this statement never executed: case 3:
d0|=((DES_LONG)(*(--(in))))<<16L; case
never executed: case 2:
2:
never executed: case 2:
code before this statement never executed: case 2:
d0|=((DES_LONG)(*(--(in))))<< 8L; case
executed 19752 times by 1 test: case 1:
Executed by:
  • libcrypto.so.1.1
code before this statement never executed: case 1:
executed 19752 times by 1 test: case 1:
Executed by:
  • libcrypto.so.1.1
1:
code before this statement never executed: case 1:
executed 19752 times by 1 test: case 1:
Executed by:
  • libcrypto.so.1.1
d0|=((DES_LONG)(*(--(in)))); }
executed 19752 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
};
0-19752
140 in += n;-
141-
142-
143-
144-
145 if (num == 32
num == 32Description
TRUEnever evaluated
FALSEevaluated 19752 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-19752
146 v0 = v1;-
147 v1 = d0;-
148 }
never executed: end of block
else if (num == 64
num == 64Description
TRUEnever evaluated
FALSEevaluated 19752 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-19752
149 v0 = d0;-
150 v1 = d1;-
151 }
never executed: end of block
else {
0
152 iv = &ovec[0];-
153 (*((iv)++)=(unsigned char)(((v0) )&0xff), *((iv)++)=(unsigned char)(((v0)>> 8L)&0xff), *((iv)++)=(unsigned char)(((v0)>>16L)&0xff), *((iv)++)=(unsigned char)(((v0)>>24L)&0xff));-
154 (*((iv)++)=(unsigned char)(((v1) )&0xff), *((iv)++)=(unsigned char)(((v1)>> 8L)&0xff), *((iv)++)=(unsigned char)(((v1)>>16L)&0xff), *((iv)++)=(unsigned char)(((v1)>>24L)&0xff));-
155 (*((iv)++)=(unsigned char)(((d0) )&0xff), *((iv)++)=(unsigned char)(((d0)>> 8L)&0xff), *((iv)++)=(unsigned char)(((d0)>>16L)&0xff), *((iv)++)=(unsigned char)(((d0)>>24L)&0xff));-
156 (*((iv)++)=(unsigned char)(((d1) )&0xff), *((iv)++)=(unsigned char)(((d1)>> 8L)&0xff), *((iv)++)=(unsigned char)(((d1)>>16L)&0xff), *((iv)++)=(unsigned char)(((d1)>>24L)&0xff));-
157-
158 memmove(ovec, ovec + num / 8, 8 + (num % 8 ? 1 : 0));-
159-
160 if (num % 8 != 0
num % 8 != 0Description
TRUEevaluated 17792 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1960 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
1960-17792
161 for (i = 0; i < 8
i < 8Description
TRUEevaluated 142336 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 17792 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; ++i) {
17792-142336
162 ovec[i] <<= num % 8;-
163 ovec[i] |= ovec[i + 1] >> (8 - num % 8);-
164 }
executed 142336 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
142336
165 iv = &ovec[0];-
166 (v0 =((DES_LONG)(*((iv)++))) , v0|=((DES_LONG)(*((iv)++)))<< 8L, v0|=((DES_LONG)(*((iv)++)))<<16L, v0|=((DES_LONG)(*((iv)++)))<<24L);-
167 (v1 =((DES_LONG)(*((iv)++))) , v1|=((DES_LONG)(*((iv)++)))<< 8L, v1|=((DES_LONG)(*((iv)++)))<<16L, v1|=((DES_LONG)(*((iv)++)))<<24L);-
168 }
executed 19752 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
19752
169 d0 ^= ti[0];-
170 d1 ^= ti[1];-
171 { out+=n; switch (n) { case
never executed: case 8:
8:
never executed: case 8:
*(--(out))=(unsigned char)(((d1)>>24L)&0xff); case
never executed: case 7:
7:
never executed: case 7:
code before this statement never executed: case 7:
*(--(out))=(unsigned char)(((d1)>>16L)&0xff); case
never executed: case 6:
6:
never executed: case 6:
code before this statement never executed: case 6:
*(--(out))=(unsigned char)(((d1)>> 8L)&0xff); case
never executed: case 5:
5:
never executed: case 5:
code before this statement never executed: case 5:
*(--(out))=(unsigned char)(((d1) )&0xff); case
never executed: case 4:
4:
never executed: case 4:
code before this statement never executed: case 4:
*(--(out))=(unsigned char)(((d0)>>24L)&0xff); case
never executed: case 3:
3:
never executed: case 3:
code before this statement never executed: case 3:
*(--(out))=(unsigned char)(((d0)>>16L)&0xff); case
never executed: case 2:
2:
never executed: case 2:
code before this statement never executed: case 2:
*(--(out))=(unsigned char)(((d0)>> 8L)&0xff); case
executed 19752 times by 1 test: case 1:
Executed by:
  • libcrypto.so.1.1
code before this statement never executed: case 1:
executed 19752 times by 1 test: case 1:
Executed by:
  • libcrypto.so.1.1
1:
code before this statement never executed: case 1:
executed 19752 times by 1 test: case 1:
Executed by:
  • libcrypto.so.1.1
*(--(out))=(unsigned char)(((d0) )&0xff); }
executed 19752 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
};
0-19752
172 out += n;-
173 }
executed 19752 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
19752
174 }
executed 17793 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
17793
175 iv = &(*ivec)[0];-
176 (*((iv)++)=(unsigned char)(((v0) )&0xff), *((iv)++)=(unsigned char)(((v0)>> 8L)&0xff), *((iv)++)=(unsigned char)(((v0)>>16L)&0xff), *((iv)++)=(unsigned char)(((v0)>>24L)&0xff));-
177 (*((iv)++)=(unsigned char)(((v1) )&0xff), *((iv)++)=(unsigned char)(((v1)>> 8L)&0xff), *((iv)++)=(unsigned char)(((v1)>>16L)&0xff), *((iv)++)=(unsigned char)(((v1)>>24L)&0xff));-
178 v0 = v1 = d0 = d1 = ti[0] = ti[1] = 0;-
179}
executed 34530 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
34530
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2