Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/cast/c_enc.c |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||
---|---|---|---|---|---|---|---|---|
1 | - | |||||||
2 | void CAST_encrypt(unsigned int *data, const CAST_KEY *key) | - | ||||||
3 | { | - | ||||||
4 | unsigned int l, r, t; | - | ||||||
5 | const unsigned int *k; | - | ||||||
6 | - | |||||||
7 | k = &(key->data[0]); | - | ||||||
8 | l = data[0]; | - | ||||||
9 | r = data[1]; | - | ||||||
10 | - | |||||||
11 | { unsigned int a,b,c,d; t=(k[0*2] + r)&0xffffffff; t=((((t)<<((k[0*2+1])))&0xffffffffL)|((t)>>((32-((k[0*2+1])))&31))); a=CAST_S_table0[(t>> 8)&0xff]; b=CAST_S_table1[(t )&0xff]; c=CAST_S_table2[(t>>24)&0xff]; d=CAST_S_table3[(t>>16)&0xff]; l^=(((((a ^ b)&0xffffffffL) - c)&0xffffffffL) + d)&0xffffffffL; }; | - | ||||||
12 | { unsigned int a,b,c,d; t=(k[1*2] ^ l)&0xffffffff; t=((((t)<<((k[1*2+1])))&0xffffffffL)|((t)>>((32-((k[1*2+1])))&31))); a=CAST_S_table0[(t>> 8)&0xff]; b=CAST_S_table1[(t )&0xff]; c=CAST_S_table2[(t>>24)&0xff]; d=CAST_S_table3[(t>>16)&0xff]; r^=(((((a - b)&0xffffffffL) + c)&0xffffffffL) ^ d)&0xffffffffL; }; | - | ||||||
13 | { unsigned int a,b,c,d; t=(k[2*2] - r)&0xffffffff; t=((((t)<<((k[2*2+1])))&0xffffffffL)|((t)>>((32-((k[2*2+1])))&31))); a=CAST_S_table0[(t>> 8)&0xff]; b=CAST_S_table1[(t )&0xff]; c=CAST_S_table2[(t>>24)&0xff]; d=CAST_S_table3[(t>>16)&0xff]; l^=(((((a + b)&0xffffffffL) ^ c)&0xffffffffL) - d)&0xffffffffL; }; | - | ||||||
14 | { unsigned int a,b,c,d; t=(k[3*2] + l)&0xffffffff; t=((((t)<<((k[3*2+1])))&0xffffffffL)|((t)>>((32-((k[3*2+1])))&31))); a=CAST_S_table0[(t>> 8)&0xff]; b=CAST_S_table1[(t )&0xff]; c=CAST_S_table2[(t>>24)&0xff]; d=CAST_S_table3[(t>>16)&0xff]; r^=(((((a ^ b)&0xffffffffL) - c)&0xffffffffL) + d)&0xffffffffL; }; | - | ||||||
15 | { unsigned int a,b,c,d; t=(k[4*2] ^ r)&0xffffffff; t=((((t)<<((k[4*2+1])))&0xffffffffL)|((t)>>((32-((k[4*2+1])))&31))); a=CAST_S_table0[(t>> 8)&0xff]; b=CAST_S_table1[(t )&0xff]; c=CAST_S_table2[(t>>24)&0xff]; d=CAST_S_table3[(t>>16)&0xff]; l^=(((((a - b)&0xffffffffL) + c)&0xffffffffL) ^ d)&0xffffffffL; }; | - | ||||||
16 | { unsigned int a,b,c,d; t=(k[5*2] - l)&0xffffffff; t=((((t)<<((k[5*2+1])))&0xffffffffL)|((t)>>((32-((k[5*2+1])))&31))); a=CAST_S_table0[(t>> 8)&0xff]; b=CAST_S_table1[(t )&0xff]; c=CAST_S_table2[(t>>24)&0xff]; d=CAST_S_table3[(t>>16)&0xff]; r^=(((((a + b)&0xffffffffL) ^ c)&0xffffffffL) - d)&0xffffffffL; }; | - | ||||||
17 | { unsigned int a,b,c,d; t=(k[6*2] + r)&0xffffffff; t=((((t)<<((k[6*2+1])))&0xffffffffL)|((t)>>((32-((k[6*2+1])))&31))); a=CAST_S_table0[(t>> 8)&0xff]; b=CAST_S_table1[(t )&0xff]; c=CAST_S_table2[(t>>24)&0xff]; d=CAST_S_table3[(t>>16)&0xff]; l^=(((((a ^ b)&0xffffffffL) - c)&0xffffffffL) + d)&0xffffffffL; }; | - | ||||||
18 | { unsigned int a,b,c,d; t=(k[7*2] ^ l)&0xffffffff; t=((((t)<<((k[7*2+1])))&0xffffffffL)|((t)>>((32-((k[7*2+1])))&31))); a=CAST_S_table0[(t>> 8)&0xff]; b=CAST_S_table1[(t )&0xff]; c=CAST_S_table2[(t>>24)&0xff]; d=CAST_S_table3[(t>>16)&0xff]; r^=(((((a - b)&0xffffffffL) + c)&0xffffffffL) ^ d)&0xffffffffL; }; | - | ||||||
19 | { unsigned int a,b,c,d; t=(k[8*2] - r)&0xffffffff; t=((((t)<<((k[8*2+1])))&0xffffffffL)|((t)>>((32-((k[8*2+1])))&31))); a=CAST_S_table0[(t>> 8)&0xff]; b=CAST_S_table1[(t )&0xff]; c=CAST_S_table2[(t>>24)&0xff]; d=CAST_S_table3[(t>>16)&0xff]; l^=(((((a + b)&0xffffffffL) ^ c)&0xffffffffL) - d)&0xffffffffL; }; | - | ||||||
20 | { unsigned int a,b,c,d; t=(k[9*2] + l)&0xffffffff; t=((((t)<<((k[9*2+1])))&0xffffffffL)|((t)>>((32-((k[9*2+1])))&31))); a=CAST_S_table0[(t>> 8)&0xff]; b=CAST_S_table1[(t )&0xff]; c=CAST_S_table2[(t>>24)&0xff]; d=CAST_S_table3[(t>>16)&0xff]; r^=(((((a ^ b)&0xffffffffL) - c)&0xffffffffL) + d)&0xffffffffL; }; | - | ||||||
21 | { unsigned int a,b,c,d; t=(k[10*2] ^ r)&0xffffffff; t=((((t)<<((k[10*2+1])))&0xffffffffL)|((t)>>((32-((k[10*2+1])))&31))); a=CAST_S_table0[(t>> 8)&0xff]; b=CAST_S_table1[(t )&0xff]; c=CAST_S_table2[(t>>24)&0xff]; d=CAST_S_table3[(t>>16)&0xff]; l^=(((((a - b)&0xffffffffL) + c)&0xffffffffL) ^ d)&0xffffffffL; }; | - | ||||||
22 | { unsigned int a,b,c,d; t=(k[11*2] - l)&0xffffffff; t=((((t)<<((k[11*2+1])))&0xffffffffL)|((t)>>((32-((k[11*2+1])))&31))); a=CAST_S_table0[(t>> 8)&0xff]; b=CAST_S_table1[(t )&0xff]; c=CAST_S_table2[(t>>24)&0xff]; d=CAST_S_table3[(t>>16)&0xff]; r^=(((((a + b)&0xffffffffL) ^ c)&0xffffffffL) - d)&0xffffffffL; }; | - | ||||||
23 | if (!key->short_key
| 2-4006285 | ||||||
24 | { unsigned int a,b,c,d; t=(k[12*2] + r)&0xffffffff; t=((((t)<<((k[12*2+1])))&0xffffffffL)|((t)>>((32-((k[12*2+1])))&31))); a=CAST_S_table0[(t>> 8)&0xff]; b=CAST_S_table1[(t )&0xff]; c=CAST_S_table2[(t>>24)&0xff]; d=CAST_S_table3[(t>>16)&0xff]; l^=(((((a ^ b)&0xffffffffL) - c)&0xffffffffL) + d)&0xffffffffL; }; | - | ||||||
25 | { unsigned int a,b,c,d; t=(k[13*2] ^ l)&0xffffffff; t=((((t)<<((k[13*2+1])))&0xffffffffL)|((t)>>((32-((k[13*2+1])))&31))); a=CAST_S_table0[(t>> 8)&0xff]; b=CAST_S_table1[(t )&0xff]; c=CAST_S_table2[(t>>24)&0xff]; d=CAST_S_table3[(t>>16)&0xff]; r^=(((((a - b)&0xffffffffL) + c)&0xffffffffL) ^ d)&0xffffffffL; }; | - | ||||||
26 | { unsigned int a,b,c,d; t=(k[14*2] - r)&0xffffffff; t=((((t)<<((k[14*2+1])))&0xffffffffL)|((t)>>((32-((k[14*2+1])))&31))); a=CAST_S_table0[(t>> 8)&0xff]; b=CAST_S_table1[(t )&0xff]; c=CAST_S_table2[(t>>24)&0xff]; d=CAST_S_table3[(t>>16)&0xff]; l^=(((((a + b)&0xffffffffL) ^ c)&0xffffffffL) - d)&0xffffffffL; }; | - | ||||||
27 | { unsigned int a,b,c,d; t=(k[15*2] + l)&0xffffffff; t=((((t)<<((k[15*2+1])))&0xffffffffL)|((t)>>((32-((k[15*2+1])))&31))); a=CAST_S_table0[(t>> 8)&0xff]; b=CAST_S_table1[(t )&0xff]; c=CAST_S_table2[(t>>24)&0xff]; d=CAST_S_table3[(t>>16)&0xff]; r^=(((((a ^ b)&0xffffffffL) - c)&0xffffffffL) + d)&0xffffffffL; }; | - | ||||||
28 | } executed 4006285 times by 1 test: end of block Executed by:
| 4006285 | ||||||
29 | - | |||||||
30 | data[1] = l & 0xffffffffL; | - | ||||||
31 | data[0] = r & 0xffffffffL; | - | ||||||
32 | } executed 4006287 times by 1 test: end of block Executed by:
| 4006287 | ||||||
33 | - | |||||||
34 | void CAST_decrypt(unsigned int *data, const CAST_KEY *key) | - | ||||||
35 | { | - | ||||||
36 | unsigned int l, r, t; | - | ||||||
37 | const unsigned int *k; | - | ||||||
38 | - | |||||||
39 | k = &(key->data[0]); | - | ||||||
40 | l = data[0]; | - | ||||||
41 | r = data[1]; | - | ||||||
42 | - | |||||||
43 | if (!key->short_key
| 2-3145 | ||||||
44 | { unsigned int a,b,c,d; t=(k[15*2] + r)&0xffffffff; t=((((t)<<((k[15*2+1])))&0xffffffffL)|((t)>>((32-((k[15*2+1])))&31))); a=CAST_S_table0[(t>> 8)&0xff]; b=CAST_S_table1[(t )&0xff]; c=CAST_S_table2[(t>>24)&0xff]; d=CAST_S_table3[(t>>16)&0xff]; l^=(((((a ^ b)&0xffffffffL) - c)&0xffffffffL) + d)&0xffffffffL; }; | - | ||||||
45 | { unsigned int a,b,c,d; t=(k[14*2] - l)&0xffffffff; t=((((t)<<((k[14*2+1])))&0xffffffffL)|((t)>>((32-((k[14*2+1])))&31))); a=CAST_S_table0[(t>> 8)&0xff]; b=CAST_S_table1[(t )&0xff]; c=CAST_S_table2[(t>>24)&0xff]; d=CAST_S_table3[(t>>16)&0xff]; r^=(((((a + b)&0xffffffffL) ^ c)&0xffffffffL) - d)&0xffffffffL; }; | - | ||||||
46 | { unsigned int a,b,c,d; t=(k[13*2] ^ r)&0xffffffff; t=((((t)<<((k[13*2+1])))&0xffffffffL)|((t)>>((32-((k[13*2+1])))&31))); a=CAST_S_table0[(t>> 8)&0xff]; b=CAST_S_table1[(t )&0xff]; c=CAST_S_table2[(t>>24)&0xff]; d=CAST_S_table3[(t>>16)&0xff]; l^=(((((a - b)&0xffffffffL) + c)&0xffffffffL) ^ d)&0xffffffffL; }; | - | ||||||
47 | { unsigned int a,b,c,d; t=(k[12*2] + l)&0xffffffff; t=((((t)<<((k[12*2+1])))&0xffffffffL)|((t)>>((32-((k[12*2+1])))&31))); a=CAST_S_table0[(t>> 8)&0xff]; b=CAST_S_table1[(t )&0xff]; c=CAST_S_table2[(t>>24)&0xff]; d=CAST_S_table3[(t>>16)&0xff]; r^=(((((a ^ b)&0xffffffffL) - c)&0xffffffffL) + d)&0xffffffffL; }; | - | ||||||
48 | } executed 3145 times by 1 test: end of block Executed by:
| 3145 | ||||||
49 | { unsigned int a,b,c,d; t=(k[11*2] - r)&0xffffffff; t=((((t)<<((k[11*2+1])))&0xffffffffL)|((t)>>((32-((k[11*2+1])))&31))); a=CAST_S_table0[(t>> 8)&0xff]; b=CAST_S_table1[(t )&0xff]; c=CAST_S_table2[(t>>24)&0xff]; d=CAST_S_table3[(t>>16)&0xff]; l^=(((((a + b)&0xffffffffL) ^ c)&0xffffffffL) - d)&0xffffffffL; }; | - | ||||||
50 | { unsigned int a,b,c,d; t=(k[10*2] ^ l)&0xffffffff; t=((((t)<<((k[10*2+1])))&0xffffffffL)|((t)>>((32-((k[10*2+1])))&31))); a=CAST_S_table0[(t>> 8)&0xff]; b=CAST_S_table1[(t )&0xff]; c=CAST_S_table2[(t>>24)&0xff]; d=CAST_S_table3[(t>>16)&0xff]; r^=(((((a - b)&0xffffffffL) + c)&0xffffffffL) ^ d)&0xffffffffL; }; | - | ||||||
51 | { unsigned int a,b,c,d; t=(k[9*2] + r)&0xffffffff; t=((((t)<<((k[9*2+1])))&0xffffffffL)|((t)>>((32-((k[9*2+1])))&31))); a=CAST_S_table0[(t>> 8)&0xff]; b=CAST_S_table1[(t )&0xff]; c=CAST_S_table2[(t>>24)&0xff]; d=CAST_S_table3[(t>>16)&0xff]; l^=(((((a ^ b)&0xffffffffL) - c)&0xffffffffL) + d)&0xffffffffL; }; | - | ||||||
52 | { unsigned int a,b,c,d; t=(k[8*2] - l)&0xffffffff; t=((((t)<<((k[8*2+1])))&0xffffffffL)|((t)>>((32-((k[8*2+1])))&31))); a=CAST_S_table0[(t>> 8)&0xff]; b=CAST_S_table1[(t )&0xff]; c=CAST_S_table2[(t>>24)&0xff]; d=CAST_S_table3[(t>>16)&0xff]; r^=(((((a + b)&0xffffffffL) ^ c)&0xffffffffL) - d)&0xffffffffL; }; | - | ||||||
53 | { unsigned int a,b,c,d; t=(k[7*2] ^ r)&0xffffffff; t=((((t)<<((k[7*2+1])))&0xffffffffL)|((t)>>((32-((k[7*2+1])))&31))); a=CAST_S_table0[(t>> 8)&0xff]; b=CAST_S_table1[(t )&0xff]; c=CAST_S_table2[(t>>24)&0xff]; d=CAST_S_table3[(t>>16)&0xff]; l^=(((((a - b)&0xffffffffL) + c)&0xffffffffL) ^ d)&0xffffffffL; }; | - | ||||||
54 | { unsigned int a,b,c,d; t=(k[6*2] + l)&0xffffffff; t=((((t)<<((k[6*2+1])))&0xffffffffL)|((t)>>((32-((k[6*2+1])))&31))); a=CAST_S_table0[(t>> 8)&0xff]; b=CAST_S_table1[(t )&0xff]; c=CAST_S_table2[(t>>24)&0xff]; d=CAST_S_table3[(t>>16)&0xff]; r^=(((((a ^ b)&0xffffffffL) - c)&0xffffffffL) + d)&0xffffffffL; }; | - | ||||||
55 | { unsigned int a,b,c,d; t=(k[5*2] - r)&0xffffffff; t=((((t)<<((k[5*2+1])))&0xffffffffL)|((t)>>((32-((k[5*2+1])))&31))); a=CAST_S_table0[(t>> 8)&0xff]; b=CAST_S_table1[(t )&0xff]; c=CAST_S_table2[(t>>24)&0xff]; d=CAST_S_table3[(t>>16)&0xff]; l^=(((((a + b)&0xffffffffL) ^ c)&0xffffffffL) - d)&0xffffffffL; }; | - | ||||||
56 | { unsigned int a,b,c,d; t=(k[4*2] ^ l)&0xffffffff; t=((((t)<<((k[4*2+1])))&0xffffffffL)|((t)>>((32-((k[4*2+1])))&31))); a=CAST_S_table0[(t>> 8)&0xff]; b=CAST_S_table1[(t )&0xff]; c=CAST_S_table2[(t>>24)&0xff]; d=CAST_S_table3[(t>>16)&0xff]; r^=(((((a - b)&0xffffffffL) + c)&0xffffffffL) ^ d)&0xffffffffL; }; | - | ||||||
57 | { unsigned int a,b,c,d; t=(k[3*2] + r)&0xffffffff; t=((((t)<<((k[3*2+1])))&0xffffffffL)|((t)>>((32-((k[3*2+1])))&31))); a=CAST_S_table0[(t>> 8)&0xff]; b=CAST_S_table1[(t )&0xff]; c=CAST_S_table2[(t>>24)&0xff]; d=CAST_S_table3[(t>>16)&0xff]; l^=(((((a ^ b)&0xffffffffL) - c)&0xffffffffL) + d)&0xffffffffL; }; | - | ||||||
58 | { unsigned int a,b,c,d; t=(k[2*2] - l)&0xffffffff; t=((((t)<<((k[2*2+1])))&0xffffffffL)|((t)>>((32-((k[2*2+1])))&31))); a=CAST_S_table0[(t>> 8)&0xff]; b=CAST_S_table1[(t )&0xff]; c=CAST_S_table2[(t>>24)&0xff]; d=CAST_S_table3[(t>>16)&0xff]; r^=(((((a + b)&0xffffffffL) ^ c)&0xffffffffL) - d)&0xffffffffL; }; | - | ||||||
59 | { unsigned int a,b,c,d; t=(k[1*2] ^ r)&0xffffffff; t=((((t)<<((k[1*2+1])))&0xffffffffL)|((t)>>((32-((k[1*2+1])))&31))); a=CAST_S_table0[(t>> 8)&0xff]; b=CAST_S_table1[(t )&0xff]; c=CAST_S_table2[(t>>24)&0xff]; d=CAST_S_table3[(t>>16)&0xff]; l^=(((((a - b)&0xffffffffL) + c)&0xffffffffL) ^ d)&0xffffffffL; }; | - | ||||||
60 | { unsigned int a,b,c,d; t=(k[0*2] + l)&0xffffffff; t=((((t)<<((k[0*2+1])))&0xffffffffL)|((t)>>((32-((k[0*2+1])))&31))); a=CAST_S_table0[(t>> 8)&0xff]; b=CAST_S_table1[(t )&0xff]; c=CAST_S_table2[(t>>24)&0xff]; d=CAST_S_table3[(t>>16)&0xff]; r^=(((((a ^ b)&0xffffffffL) - c)&0xffffffffL) + d)&0xffffffffL; }; | - | ||||||
61 | - | |||||||
62 | data[1] = l & 0xffffffffL; | - | ||||||
63 | data[0] = r & 0xffffffffL; | - | ||||||
64 | } executed 3147 times by 1 test: end of block Executed by:
| 3147 | ||||||
65 | - | |||||||
66 | void CAST_cbc_encrypt(const unsigned char *in, unsigned char *out, | - | ||||||
67 | long length, const CAST_KEY *ks, unsigned char *iv, | - | ||||||
68 | int enc) | - | ||||||
69 | { | - | ||||||
70 | register unsigned int tin0, tin1; | - | ||||||
71 | register unsigned int tout0, tout1, xor0, xor1; | - | ||||||
72 | register long l = length; | - | ||||||
73 | unsigned int tin[2]; | - | ||||||
74 | - | |||||||
75 | if (enc
| 159-228 | ||||||
76 | (tout0 =((unsigned long)(*((iv)++)))<<24L, tout0|=((unsigned long)(*((iv)++)))<<16L, tout0|=((unsigned long)(*((iv)++)))<< 8L, tout0|=((unsigned long)(*((iv)++)))); | - | ||||||
77 | (tout1 =((unsigned long)(*((iv)++)))<<24L, tout1|=((unsigned long)(*((iv)++)))<<16L, tout1|=((unsigned long)(*((iv)++)))<< 8L, tout1|=((unsigned long)(*((iv)++)))); | - | ||||||
78 | iv -= 8; | - | ||||||
79 | for (l -= 8; l >= 0
| 228-2358 | ||||||
80 | (tin0 =((unsigned long)(*((in)++)))<<24L, tin0|=((unsigned long)(*((in)++)))<<16L, tin0|=((unsigned long)(*((in)++)))<< 8L, tin0|=((unsigned long)(*((in)++)))); | - | ||||||
81 | (tin1 =((unsigned long)(*((in)++)))<<24L, tin1|=((unsigned long)(*((in)++)))<<16L, tin1|=((unsigned long)(*((in)++)))<< 8L, tin1|=((unsigned long)(*((in)++)))); | - | ||||||
82 | tin0 ^= tout0; | - | ||||||
83 | tin1 ^= tout1; | - | ||||||
84 | tin[0] = tin0; | - | ||||||
85 | tin[1] = tin1; | - | ||||||
86 | CAST_encrypt(tin, ks); | - | ||||||
87 | tout0 = tin[0]; | - | ||||||
88 | tout1 = tin[1]; | - | ||||||
89 | (*((out)++)=(unsigned char)(((tout0)>>24L)&0xff), *((out)++)=(unsigned char)(((tout0)>>16L)&0xff), *((out)++)=(unsigned char)(((tout0)>> 8L)&0xff), *((out)++)=(unsigned char)(((tout0) )&0xff)); | - | ||||||
90 | (*((out)++)=(unsigned char)(((tout1)>>24L)&0xff), *((out)++)=(unsigned char)(((tout1)>>16L)&0xff), *((out)++)=(unsigned char)(((tout1)>> 8L)&0xff), *((out)++)=(unsigned char)(((tout1) )&0xff)); | - | ||||||
91 | } executed 2358 times by 1 test: end of block Executed by:
| 2358 | ||||||
92 | if (l != -8
| 0-228 | ||||||
93 | { in+=l + 8; tin0=tin1=0; switch (l + 8) { case never executed: 8:case 8: never executed: tin1 =((unsigned long)(*(--(in)))) ; casecase 8: never executed: 7:case 7: never executed: case 7: code before this statement never executed: tin1|=((unsigned long)(*(--(in))))<< 8; casecase 7: never executed: 6:case 6: never executed: case 6: code before this statement never executed: tin1|=((unsigned long)(*(--(in))))<<16; casecase 6: never executed: 5:case 5: never executed: case 5: code before this statement never executed: tin1|=((unsigned long)(*(--(in))))<<24; casecase 5: never executed: 4:case 4: never executed: case 4: code before this statement never executed: tin0 =((unsigned long)(*(--(in)))) ; casecase 4: never executed: 3:case 3: never executed: case 3: code before this statement never executed: tin0|=((unsigned long)(*(--(in))))<< 8; casecase 3: never executed: 2:case 2: never executed: case 2: code before this statement never executed: tin0|=((unsigned long)(*(--(in))))<<16; casecase 2: never executed: 1:case 1: never executed: case 1: code before this statement never executed: tin0|=((unsigned long)(*(--(in))))<<24; }case 1: never executed: };end of block | 0 | ||||||
94 | tin0 ^= tout0; | - | ||||||
95 | tin1 ^= tout1; | - | ||||||
96 | tin[0] = tin0; | - | ||||||
97 | tin[1] = tin1; | - | ||||||
98 | CAST_encrypt(tin, ks); | - | ||||||
99 | tout0 = tin[0]; | - | ||||||
100 | tout1 = tin[1]; | - | ||||||
101 | (*((out)++)=(unsigned char)(((tout0)>>24L)&0xff), *((out)++)=(unsigned char)(((tout0)>>16L)&0xff), *((out)++)=(unsigned char)(((tout0)>> 8L)&0xff), *((out)++)=(unsigned char)(((tout0) )&0xff)); | - | ||||||
102 | (*((out)++)=(unsigned char)(((tout1)>>24L)&0xff), *((out)++)=(unsigned char)(((tout1)>>16L)&0xff), *((out)++)=(unsigned char)(((tout1)>> 8L)&0xff), *((out)++)=(unsigned char)(((tout1) )&0xff)); | - | ||||||
103 | } never executed: end of block | 0 | ||||||
104 | (*((iv)++)=(unsigned char)(((tout0)>>24L)&0xff), *((iv)++)=(unsigned char)(((tout0)>>16L)&0xff), *((iv)++)=(unsigned char)(((tout0)>> 8L)&0xff), *((iv)++)=(unsigned char)(((tout0) )&0xff)); | - | ||||||
105 | (*((iv)++)=(unsigned char)(((tout1)>>24L)&0xff), *((iv)++)=(unsigned char)(((tout1)>>16L)&0xff), *((iv)++)=(unsigned char)(((tout1)>> 8L)&0xff), *((iv)++)=(unsigned char)(((tout1) )&0xff)); | - | ||||||
106 | } executed 228 times by 1 test: else {end of block Executed by:
| 228 | ||||||
107 | (xor0 =((unsigned long)(*((iv)++)))<<24L, xor0|=((unsigned long)(*((iv)++)))<<16L, xor0|=((unsigned long)(*((iv)++)))<< 8L, xor0|=((unsigned long)(*((iv)++)))); | - | ||||||
108 | (xor1 =((unsigned long)(*((iv)++)))<<24L, xor1|=((unsigned long)(*((iv)++)))<<16L, xor1|=((unsigned long)(*((iv)++)))<< 8L, xor1|=((unsigned long)(*((iv)++)))); | - | ||||||
109 | iv -= 8; | - | ||||||
110 | for (l -= 8; l >= 0
| 159-2358 | ||||||
111 | (tin0 =((unsigned long)(*((in)++)))<<24L, tin0|=((unsigned long)(*((in)++)))<<16L, tin0|=((unsigned long)(*((in)++)))<< 8L, tin0|=((unsigned long)(*((in)++)))); | - | ||||||
112 | (tin1 =((unsigned long)(*((in)++)))<<24L, tin1|=((unsigned long)(*((in)++)))<<16L, tin1|=((unsigned long)(*((in)++)))<< 8L, tin1|=((unsigned long)(*((in)++)))); | - | ||||||
113 | tin[0] = tin0; | - | ||||||
114 | tin[1] = tin1; | - | ||||||
115 | CAST_decrypt(tin, ks); | - | ||||||
116 | tout0 = tin[0] ^ xor0; | - | ||||||
117 | tout1 = tin[1] ^ xor1; | - | ||||||
118 | (*((out)++)=(unsigned char)(((tout0)>>24L)&0xff), *((out)++)=(unsigned char)(((tout0)>>16L)&0xff), *((out)++)=(unsigned char)(((tout0)>> 8L)&0xff), *((out)++)=(unsigned char)(((tout0) )&0xff)); | - | ||||||
119 | (*((out)++)=(unsigned char)(((tout1)>>24L)&0xff), *((out)++)=(unsigned char)(((tout1)>>16L)&0xff), *((out)++)=(unsigned char)(((tout1)>> 8L)&0xff), *((out)++)=(unsigned char)(((tout1) )&0xff)); | - | ||||||
120 | xor0 = tin0; | - | ||||||
121 | xor1 = tin1; | - | ||||||
122 | } executed 2358 times by 1 test: end of block Executed by:
| 2358 | ||||||
123 | if (l != -8
| 0-159 | ||||||
124 | (tin0 =((unsigned long)(*((in)++)))<<24L, tin0|=((unsigned long)(*((in)++)))<<16L, tin0|=((unsigned long)(*((in)++)))<< 8L, tin0|=((unsigned long)(*((in)++)))); | - | ||||||
125 | (tin1 =((unsigned long)(*((in)++)))<<24L, tin1|=((unsigned long)(*((in)++)))<<16L, tin1|=((unsigned long)(*((in)++)))<< 8L, tin1|=((unsigned long)(*((in)++)))); | - | ||||||
126 | tin[0] = tin0; | - | ||||||
127 | tin[1] = tin1; | - | ||||||
128 | CAST_decrypt(tin, ks); | - | ||||||
129 | tout0 = tin[0] ^ xor0; | - | ||||||
130 | tout1 = tin[1] ^ xor1; | - | ||||||
131 | { out+=l + 8; switch (l + 8) { case never executed: 8:case 8: never executed: *(--(out))=(unsigned char)(((tout1) )&0xff); casecase 8: never executed: 7:case 7: never executed: case 7: code before this statement never executed: *(--(out))=(unsigned char)(((tout1)>> 8)&0xff); casecase 7: never executed: 6:case 6: never executed: case 6: code before this statement never executed: *(--(out))=(unsigned char)(((tout1)>>16)&0xff); casecase 6: never executed: 5:case 5: never executed: case 5: code before this statement never executed: *(--(out))=(unsigned char)(((tout1)>>24)&0xff); casecase 5: never executed: 4:case 4: never executed: case 4: code before this statement never executed: *(--(out))=(unsigned char)(((tout0) )&0xff); casecase 4: never executed: 3:case 3: never executed: case 3: code before this statement never executed: *(--(out))=(unsigned char)(((tout0)>> 8)&0xff); casecase 3: never executed: 2:case 2: never executed: case 2: code before this statement never executed: *(--(out))=(unsigned char)(((tout0)>>16)&0xff); casecase 2: never executed: 1:case 1: never executed: case 1: code before this statement never executed: *(--(out))=(unsigned char)(((tout0)>>24)&0xff); }case 1: never executed: };end of block | 0 | ||||||
132 | xor0 = tin0; | - | ||||||
133 | xor1 = tin1; | - | ||||||
134 | } never executed: end of block | 0 | ||||||
135 | (*((iv)++)=(unsigned char)(((xor0)>>24L)&0xff), *((iv)++)=(unsigned char)(((xor0)>>16L)&0xff), *((iv)++)=(unsigned char)(((xor0)>> 8L)&0xff), *((iv)++)=(unsigned char)(((xor0) )&0xff)); | - | ||||||
136 | (*((iv)++)=(unsigned char)(((xor1)>>24L)&0xff), *((iv)++)=(unsigned char)(((xor1)>>16L)&0xff), *((iv)++)=(unsigned char)(((xor1)>> 8L)&0xff), *((iv)++)=(unsigned char)(((xor1) )&0xff)); | - | ||||||
137 | } executed 159 times by 1 test: end of block Executed by:
| 159 | ||||||
138 | tin0 = tin1 = tout0 = tout1 = xor0 = xor1 = 0; | - | ||||||
139 | tin[0] = tin[1] = 0; | - | ||||||
140 | } executed 387 times by 1 test: end of block Executed by:
| 387 | ||||||
Switch to Source code | Preprocessed file |