OpenCoverage

ofb_enc.c

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

Generated by Squish Coco 4.2.2