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