OpenCoverage

ncbc_enc.c #2

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

Generated by Squish Coco 4.2.2