OpenCoverage

ofb_enc.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/des/ofb_enc.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8void DES_ofb_encrypt(const unsigned char *in, unsigned char *out, int numbits,-
9 long length, DES_key_schedule *schedule,-
10 DES_cblock *ivec)-
11{-
12 register DES_LONG d0, d1, vv0, vv1, v0, v1, n = (numbits + 7) / 8;-
13 register DES_LONG mask0, mask1;-
14 register long l = length;-
15 register int num = numbits;-
16 DES_LONG ti[2];-
17 unsigned char *iv;-
18-
19 if (num > 64
num > 64Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-2
20 return;
never executed: return;
0
21 if (num > 32
num > 32Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-2
22 mask0 = 0xffffffffL;-
23 if (num >= 64
num >= 64Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
)
0-2
24 mask1 = mask0;
executed 2 times by 1 test: mask1 = mask0;
Executed by:
  • libcrypto.so.1.1
2
25 else-
26 mask1 = (1L << (num - 32)) - 1;
never executed: mask1 = (1L << (num - 32)) - 1;
0
27 } else {-
28 if (num == 32
num == 32Description
TRUEnever evaluated
FALSEnever evaluated
)
0
29 mask0 = 0xffffffffL;
never executed: mask0 = 0xffffffffL;
0
30 else-
31 mask0 = (1L << num) - 1;
never executed: mask0 = (1L << num) - 1;
0
32 mask1 = 0x00000000L;-
33 }
never executed: end of block
0
34-
35 iv = &(*ivec)[0];-
36 (v0 =((DES_LONG)(*((iv)++))) , v0|=((DES_LONG)(*((iv)++)))<< 8L, v0|=((DES_LONG)(*((iv)++)))<<16L, v0|=((DES_LONG)(*((iv)++)))<<24L);-
37 (v1 =((DES_LONG)(*((iv)++))) , v1|=((DES_LONG)(*((iv)++)))<< 8L, v1|=((DES_LONG)(*((iv)++)))<<16L, v1|=((DES_LONG)(*((iv)++)))<<24L);-
38 ti[0] = v0;-
39 ti[1] = v1;-
40 while (l-- > 0
l-- > 0Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
2-6
41 ti[0] = v0;-
42 ti[1] = v1;-
43 DES_encrypt1((DES_LONG *)ti, schedule, 1);-
44 vv0 = ti[0];-
45 vv1 = ti[1];-
46 { in+=n; d0=d1=0; switch (n) { case
executed 6 times by 1 test: case 8:
Executed by:
  • libcrypto.so.1.1
8:
executed 6 times by 1 test: case 8:
Executed by:
  • libcrypto.so.1.1
d1 =((DES_LONG)(*(--(in))))<<24L; case
never executed: case 7:
code before this statement executed 6 times by 1 test: case 7:
Executed by:
  • libcrypto.so.1.1
never executed: case 7:
7:
code before this statement executed 6 times by 1 test: case 7:
Executed by:
  • libcrypto.so.1.1
never executed: case 7:
d1|=((DES_LONG)(*(--(in))))<<16L; case
never executed: case 6:
code before this statement executed 6 times by 1 test: case 6:
Executed by:
  • libcrypto.so.1.1
never executed: case 6:
6:
code before this statement executed 6 times by 1 test: case 6:
Executed by:
  • libcrypto.so.1.1
never executed: case 6:
d1|=((DES_LONG)(*(--(in))))<< 8L; case
never executed: case 5:
code before this statement executed 6 times by 1 test: case 5:
Executed by:
  • libcrypto.so.1.1
never executed: case 5:
5:
code before this statement executed 6 times by 1 test: case 5:
Executed by:
  • libcrypto.so.1.1
never executed: case 5:
d1|=((DES_LONG)(*(--(in)))); case
never executed: case 4:
code before this statement executed 6 times by 1 test: case 4:
Executed by:
  • libcrypto.so.1.1
never executed: case 4:
4:
code before this statement executed 6 times by 1 test: case 4:
Executed by:
  • libcrypto.so.1.1
never executed: case 4:
d0 =((DES_LONG)(*(--(in))))<<24L; case
never executed: case 3:
code before this statement executed 6 times by 1 test: case 3:
Executed by:
  • libcrypto.so.1.1
never executed: case 3:
3:
code before this statement executed 6 times by 1 test: case 3:
Executed by:
  • libcrypto.so.1.1
never executed: case 3:
d0|=((DES_LONG)(*(--(in))))<<16L; case
never executed: case 2:
code before this statement executed 6 times by 1 test: case 2:
Executed by:
  • libcrypto.so.1.1
never executed: case 2:
2:
code before this statement executed 6 times by 1 test: case 2:
Executed by:
  • libcrypto.so.1.1
never executed: case 2:
d0|=((DES_LONG)(*(--(in))))<< 8L; case
executed 6 times by 1 test: case 1:
Executed by:
  • libcrypto.so.1.1
1:
executed 6 times by 1 test: case 1:
Executed by:
  • libcrypto.so.1.1
code before this statement executed 6 times by 1 test: case 1:
Executed by:
  • libcrypto.so.1.1
d0|=((DES_LONG)(*(--(in)))); }
executed 6 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
};
0-6
47 in += n;-
48 d0 = (d0 ^ vv0) & mask0;-
49 d1 = (d1 ^ vv1) & mask1;-
50 { out+=n; switch (n) { case
executed 6 times by 1 test: case 8:
Executed by:
  • libcrypto.so.1.1
8:
executed 6 times by 1 test: case 8:
Executed by:
  • libcrypto.so.1.1
*(--(out))=(unsigned char)(((d1)>>24L)&0xff); case
never executed: case 7:
code before this statement executed 6 times by 1 test: case 7:
Executed by:
  • libcrypto.so.1.1
never executed: case 7:
7:
code before this statement executed 6 times by 1 test: case 7:
Executed by:
  • libcrypto.so.1.1
never executed: case 7:
*(--(out))=(unsigned char)(((d1)>>16L)&0xff); case
never executed: case 6:
code before this statement executed 6 times by 1 test: case 6:
Executed by:
  • libcrypto.so.1.1
never executed: case 6:
6:
code before this statement executed 6 times by 1 test: case 6:
Executed by:
  • libcrypto.so.1.1
never executed: case 6:
*(--(out))=(unsigned char)(((d1)>> 8L)&0xff); case
never executed: case 5:
code before this statement executed 6 times by 1 test: case 5:
Executed by:
  • libcrypto.so.1.1
never executed: case 5:
5:
code before this statement executed 6 times by 1 test: case 5:
Executed by:
  • libcrypto.so.1.1
never executed: case 5:
*(--(out))=(unsigned char)(((d1) )&0xff); case
never executed: case 4:
code before this statement executed 6 times by 1 test: case 4:
Executed by:
  • libcrypto.so.1.1
never executed: case 4:
4:
code before this statement executed 6 times by 1 test: case 4:
Executed by:
  • libcrypto.so.1.1
never executed: case 4:
*(--(out))=(unsigned char)(((d0)>>24L)&0xff); case
never executed: case 3:
code before this statement executed 6 times by 1 test: case 3:
Executed by:
  • libcrypto.so.1.1
never executed: case 3:
3:
code before this statement executed 6 times by 1 test: case 3:
Executed by:
  • libcrypto.so.1.1
never executed: case 3:
*(--(out))=(unsigned char)(((d0)>>16L)&0xff); case
never executed: case 2:
code before this statement executed 6 times by 1 test: case 2:
Executed by:
  • libcrypto.so.1.1
never executed: case 2:
2:
code before this statement executed 6 times by 1 test: case 2:
Executed by:
  • libcrypto.so.1.1
never executed: case 2:
*(--(out))=(unsigned char)(((d0)>> 8L)&0xff); case
executed 6 times by 1 test: case 1:
Executed by:
  • libcrypto.so.1.1
1:
executed 6 times by 1 test: case 1:
Executed by:
  • libcrypto.so.1.1
code before this statement executed 6 times by 1 test: case 1:
Executed by:
  • libcrypto.so.1.1
*(--(out))=(unsigned char)(((d0) )&0xff); }
executed 6 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
};
0-6
51 out += n;-
52-
53 if (num == 32
num == 32Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-6
54 v0 = v1;-
55 v1 = vv0;-
56 }
never executed: end of block
else if (num == 64
num == 64Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-6
57 v0 = vv0;-
58 v1 = vv1;-
59 }
executed 6 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else if (num > 32
num > 32Description
TRUEnever evaluated
FALSEnever evaluated
) {
0-6
60 v0 = ((v1 >> (num - 32)) | (vv0 << (64 - num))) & 0xffffffffL;-
61 v1 = ((vv0 >> (num - 32)) | (vv1 << (64 - num))) & 0xffffffffL;-
62 }
never executed: end of block
else {
0
63-
64 v0 = ((v0 >> num) | (v1 << (32 - num))) & 0xffffffffL;-
65 v1 = ((v1 >> num) | (vv0 << (32 - num))) & 0xffffffffL;-
66 }
never executed: end of block
0
67 }-
68 iv = &(*ivec)[0];-
69 (*((iv)++)=(unsigned char)(((v0) )&0xff), *((iv)++)=(unsigned char)(((v0)>> 8L)&0xff), *((iv)++)=(unsigned char)(((v0)>>16L)&0xff), *((iv)++)=(unsigned char)(((v0)>>24L)&0xff));-
70 (*((iv)++)=(unsigned char)(((v1) )&0xff), *((iv)++)=(unsigned char)(((v1)>> 8L)&0xff), *((iv)++)=(unsigned char)(((v1)>>16L)&0xff), *((iv)++)=(unsigned char)(((v1)>>24L)&0xff));-
71 v0 = v1 = d0 = d1 = ti[0] = ti[1] = vv0 = vv1 = 0;-
72}
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