Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/des/ncbc_enc.c |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||
---|---|---|---|---|---|---|---|---|
1 | void DES_ncbc_encrypt(const unsigned char *in, unsigned char *out, | - | ||||||
2 | long length, DES_key_schedule *_schedule, | - | ||||||
3 | DES_cblock *ivec, int enc) | - | ||||||
4 | - | |||||||
5 | { | - | ||||||
6 | register DES_LONG tin0, tin1; | - | ||||||
7 | register DES_LONG tout0, tout1, xor0, xor1; | - | ||||||
8 | register long l = length; | - | ||||||
9 | DES_LONG tin[2]; | - | ||||||
10 | unsigned char *iv; | - | ||||||
11 | - | |||||||
12 | iv = &(*ivec)[0]; | - | ||||||
13 | - | |||||||
14 | if (enc
| 107-161 | ||||||
15 | (tout0 =((DES_LONG)(*((iv)++))) , tout0|=((DES_LONG)(*((iv)++)))<< 8L, tout0|=((DES_LONG)(*((iv)++)))<<16L, tout0|=((DES_LONG)(*((iv)++)))<<24L); | - | ||||||
16 | (tout1 =((DES_LONG)(*((iv)++))) , tout1|=((DES_LONG)(*((iv)++)))<< 8L, tout1|=((DES_LONG)(*((iv)++)))<<16L, tout1|=((DES_LONG)(*((iv)++)))<<24L); | - | ||||||
17 | for (l -= 8; l >= 0
| 161-1599 | ||||||
18 | (tin0 =((DES_LONG)(*((in)++))) , tin0|=((DES_LONG)(*((in)++)))<< 8L, tin0|=((DES_LONG)(*((in)++)))<<16L, tin0|=((DES_LONG)(*((in)++)))<<24L); | - | ||||||
19 | (tin1 =((DES_LONG)(*((in)++))) , tin1|=((DES_LONG)(*((in)++)))<< 8L, tin1|=((DES_LONG)(*((in)++)))<<16L, tin1|=((DES_LONG)(*((in)++)))<<24L); | - | ||||||
20 | tin0 ^= tout0; | - | ||||||
21 | tin[0] = tin0; | - | ||||||
22 | tin1 ^= tout1; | - | ||||||
23 | tin[1] = tin1; | - | ||||||
24 | DES_encrypt1((DES_LONG *)tin, _schedule, 1); | - | ||||||
25 | tout0 = tin[0]; | - | ||||||
26 | (*((out)++)=(unsigned char)(((tout0) )&0xff), *((out)++)=(unsigned char)(((tout0)>> 8L)&0xff), *((out)++)=(unsigned char)(((tout0)>>16L)&0xff), *((out)++)=(unsigned char)(((tout0)>>24L)&0xff)); | - | ||||||
27 | tout1 = tin[1]; | - | ||||||
28 | (*((out)++)=(unsigned char)(((tout1) )&0xff), *((out)++)=(unsigned char)(((tout1)>> 8L)&0xff), *((out)++)=(unsigned char)(((tout1)>>16L)&0xff), *((out)++)=(unsigned char)(((tout1)>>24L)&0xff)); | - | ||||||
29 | } executed 1599 times by 1 test: end of block Executed by:
| 1599 | ||||||
30 | if (l != -8
| 9-152 | ||||||
31 | { in+=l + 8; tin0=tin1=0; switch (l + 8) { case never executed: 8:case 8: never executed: tin1 =((DES_LONG)(*(--(in))))<<24L; casecase 8: never executed: 7:case 7: never executed: case 7: code before this statement never executed: tin1|=((DES_LONG)(*(--(in))))<<16L; casecase 7: never executed: 6:case 6: never executed: case 6: code before this statement never executed: tin1|=((DES_LONG)(*(--(in))))<< 8L; casecase 6: executed 6 times by 1 test: case 5: Executed by:
code before this statement never executed: case 5: executed 6 times by 1 test: 5:case 5: Executed by:
code before this statement never executed: case 5: executed 6 times by 1 test: tin1|=((DES_LONG)(*(--(in)))); casecase 5: Executed by:
executed 1 time by 1 test: 4:case 4: Executed by:
executed 1 time by 1 test: case 4: Executed by:
code before this statement executed 6 times by 1 test: tin0 =((DES_LONG)(*(--(in))))<<24L; casecase 4: Executed by:
executed 1 time by 1 test: 3:case 3: Executed by:
executed 1 time by 1 test: case 3: Executed by:
code before this statement executed 7 times by 1 test: tin0|=((DES_LONG)(*(--(in))))<<16L; casecase 3: Executed by:
executed 1 time by 1 test: 2:case 2: Executed by:
executed 1 time by 1 test: case 2: Executed by:
code before this statement executed 8 times by 1 test: tin0|=((DES_LONG)(*(--(in))))<< 8L; casecase 2: Executed by:
executed 9 times by 1 test: 1:case 1: Executed by:
executed 9 times by 1 test: case 1: Executed by:
code before this statement executed 9 times by 1 test: tin0|=((DES_LONG)(*(--(in)))); }case 1: Executed by:
executed 9 times by 1 test: };end of block Executed by:
| 0-9 | ||||||
32 | tin0 ^= tout0; | - | ||||||
33 | tin[0] = tin0; | - | ||||||
34 | tin1 ^= tout1; | - | ||||||
35 | tin[1] = tin1; | - | ||||||
36 | DES_encrypt1((DES_LONG *)tin, _schedule, 1); | - | ||||||
37 | tout0 = tin[0]; | - | ||||||
38 | (*((out)++)=(unsigned char)(((tout0) )&0xff), *((out)++)=(unsigned char)(((tout0)>> 8L)&0xff), *((out)++)=(unsigned char)(((tout0)>>16L)&0xff), *((out)++)=(unsigned char)(((tout0)>>24L)&0xff)); | - | ||||||
39 | tout1 = tin[1]; | - | ||||||
40 | (*((out)++)=(unsigned char)(((tout1) )&0xff), *((out)++)=(unsigned char)(((tout1)>> 8L)&0xff), *((out)++)=(unsigned char)(((tout1)>>16L)&0xff), *((out)++)=(unsigned char)(((tout1)>>24L)&0xff)); | - | ||||||
41 | } executed 9 times by 1 test: end of block Executed by:
| 9 | ||||||
42 | - | |||||||
43 | iv = &(*ivec)[0]; | - | ||||||
44 | (*((iv)++)=(unsigned char)(((tout0) )&0xff), *((iv)++)=(unsigned char)(((tout0)>> 8L)&0xff), *((iv)++)=(unsigned char)(((tout0)>>16L)&0xff), *((iv)++)=(unsigned char)(((tout0)>>24L)&0xff)); | - | ||||||
45 | (*((iv)++)=(unsigned char)(((tout1) )&0xff), *((iv)++)=(unsigned char)(((tout1)>> 8L)&0xff), *((iv)++)=(unsigned char)(((tout1)>>16L)&0xff), *((iv)++)=(unsigned char)(((tout1)>>24L)&0xff)); | - | ||||||
46 | - | |||||||
47 | } executed 161 times by 1 test: else {end of block Executed by:
| 161 | ||||||
48 | (xor0 =((DES_LONG)(*((iv)++))) , xor0|=((DES_LONG)(*((iv)++)))<< 8L, xor0|=((DES_LONG)(*((iv)++)))<<16L, xor0|=((DES_LONG)(*((iv)++)))<<24L); | - | ||||||
49 | (xor1 =((DES_LONG)(*((iv)++))) , xor1|=((DES_LONG)(*((iv)++)))<< 8L, xor1|=((DES_LONG)(*((iv)++)))<<16L, xor1|=((DES_LONG)(*((iv)++)))<<24L); | - | ||||||
50 | for (l -= 8; l >= 0
| 107-1575 | ||||||
51 | (tin0 =((DES_LONG)(*((in)++))) , tin0|=((DES_LONG)(*((in)++)))<< 8L, tin0|=((DES_LONG)(*((in)++)))<<16L, tin0|=((DES_LONG)(*((in)++)))<<24L); | - | ||||||
52 | tin[0] = tin0; | - | ||||||
53 | (tin1 =((DES_LONG)(*((in)++))) , tin1|=((DES_LONG)(*((in)++)))<< 8L, tin1|=((DES_LONG)(*((in)++)))<<16L, tin1|=((DES_LONG)(*((in)++)))<<24L); | - | ||||||
54 | tin[1] = tin1; | - | ||||||
55 | DES_encrypt1((DES_LONG *)tin, _schedule, 0); | - | ||||||
56 | tout0 = tin[0] ^ xor0; | - | ||||||
57 | tout1 = tin[1] ^ xor1; | - | ||||||
58 | (*((out)++)=(unsigned char)(((tout0) )&0xff), *((out)++)=(unsigned char)(((tout0)>> 8L)&0xff), *((out)++)=(unsigned char)(((tout0)>>16L)&0xff), *((out)++)=(unsigned char)(((tout0)>>24L)&0xff)); | - | ||||||
59 | (*((out)++)=(unsigned char)(((tout1) )&0xff), *((out)++)=(unsigned char)(((tout1)>> 8L)&0xff), *((out)++)=(unsigned char)(((tout1)>>16L)&0xff), *((out)++)=(unsigned char)(((tout1)>>24L)&0xff)); | - | ||||||
60 | xor0 = tin0; | - | ||||||
61 | xor1 = tin1; | - | ||||||
62 | } executed 1575 times by 1 test: end of block Executed by:
| 1575 | ||||||
63 | if (l != -8
| 1-106 | ||||||
64 | (tin0 =((DES_LONG)(*((in)++))) , tin0|=((DES_LONG)(*((in)++)))<< 8L, tin0|=((DES_LONG)(*((in)++)))<<16L, tin0|=((DES_LONG)(*((in)++)))<<24L); | - | ||||||
65 | tin[0] = tin0; | - | ||||||
66 | (tin1 =((DES_LONG)(*((in)++))) , tin1|=((DES_LONG)(*((in)++)))<< 8L, tin1|=((DES_LONG)(*((in)++)))<<16L, tin1|=((DES_LONG)(*((in)++)))<<24L); | - | ||||||
67 | tin[1] = tin1; | - | ||||||
68 | DES_encrypt1((DES_LONG *)tin, _schedule, 0); | - | ||||||
69 | tout0 = tin[0] ^ xor0; | - | ||||||
70 | tout1 = tin[1] ^ xor1; | - | ||||||
71 | { out+=l + 8; switch (l + 8) { case never executed: 8:case 8: never executed: *(--(out))=(unsigned char)(((tout1)>>24L)&0xff); casecase 8: never executed: 7:case 7: never executed: case 7: code before this statement never executed: *(--(out))=(unsigned char)(((tout1)>>16L)&0xff); casecase 7: never executed: 6:case 6: never executed: case 6: code before this statement never executed: *(--(out))=(unsigned char)(((tout1)>> 8L)&0xff); casecase 6: executed 1 time by 1 test: case 5: Executed by:
code before this statement never executed: case 5: executed 1 time by 1 test: 5:case 5: Executed by:
code before this statement never executed: case 5: executed 1 time by 1 test: *(--(out))=(unsigned char)(((tout1) )&0xff); casecase 5: Executed by:
never executed: case 4: code before this statement executed 1 time by 1 test: case 4: Executed by:
never executed: 4:case 4: code before this statement executed 1 time by 1 test: case 4: Executed by:
never executed: *(--(out))=(unsigned char)(((tout0)>>24L)&0xff); casecase 4: never executed: case 3: code before this statement executed 1 time by 1 test: case 3: Executed by:
never executed: 3:case 3: code before this statement executed 1 time by 1 test: case 3: Executed by:
never executed: *(--(out))=(unsigned char)(((tout0)>>16L)&0xff); casecase 3: never executed: case 2: code before this statement executed 1 time by 1 test: case 2: Executed by:
never executed: 2:case 2: code before this statement executed 1 time by 1 test: case 2: Executed by:
never executed: *(--(out))=(unsigned char)(((tout0)>> 8L)&0xff); casecase 2: executed 1 time by 1 test: 1:case 1: Executed by:
executed 1 time by 1 test: case 1: Executed by:
code before this statement executed 1 time by 1 test: *(--(out))=(unsigned char)(((tout0) )&0xff); }case 1: Executed by:
executed 1 time by 1 test: };end of block Executed by:
| 0-1 | ||||||
72 | - | |||||||
73 | xor0 = tin0; | - | ||||||
74 | xor1 = tin1; | - | ||||||
75 | - | |||||||
76 | } executed 1 time by 1 test: end of block Executed by:
| 1 | ||||||
77 | - | |||||||
78 | iv = &(*ivec)[0]; | - | ||||||
79 | (*((iv)++)=(unsigned char)(((xor0) )&0xff), *((iv)++)=(unsigned char)(((xor0)>> 8L)&0xff), *((iv)++)=(unsigned char)(((xor0)>>16L)&0xff), *((iv)++)=(unsigned char)(((xor0)>>24L)&0xff)); | - | ||||||
80 | (*((iv)++)=(unsigned char)(((xor1) )&0xff), *((iv)++)=(unsigned char)(((xor1)>> 8L)&0xff), *((iv)++)=(unsigned char)(((xor1)>>16L)&0xff), *((iv)++)=(unsigned char)(((xor1)>>24L)&0xff)); | - | ||||||
81 | - | |||||||
82 | } executed 107 times by 1 test: end of block Executed by:
| 107 | ||||||
83 | tin0 = tin1 = tout0 = tout1 = xor0 = xor1 = 0; | - | ||||||
84 | tin[0] = tin[1] = 0; | - | ||||||
85 | } executed 268 times by 1 test: end of block Executed by:
| 268 | ||||||
Switch to Source code | Preprocessed file |