OpenCoverage

xcbc_enc.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/des/xcbc_enc.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4void DES_xcbc_encrypt(const unsigned char *in, unsigned char *out,-
5 long length, DES_key_schedule *schedule,-
6 DES_cblock *ivec, const_DES_cblock *inw,-
7 const_DES_cblock *outw, int enc)-
8{-
9 register DES_LONG tin0, tin1;-
10 register DES_LONG tout0, tout1, xor0, xor1;-
11 register DES_LONG inW0, inW1, outW0, outW1;-
12 register const unsigned char *in2;-
13 register long l = length;-
14 DES_LONG tin[2];-
15 unsigned char *iv;-
16-
17 in2 = &(*inw)[0];-
18 (inW0 =((DES_LONG)(*((in2)++))) , inW0|=((DES_LONG)(*((in2)++)))<< 8L, inW0|=((DES_LONG)(*((in2)++)))<<16L, inW0|=((DES_LONG)(*((in2)++)))<<24L);-
19 (inW1 =((DES_LONG)(*((in2)++))) , inW1|=((DES_LONG)(*((in2)++)))<< 8L, inW1|=((DES_LONG)(*((in2)++)))<<16L, inW1|=((DES_LONG)(*((in2)++)))<<24L);-
20 in2 = &(*outw)[0];-
21 (outW0 =((DES_LONG)(*((in2)++))) , outW0|=((DES_LONG)(*((in2)++)))<< 8L, outW0|=((DES_LONG)(*((in2)++)))<<16L, outW0|=((DES_LONG)(*((in2)++)))<<24L);-
22 (outW1 =((DES_LONG)(*((in2)++))) , outW1|=((DES_LONG)(*((in2)++)))<< 8L, outW1|=((DES_LONG)(*((in2)++)))<<16L, outW1|=((DES_LONG)(*((in2)++)))<<24L);-
23-
24 iv = &(*ivec)[0];-
25-
26 if (enc
encDescription
TRUEevaluated 103 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 79 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
79-103
27 (tout0 =((DES_LONG)(*((iv)++))) , tout0|=((DES_LONG)(*((iv)++)))<< 8L, tout0|=((DES_LONG)(*((iv)++)))<<16L, tout0|=((DES_LONG)(*((iv)++)))<<24L);-
28 (tout1 =((DES_LONG)(*((iv)++))) , tout1|=((DES_LONG)(*((iv)++)))<< 8L, tout1|=((DES_LONG)(*((iv)++)))<<16L, tout1|=((DES_LONG)(*((iv)++)))<<24L);-
29 for (l -= 8; l >= 0
l >= 0Description
TRUEevaluated 1083 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 103 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; l -= 8) {
103-1083
30 (tin0 =((DES_LONG)(*((in)++))) , tin0|=((DES_LONG)(*((in)++)))<< 8L, tin0|=((DES_LONG)(*((in)++)))<<16L, tin0|=((DES_LONG)(*((in)++)))<<24L);-
31 (tin1 =((DES_LONG)(*((in)++))) , tin1|=((DES_LONG)(*((in)++)))<< 8L, tin1|=((DES_LONG)(*((in)++)))<<16L, tin1|=((DES_LONG)(*((in)++)))<<24L);-
32 tin0 ^= tout0 ^ inW0;-
33 tin[0] = tin0;-
34 tin1 ^= tout1 ^ inW1;-
35 tin[1] = tin1;-
36 DES_encrypt1(tin, schedule, 1);-
37 tout0 = tin[0] ^ outW0;-
38 (*((out)++)=(unsigned char)(((tout0) )&0xff), *((out)++)=(unsigned char)(((tout0)>> 8L)&0xff), *((out)++)=(unsigned char)(((tout0)>>16L)&0xff), *((out)++)=(unsigned char)(((tout0)>>24L)&0xff));-
39 tout1 = tin[1] ^ outW1;-
40 (*((out)++)=(unsigned char)(((tout1) )&0xff), *((out)++)=(unsigned char)(((tout1)>> 8L)&0xff), *((out)++)=(unsigned char)(((tout1)>>16L)&0xff), *((out)++)=(unsigned char)(((tout1)>>24L)&0xff));-
41 }
executed 1083 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
1083
42 if (l != -8
l != -8Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 102 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
1-102
43 { in+=l + 8; tin0=tin1=0; switch (l + 8) { case
never executed: case 8:
8:
never executed: case 8:
tin1 =((DES_LONG)(*(--(in))))<<24L; case
never executed: case 7:
7:
never executed: case 7:
code before this statement never executed: case 7:
tin1|=((DES_LONG)(*(--(in))))<<16L; case
never executed: case 6:
6:
never executed: case 6:
code before this statement never executed: case 6:
tin1|=((DES_LONG)(*(--(in))))<< 8L; case
executed 1 time by 1 test: case 5:
Executed by:
  • libcrypto.so.1.1
code before this statement never executed: case 5:
executed 1 time by 1 test: case 5:
Executed by:
  • libcrypto.so.1.1
5:
code before this statement never executed: case 5:
executed 1 time by 1 test: case 5:
Executed by:
  • libcrypto.so.1.1
tin1|=((DES_LONG)(*(--(in)))); case
never executed: case 4:
code before this statement executed 1 time by 1 test: case 4:
Executed by:
  • libcrypto.so.1.1
never executed: case 4:
4:
code before this statement executed 1 time by 1 test: case 4:
Executed by:
  • libcrypto.so.1.1
never executed: case 4:
tin0 =((DES_LONG)(*(--(in))))<<24L; case
never executed: case 3:
code before this statement executed 1 time by 1 test: case 3:
Executed by:
  • libcrypto.so.1.1
never executed: case 3:
3:
code before this statement executed 1 time by 1 test: case 3:
Executed by:
  • libcrypto.so.1.1
never executed: case 3:
tin0|=((DES_LONG)(*(--(in))))<<16L; case
never executed: case 2:
code before this statement executed 1 time by 1 test: case 2:
Executed by:
  • libcrypto.so.1.1
never executed: case 2:
2:
code before this statement executed 1 time by 1 test: case 2:
Executed by:
  • libcrypto.so.1.1
never executed: case 2:
tin0|=((DES_LONG)(*(--(in))))<< 8L; case
executed 1 time by 1 test: case 1:
Executed by:
  • libcrypto.so.1.1
1:
executed 1 time by 1 test: case 1:
Executed by:
  • libcrypto.so.1.1
code before this statement executed 1 time by 1 test: case 1:
Executed by:
  • libcrypto.so.1.1
tin0|=((DES_LONG)(*(--(in)))); }
executed 1 time by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
};
0-1
44 tin0 ^= tout0 ^ inW0;-
45 tin[0] = tin0;-
46 tin1 ^= tout1 ^ inW1;-
47 tin[1] = tin1;-
48 DES_encrypt1(tin, schedule, 1);-
49 tout0 = tin[0] ^ outW0;-
50 (*((out)++)=(unsigned char)(((tout0) )&0xff), *((out)++)=(unsigned char)(((tout0)>> 8L)&0xff), *((out)++)=(unsigned char)(((tout0)>>16L)&0xff), *((out)++)=(unsigned char)(((tout0)>>24L)&0xff));-
51 tout1 = tin[1] ^ outW1;-
52 (*((out)++)=(unsigned char)(((tout1) )&0xff), *((out)++)=(unsigned char)(((tout1)>> 8L)&0xff), *((out)++)=(unsigned char)(((tout1)>>16L)&0xff), *((out)++)=(unsigned char)(((tout1)>>24L)&0xff));-
53 }
executed 1 time by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
1
54 iv = &(*ivec)[0];-
55 (*((iv)++)=(unsigned char)(((tout0) )&0xff), *((iv)++)=(unsigned char)(((tout0)>> 8L)&0xff), *((iv)++)=(unsigned char)(((tout0)>>16L)&0xff), *((iv)++)=(unsigned char)(((tout0)>>24L)&0xff));-
56 (*((iv)++)=(unsigned char)(((tout1) )&0xff), *((iv)++)=(unsigned char)(((tout1)>> 8L)&0xff), *((iv)++)=(unsigned char)(((tout1)>>16L)&0xff), *((iv)++)=(unsigned char)(((tout1)>>24L)&0xff));-
57 }
executed 103 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
103
58 (xor0 =((DES_LONG)(*((iv)++))) , xor0|=((DES_LONG)(*((iv)++)))<< 8L, xor0|=((DES_LONG)(*((iv)++)))<<16L, xor0|=((DES_LONG)(*((iv)++)))<<24L);-
59 (xor1 =((DES_LONG)(*((iv)++))) , xor1|=((DES_LONG)(*((iv)++)))<< 8L, xor1|=((DES_LONG)(*((iv)++)))<<16L, xor1|=((DES_LONG)(*((iv)++)))<<24L);-
60 for (l -= 8; l > 0
l > 0Description
TRUEevaluated 1005 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 79 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; l -= 8) {
79-1005
61 (tin0 =((DES_LONG)(*((in)++))) , tin0|=((DES_LONG)(*((in)++)))<< 8L, tin0|=((DES_LONG)(*((in)++)))<<16L, tin0|=((DES_LONG)(*((in)++)))<<24L);-
62 tin[0] = tin0 ^ outW0;-
63 (tin1 =((DES_LONG)(*((in)++))) , tin1|=((DES_LONG)(*((in)++)))<< 8L, tin1|=((DES_LONG)(*((in)++)))<<16L, tin1|=((DES_LONG)(*((in)++)))<<24L);-
64 tin[1] = tin1 ^ outW1;-
65 DES_encrypt1(tin, schedule, 0);-
66 tout0 = tin[0] ^ xor0 ^ inW0;-
67 tout1 = tin[1] ^ xor1 ^ inW1;-
68 (*((out)++)=(unsigned char)(((tout0) )&0xff), *((out)++)=(unsigned char)(((tout0)>> 8L)&0xff), *((out)++)=(unsigned char)(((tout0)>>16L)&0xff), *((out)++)=(unsigned char)(((tout0)>>24L)&0xff));-
69 (*((out)++)=(unsigned char)(((tout1) )&0xff), *((out)++)=(unsigned char)(((tout1)>> 8L)&0xff), *((out)++)=(unsigned char)(((tout1)>>16L)&0xff), *((out)++)=(unsigned char)(((tout1)>>24L)&0xff));-
70 xor0 = tin0;-
71 xor1 = tin1;-
72 }
executed 1005 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
1005
73 if (l != -8
l != -8Description
TRUEevaluated 79 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-79
74 (tin0 =((DES_LONG)(*((in)++))) , tin0|=((DES_LONG)(*((in)++)))<< 8L, tin0|=((DES_LONG)(*((in)++)))<<16L, tin0|=((DES_LONG)(*((in)++)))<<24L);-
75 tin[0] = tin0 ^ outW0;-
76 (tin1 =((DES_LONG)(*((in)++))) , tin1|=((DES_LONG)(*((in)++)))<< 8L, tin1|=((DES_LONG)(*((in)++)))<<16L, tin1|=((DES_LONG)(*((in)++)))<<24L);-
77 tin[1] = tin1 ^ outW1;-
78 DES_encrypt1(tin, schedule, 0);-
79 tout0 = tin[0] ^ xor0 ^ inW0;-
80 tout1 = tin[1] ^ xor1 ^ inW1;-
81 { out+=l + 8; switch (l + 8) { case
executed 78 times by 1 test: case 8:
Executed by:
  • libcrypto.so.1.1
8:
executed 78 times by 1 test: case 8:
Executed by:
  • libcrypto.so.1.1
*(--(out))=(unsigned char)(((tout1)>>24L)&0xff); case
never executed: case 7:
code before this statement executed 78 times by 1 test: case 7:
Executed by:
  • libcrypto.so.1.1
never executed: case 7:
7:
code before this statement executed 78 times by 1 test: case 7:
Executed by:
  • libcrypto.so.1.1
never executed: case 7:
*(--(out))=(unsigned char)(((tout1)>>16L)&0xff); case
never executed: case 6:
code before this statement executed 78 times by 1 test: case 6:
Executed by:
  • libcrypto.so.1.1
never executed: case 6:
6:
code before this statement executed 78 times by 1 test: case 6:
Executed by:
  • libcrypto.so.1.1
never executed: case 6:
*(--(out))=(unsigned char)(((tout1)>> 8L)&0xff); case
executed 1 time by 1 test: case 5:
Executed by:
  • libcrypto.so.1.1
5:
executed 1 time by 1 test: case 5:
Executed by:
  • libcrypto.so.1.1
code before this statement executed 78 times by 1 test: case 5:
Executed by:
  • libcrypto.so.1.1
*(--(out))=(unsigned char)(((tout1) )&0xff); case
never executed: case 4:
code before this statement executed 79 times by 1 test: case 4:
Executed by:
  • libcrypto.so.1.1
never executed: case 4:
4:
code before this statement executed 79 times by 1 test: case 4:
Executed by:
  • libcrypto.so.1.1
never executed: case 4:
*(--(out))=(unsigned char)(((tout0)>>24L)&0xff); case
never executed: case 3:
code before this statement executed 79 times by 1 test: case 3:
Executed by:
  • libcrypto.so.1.1
never executed: case 3:
3:
code before this statement executed 79 times by 1 test: case 3:
Executed by:
  • libcrypto.so.1.1
never executed: case 3:
*(--(out))=(unsigned char)(((tout0)>>16L)&0xff); case
never executed: case 2:
code before this statement executed 79 times by 1 test: case 2:
Executed by:
  • libcrypto.so.1.1
never executed: case 2:
2:
code before this statement executed 79 times by 1 test: case 2:
Executed by:
  • libcrypto.so.1.1
never executed: case 2:
*(--(out))=(unsigned char)(((tout0)>> 8L)&0xff); case
executed 79 times by 1 test: case 1:
Executed by:
  • libcrypto.so.1.1
1:
executed 79 times by 1 test: case 1:
Executed by:
  • libcrypto.so.1.1
code before this statement executed 79 times by 1 test: case 1:
Executed by:
  • libcrypto.so.1.1
*(--(out))=(unsigned char)(((tout0) )&0xff); }
executed 79 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
};
0-79
82 xor0 = tin0;-
83 xor1 = tin1;-
84 }
executed 79 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
79
85-
86 iv = &(*ivec)[0];-
87 (*((iv)++)=(unsigned char)(((xor0) )&0xff), *((iv)++)=(unsigned char)(((xor0)>> 8L)&0xff), *((iv)++)=(unsigned char)(((xor0)>>16L)&0xff), *((iv)++)=(unsigned char)(((xor0)>>24L)&0xff));-
88 (*((iv)++)=(unsigned char)(((xor1) )&0xff), *((iv)++)=(unsigned char)(((xor1)>> 8L)&0xff), *((iv)++)=(unsigned char)(((xor1)>>16L)&0xff), *((iv)++)=(unsigned char)(((xor1)>>24L)&0xff));-
89 }
executed 79 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
79
90 tin0 = tin1 = tout0 = tout1 = xor0 = xor1 = 0;-
91 inW0 = inW1 = outW0 = outW1 = 0;-
92 tin[0] = tin[1] = 0;-
93}
executed 182 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
182
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2