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