Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/libressl/src/crypto/des/cfb64enc.c |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||
---|---|---|---|---|---|---|---|---|
1 | - | |||||||
2 | - | |||||||
3 | - | |||||||
4 | - | |||||||
5 | - | |||||||
6 | - | |||||||
7 | void DES_cfb64_encrypt(const unsigned char *in, unsigned char *out, | - | ||||||
8 | long length, DES_key_schedule *schedule, | - | ||||||
9 | DES_cblock *ivec, int *num, int enc) | - | ||||||
10 | { | - | ||||||
11 | unsigned int v0,v1; | - | ||||||
12 | long l=length; | - | ||||||
13 | int n= *num; | - | ||||||
14 | unsigned int ti[2]; | - | ||||||
15 | unsigned char *iv,c,cc; | - | ||||||
16 | - | |||||||
17 | iv = &(*ivec)[0]; | - | ||||||
18 | if (enc
| 4 | ||||||
19 | { | - | ||||||
20 | while (l--
| 4-1800 | ||||||
21 | { | - | ||||||
22 | if (n == 0
| 225-1575 | ||||||
23 | { | - | ||||||
24 | (v0 =((unsigned int)(*((iv)++))) , v0|=((unsigned int)(*((iv)++)))<< 8L, v0|=((unsigned int)(*((iv)++)))<<16L, v0|=((unsigned int)(*((iv)++)))<<24L); ti[0]=v0; | - | ||||||
25 | (v1 =((unsigned int)(*((iv)++))) , v1|=((unsigned int)(*((iv)++)))<< 8L, v1|=((unsigned int)(*((iv)++)))<<16L, v1|=((unsigned int)(*((iv)++)))<<24L); ti[1]=v1; | - | ||||||
26 | DES_encrypt1(ti,schedule,1); | - | ||||||
27 | iv = &(*ivec)[0]; | - | ||||||
28 | v0=ti[0]; (*((iv)++)=(unsigned char)(((v0) )&0xff), *((iv)++)=(unsigned char)(((v0)>> 8L)&0xff), *((iv)++)=(unsigned char)(((v0)>>16L)&0xff), *((iv)++)=(unsigned char)(((v0)>>24L)&0xff)); | - | ||||||
29 | v0=ti[1]; (*((iv)++)=(unsigned char)(((v0) )&0xff), *((iv)++)=(unsigned char)(((v0)>> 8L)&0xff), *((iv)++)=(unsigned char)(((v0)>>16L)&0xff), *((iv)++)=(unsigned char)(((v0)>>24L)&0xff)); | - | ||||||
30 | iv = &(*ivec)[0]; | - | ||||||
31 | } executed 225 times by 2 tests: end of block Executed by:
| 225 | ||||||
32 | c= *(in++)^iv[n]; | - | ||||||
33 | *(out++)=c; | - | ||||||
34 | iv[n]=c; | - | ||||||
35 | n=(n+1)&0x07; | - | ||||||
36 | } executed 1800 times by 2 tests: end of block Executed by:
| 1800 | ||||||
37 | } executed 4 times by 2 tests: end of block Executed by:
| 4 | ||||||
38 | else | - | ||||||
39 | { | - | ||||||
40 | while (l--
| 4-1800 | ||||||
41 | { | - | ||||||
42 | if (n == 0
| 225-1575 | ||||||
43 | { | - | ||||||
44 | (v0 =((unsigned int)(*((iv)++))) , v0|=((unsigned int)(*((iv)++)))<< 8L, v0|=((unsigned int)(*((iv)++)))<<16L, v0|=((unsigned int)(*((iv)++)))<<24L); ti[0]=v0; | - | ||||||
45 | (v1 =((unsigned int)(*((iv)++))) , v1|=((unsigned int)(*((iv)++)))<< 8L, v1|=((unsigned int)(*((iv)++)))<<16L, v1|=((unsigned int)(*((iv)++)))<<24L); ti[1]=v1; | - | ||||||
46 | DES_encrypt1(ti,schedule,1); | - | ||||||
47 | iv = &(*ivec)[0]; | - | ||||||
48 | v0=ti[0]; (*((iv)++)=(unsigned char)(((v0) )&0xff), *((iv)++)=(unsigned char)(((v0)>> 8L)&0xff), *((iv)++)=(unsigned char)(((v0)>>16L)&0xff), *((iv)++)=(unsigned char)(((v0)>>24L)&0xff)); | - | ||||||
49 | v0=ti[1]; (*((iv)++)=(unsigned char)(((v0) )&0xff), *((iv)++)=(unsigned char)(((v0)>> 8L)&0xff), *((iv)++)=(unsigned char)(((v0)>>16L)&0xff), *((iv)++)=(unsigned char)(((v0)>>24L)&0xff)); | - | ||||||
50 | iv = &(*ivec)[0]; | - | ||||||
51 | } executed 225 times by 2 tests: end of block Executed by:
| 225 | ||||||
52 | cc= *(in++); | - | ||||||
53 | c=iv[n]; | - | ||||||
54 | iv[n]=cc; | - | ||||||
55 | *(out++)=c^cc; | - | ||||||
56 | n=(n+1)&0x07; | - | ||||||
57 | } executed 1800 times by 2 tests: end of block Executed by:
| 1800 | ||||||
58 | } executed 4 times by 2 tests: end of block Executed by:
| 4 | ||||||
59 | v0=v1=ti[0]=ti[1]=c=cc=0; | - | ||||||
60 | *num=n; | - | ||||||
61 | } executed 8 times by 2 tests: end of block Executed by:
| 8 | ||||||
Switch to Source code | Preprocessed file |