OpenCoverage

ncbc_enc.c #1

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/libressl/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 unsigned int tin0,tin1;-
11 unsigned int tout0,tout1,xor0,xor1;-
12 long l=length;-
13 unsigned int tin[2];-
14 unsigned char *iv;-
15-
16 iv = &(*ivec)[0];-
17-
18 if (enc
encDescription
TRUEevaluated 13 times by 2 tests
Evaluated by:
  • destest
  • libcrypto.so.44.0.1
FALSEevaluated 3 times by 2 tests
Evaluated by:
  • destest
  • libcrypto.so.44.0.1
)
3-13
19 {-
20 (tout0 =((unsigned int)(*((iv)++))) , tout0|=((unsigned int)(*((iv)++)))<< 8L, tout0|=((unsigned int)(*((iv)++)))<<16L, tout0|=((unsigned int)(*((iv)++)))<<24L);-
21 (tout1 =((unsigned int)(*((iv)++))) , tout1|=((unsigned int)(*((iv)++)))<< 8L, tout1|=((unsigned int)(*((iv)++)))<<16L, tout1|=((unsigned int)(*((iv)++)))<<24L);-
22 for (l-=8; l>=0
l>=0Description
TRUEevaluated 251 times by 2 tests
Evaluated by:
  • destest
  • libcrypto.so.44.0.1
FALSEevaluated 13 times by 2 tests
Evaluated by:
  • destest
  • libcrypto.so.44.0.1
; l-=8)
13-251
23 {-
24 (tin0 =((unsigned int)(*((in)++))) , tin0|=((unsigned int)(*((in)++)))<< 8L, tin0|=((unsigned int)(*((in)++)))<<16L, tin0|=((unsigned int)(*((in)++)))<<24L);-
25 (tin1 =((unsigned int)(*((in)++))) , tin1|=((unsigned int)(*((in)++)))<< 8L, tin1|=((unsigned int)(*((in)++)))<<16L, tin1|=((unsigned int)(*((in)++)))<<24L);-
26 tin0^=tout0; tin[0]=tin0;-
27 tin1^=tout1; tin[1]=tin1;-
28 DES_encrypt1((unsigned int *)tin,_schedule,1);-
29 tout0=tin[0]; (*((out)++)=(unsigned char)(((tout0) )&0xff), *((out)++)=(unsigned char)(((tout0)>> 8L)&0xff), *((out)++)=(unsigned char)(((tout0)>>16L)&0xff), *((out)++)=(unsigned char)(((tout0)>>24L)&0xff));-
30 tout1=tin[1]; (*((out)++)=(unsigned char)(((tout1) )&0xff), *((out)++)=(unsigned char)(((tout1)>> 8L)&0xff), *((out)++)=(unsigned char)(((tout1)>>16L)&0xff), *((out)++)=(unsigned char)(((tout1)>>24L)&0xff));-
31 }
executed 251 times by 2 tests: end of block
Executed by:
  • destest
  • libcrypto.so.44.0.1
251
32 if (l != -8
l != -8Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • destest
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.44.0.1
)
4-9
33 {-
34 { in+=l+8; tin0=tin1=0; switch (l+8) { case
never executed: case 8:
8:
never executed: case 8:
tin1 =((unsigned int)(*(--(in))))<<24L; case
never executed: case 7:
7:
never executed: case 7:
code before this statement never executed: case 7:
tin1|=((unsigned int)(*(--(in))))<<16L; case
never executed: case 6:
6:
never executed: case 6:
code before this statement never executed: case 6:
tin1|=((unsigned int)(*(--(in))))<< 8L; case
executed 9 times by 1 test: case 5:
Executed by:
  • destest
code before this statement never executed: case 5:
executed 9 times by 1 test: case 5:
Executed by:
  • destest
5:
code before this statement never executed: case 5:
executed 9 times by 1 test: case 5:
Executed by:
  • destest
tin1|=((unsigned int)(*(--(in)))); case
never executed: case 4:
code before this statement executed 9 times by 1 test: case 4:
Executed by:
  • destest
never executed: case 4:
4:
code before this statement executed 9 times by 1 test: case 4:
Executed by:
  • destest
never executed: case 4:
tin0 =((unsigned int)(*(--(in))))<<24L; case
never executed: case 3:
code before this statement executed 9 times by 1 test: case 3:
Executed by:
  • destest
never executed: case 3:
3:
code before this statement executed 9 times by 1 test: case 3:
Executed by:
  • destest
never executed: case 3:
tin0|=((unsigned int)(*(--(in))))<<16L; case
never executed: case 2:
code before this statement executed 9 times by 1 test: case 2:
Executed by:
  • destest
never executed: case 2:
2:
code before this statement executed 9 times by 1 test: case 2:
Executed by:
  • destest
never executed: case 2:
tin0|=((unsigned int)(*(--(in))))<< 8L; case
executed 9 times by 1 test: case 1:
Executed by:
  • destest
1:
executed 9 times by 1 test: case 1:
Executed by:
  • destest
code before this statement executed 9 times by 1 test: case 1:
Executed by:
  • destest
tin0|=((unsigned int)(*(--(in)))); }
executed 9 times by 1 test: end of block
Executed by:
  • destest
};
0-9
35 tin0^=tout0; tin[0]=tin0;-
36 tin1^=tout1; tin[1]=tin1;-
37 DES_encrypt1((unsigned int *)tin,_schedule,1);-
38 tout0=tin[0]; (*((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]; (*((out)++)=(unsigned char)(((tout1) )&0xff), *((out)++)=(unsigned char)(((tout1)>> 8L)&0xff), *((out)++)=(unsigned char)(((tout1)>>16L)&0xff), *((out)++)=(unsigned char)(((tout1)>>24L)&0xff));-
40 }
executed 9 times by 1 test: end of block
Executed by:
  • destest
9
41-
42-
43-
44-
45-
46 }
executed 13 times by 2 tests: end of block
Executed by:
  • destest
  • libcrypto.so.44.0.1
13
47 else-
48 {-
49 (xor0 =((unsigned int)(*((iv)++))) , xor0|=((unsigned int)(*((iv)++)))<< 8L, xor0|=((unsigned int)(*((iv)++)))<<16L, xor0|=((unsigned int)(*((iv)++)))<<24L);-
50 (xor1 =((unsigned int)(*((iv)++))) , xor1|=((unsigned int)(*((iv)++)))<< 8L, xor1|=((unsigned int)(*((iv)++)))<<16L, xor1|=((unsigned int)(*((iv)++)))<<24L);-
51 for (l-=8; l>=0
l>=0Description
TRUEevaluated 227 times by 2 tests
Evaluated by:
  • destest
  • libcrypto.so.44.0.1
FALSEevaluated 3 times by 2 tests
Evaluated by:
  • destest
  • libcrypto.so.44.0.1
; l-=8)
3-227
52 {-
53 (tin0 =((unsigned int)(*((in)++))) , tin0|=((unsigned int)(*((in)++)))<< 8L, tin0|=((unsigned int)(*((in)++)))<<16L, tin0|=((unsigned int)(*((in)++)))<<24L); tin[0]=tin0;-
54 (tin1 =((unsigned int)(*((in)++))) , tin1|=((unsigned int)(*((in)++)))<< 8L, tin1|=((unsigned int)(*((in)++)))<<16L, tin1|=((unsigned int)(*((in)++)))<<24L); tin[1]=tin1;-
55 DES_encrypt1((unsigned int *)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 227 times by 2 tests: end of block
Executed by:
  • destest
  • libcrypto.so.44.0.1
227
63 if (l != -8
l != -8Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • destest
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.44.0.1
)
1-2
64 {-
65 (tin0 =((unsigned int)(*((in)++))) , tin0|=((unsigned int)(*((in)++)))<< 8L, tin0|=((unsigned int)(*((in)++)))<<16L, tin0|=((unsigned int)(*((in)++)))<<24L); tin[0]=tin0;-
66 (tin1 =((unsigned int)(*((in)++))) , tin1|=((unsigned int)(*((in)++)))<< 8L, tin1|=((unsigned int)(*((in)++)))<<16L, tin1|=((unsigned int)(*((in)++)))<<24L); tin[1]=tin1;-
67 DES_encrypt1((unsigned int *)tin,_schedule,0);-
68 tout0=tin[0]^xor0;-
69 tout1=tin[1]^xor1;-
70 { 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:
  • destest
code before this statement never executed: case 5:
executed 1 time by 1 test: case 5:
Executed by:
  • destest
5:
code before this statement never executed: case 5:
executed 1 time by 1 test: case 5:
Executed by:
  • destest
*(--(out))=(unsigned char)(((tout1) )&0xff); case
never executed: case 4:
code before this statement executed 1 time by 1 test: case 4:
Executed by:
  • destest
never executed: case 4:
4:
code before this statement executed 1 time by 1 test: case 4:
Executed by:
  • destest
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:
  • destest
never executed: case 3:
3:
code before this statement executed 1 time by 1 test: case 3:
Executed by:
  • destest
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:
  • destest
never executed: case 2:
2:
code before this statement executed 1 time by 1 test: case 2:
Executed by:
  • destest
never executed: case 2:
*(--(out))=(unsigned char)(((tout0)>> 8L)&0xff); case
executed 1 time by 1 test: case 1:
Executed by:
  • destest
1:
executed 1 time by 1 test: case 1:
Executed by:
  • destest
code before this statement executed 1 time by 1 test: case 1:
Executed by:
  • destest
*(--(out))=(unsigned char)(((tout0) )&0xff); }
executed 1 time by 1 test: end of block
Executed by:
  • destest
};
0-1
71-
72-
73-
74-
75 }
executed 1 time by 1 test: end of block
Executed by:
  • destest
1
76-
77-
78-
79-
80-
81 }
executed 3 times by 2 tests: end of block
Executed by:
  • destest
  • libcrypto.so.44.0.1
3
82 tin0=tin1=tout0=tout1=xor0=xor1=0;-
83 tin[0]=tin[1]=0;-
84 }
executed 16 times by 2 tests: end of block
Executed by:
  • destest
  • libcrypto.so.44.0.1
16
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2