OpenCoverage

pcbc_enc.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/des/pcbc_enc.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2void DES_pcbc_encrypt(const unsigned char *input, unsigned char *output,-
3 long length, DES_key_schedule *schedule,-
4 DES_cblock *ivec, int enc)-
5{-
6 register DES_LONG sin0, sin1, xor0, xor1, tout0, tout1;-
7 DES_LONG tin[2];-
8 const unsigned char *in;-
9 unsigned char *out, *iv;-
10-
11 in = input;-
12 out = output;-
13 iv = &(*ivec)[0];-
14-
15 if (enc
encDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
1
16 (xor0 =((DES_LONG)(*((iv)++))) , xor0|=((DES_LONG)(*((iv)++)))<< 8L, xor0|=((DES_LONG)(*((iv)++)))<<16L, xor0|=((DES_LONG)(*((iv)++)))<<24L);-
17 (xor1 =((DES_LONG)(*((iv)++))) , xor1|=((DES_LONG)(*((iv)++)))<< 8L, xor1|=((DES_LONG)(*((iv)++)))<<16L, xor1|=((DES_LONG)(*((iv)++)))<<24L);-
18 for (; length > 0
length > 0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
; length -= 8) {
1-4
19 if (length >= 8
length >= 8Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
1-3
20 (sin0 =((DES_LONG)(*((in)++))) , sin0|=((DES_LONG)(*((in)++)))<< 8L, sin0|=((DES_LONG)(*((in)++)))<<16L, sin0|=((DES_LONG)(*((in)++)))<<24L);-
21 (sin1 =((DES_LONG)(*((in)++))) , sin1|=((DES_LONG)(*((in)++)))<< 8L, sin1|=((DES_LONG)(*((in)++)))<<16L, sin1|=((DES_LONG)(*((in)++)))<<24L);-
22 }
executed 3 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else
3
23 { in+=length; sin0=sin1=0; switch (length) { case
never executed: case 8:
8:
never executed: case 8:
sin1 =((DES_LONG)(*(--(in))))<<24L; case
never executed: case 7:
7:
never executed: case 7:
code before this statement never executed: case 7:
sin1|=((DES_LONG)(*(--(in))))<<16L; case
never executed: case 6:
6:
never executed: case 6:
code before this statement never executed: case 6:
sin1|=((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
sin1|=((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:
sin0 =((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:
sin0|=((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:
sin0|=((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
sin0|=((DES_LONG)(*(--(in)))); }
executed 1 time by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
}
executed 1 time by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
;
0-1
24 tin[0] = sin0 ^ xor0;-
25 tin[1] = sin1 ^ xor1;-
26 DES_encrypt1((DES_LONG *)tin, schedule, 1);-
27 tout0 = tin[0];-
28 tout1 = tin[1];-
29 xor0 = sin0 ^ tout0;-
30 xor1 = sin1 ^ tout1;-
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 (*((out)++)=(unsigned char)(((tout1) )&0xff), *((out)++)=(unsigned char)(((tout1)>> 8L)&0xff), *((out)++)=(unsigned char)(((tout1)>>16L)&0xff), *((out)++)=(unsigned char)(((tout1)>>24L)&0xff));-
33 }
executed 4 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
4
34 }
executed 1 time by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
1
35 (xor0 =((DES_LONG)(*((iv)++))) , xor0|=((DES_LONG)(*((iv)++)))<< 8L, xor0|=((DES_LONG)(*((iv)++)))<<16L, xor0|=((DES_LONG)(*((iv)++)))<<24L);-
36 (xor1 =((DES_LONG)(*((iv)++))) , xor1|=((DES_LONG)(*((iv)++)))<< 8L, xor1|=((DES_LONG)(*((iv)++)))<<16L, xor1|=((DES_LONG)(*((iv)++)))<<24L);-
37 for (; length > 0
length > 0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
; length -= 8) {
1-4
38 (sin0 =((DES_LONG)(*((in)++))) , sin0|=((DES_LONG)(*((in)++)))<< 8L, sin0|=((DES_LONG)(*((in)++)))<<16L, sin0|=((DES_LONG)(*((in)++)))<<24L);-
39 (sin1 =((DES_LONG)(*((in)++))) , sin1|=((DES_LONG)(*((in)++)))<< 8L, sin1|=((DES_LONG)(*((in)++)))<<16L, sin1|=((DES_LONG)(*((in)++)))<<24L);-
40 tin[0] = sin0;-
41 tin[1] = sin1;-
42 DES_encrypt1((DES_LONG *)tin, schedule, 0);-
43 tout0 = tin[0] ^ xor0;-
44 tout1 = tin[1] ^ xor1;-
45 if (length >= 8
length >= 8Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
1-3
46 (*((out)++)=(unsigned char)(((tout0) )&0xff), *((out)++)=(unsigned char)(((tout0)>> 8L)&0xff), *((out)++)=(unsigned char)(((tout0)>>16L)&0xff), *((out)++)=(unsigned char)(((tout0)>>24L)&0xff));-
47 (*((out)++)=(unsigned char)(((tout1) )&0xff), *((out)++)=(unsigned char)(((tout1)>> 8L)&0xff), *((out)++)=(unsigned char)(((tout1)>>16L)&0xff), *((out)++)=(unsigned char)(((tout1)>>24L)&0xff));-
48 }
executed 3 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else
3
49 { out+=length; switch (length) { 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
}
executed 1 time by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
;
0-1
50 xor0 = tout0 ^ sin0;-
51 xor1 = tout1 ^ sin1;-
52 }
executed 4 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
4
53 }
executed 1 time by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
1
54 tin[0] = tin[1] = 0;-
55 sin0 = sin1 = xor0 = xor1 = tout0 = tout1 = 0;-
56}
executed 2 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
2
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2