OpenCoverage

ncbc_enc.c #1

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