| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/des/pcbc_enc.c |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||
|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||
| 2 | void DES_pcbc_encrypt(const unsigned char *input, unsigned char *output, | - | ||||||
| 3 | long length, DES_key_schedule *schedule, | - | ||||||
| 4 | DES_cblock *ivec, int enc) | - | ||||||
| 5 | { | - | ||||||
| 6 | register DES_LONG sin0, sin1, xor0, xor1, tout0, tout1; | - | ||||||
| 7 | DES_LONG tin[2]; | - | ||||||
| 8 | const unsigned char *in; | - | ||||||
| 9 | unsigned char *out, *iv; | - | ||||||
| 10 | - | |||||||
| 11 | in = input; | - | ||||||
| 12 | out = output; | - | ||||||
| 13 | iv = &(*ivec)[0]; | - | ||||||
| 14 | - | |||||||
| 15 | if (enc
| 1 | ||||||
| 16 | (xor0 =((DES_LONG)(*((iv)++))) , xor0|=((DES_LONG)(*((iv)++)))<< 8L, xor0|=((DES_LONG)(*((iv)++)))<<16L, xor0|=((DES_LONG)(*((iv)++)))<<24L); | - | ||||||
| 17 | (xor1 =((DES_LONG)(*((iv)++))) , xor1|=((DES_LONG)(*((iv)++)))<< 8L, xor1|=((DES_LONG)(*((iv)++)))<<16L, xor1|=((DES_LONG)(*((iv)++)))<<24L); | - | ||||||
| 18 | for (; length > 0
| 1-4 | ||||||
| 19 | if (length >= 8
| 1-3 | ||||||
| 20 | (sin0 =((DES_LONG)(*((in)++))) , sin0|=((DES_LONG)(*((in)++)))<< 8L, sin0|=((DES_LONG)(*((in)++)))<<16L, sin0|=((DES_LONG)(*((in)++)))<<24L); | - | ||||||
| 21 | (sin1 =((DES_LONG)(*((in)++))) , sin1|=((DES_LONG)(*((in)++)))<< 8L, sin1|=((DES_LONG)(*((in)++)))<<16L, sin1|=((DES_LONG)(*((in)++)))<<24L); | - | ||||||
| 22 | } executed 3 times by 1 test: elseend of blockExecuted by:
| 3 | ||||||
| 23 | { in+=length; sin0=sin1=0; switch (length) { case never executed: 8:case 8:never executed: sin1 =((DES_LONG)(*(--(in))))<<24L; casecase 8:never executed: 7:case 7:never executed: case 7:code before this statement never executed: sin1|=((DES_LONG)(*(--(in))))<<16L; casecase 7:never executed: 6:case 6:never executed: case 6:code before this statement never executed: sin1|=((DES_LONG)(*(--(in))))<< 8L; 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: sin1|=((DES_LONG)(*(--(in)))); 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: sin0 =((DES_LONG)(*(--(in))))<<24L; 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: sin0|=((DES_LONG)(*(--(in))))<<16L; 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: sin0|=((DES_LONG)(*(--(in))))<< 8L; 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: sin0|=((DES_LONG)(*(--(in)))); }case 1:Executed by:
executed 1 time by 1 test: }end of blockExecuted by:
executed 1 time by 1 test: ;end of blockExecuted by:
| 0-1 | ||||||
| 24 | tin[0] = sin0 ^ xor0; | - | ||||||
| 25 | tin[1] = sin1 ^ xor1; | - | ||||||
| 26 | DES_encrypt1((DES_LONG *)tin, schedule, 1); | - | ||||||
| 27 | tout0 = tin[0]; | - | ||||||
| 28 | tout1 = tin[1]; | - | ||||||
| 29 | xor0 = sin0 ^ tout0; | - | ||||||
| 30 | xor1 = sin1 ^ tout1; | - | ||||||
| 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 | (*((out)++)=(unsigned char)(((tout1) )&0xff), *((out)++)=(unsigned char)(((tout1)>> 8L)&0xff), *((out)++)=(unsigned char)(((tout1)>>16L)&0xff), *((out)++)=(unsigned char)(((tout1)>>24L)&0xff)); | - | ||||||
| 33 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||
| 34 | } executed 1 time by 1 test: else {end of blockExecuted by:
| 1 | ||||||
| 35 | (xor0 =((DES_LONG)(*((iv)++))) , xor0|=((DES_LONG)(*((iv)++)))<< 8L, xor0|=((DES_LONG)(*((iv)++)))<<16L, xor0|=((DES_LONG)(*((iv)++)))<<24L); | - | ||||||
| 36 | (xor1 =((DES_LONG)(*((iv)++))) , xor1|=((DES_LONG)(*((iv)++)))<< 8L, xor1|=((DES_LONG)(*((iv)++)))<<16L, xor1|=((DES_LONG)(*((iv)++)))<<24L); | - | ||||||
| 37 | for (; length > 0
| 1-4 | ||||||
| 38 | (sin0 =((DES_LONG)(*((in)++))) , sin0|=((DES_LONG)(*((in)++)))<< 8L, sin0|=((DES_LONG)(*((in)++)))<<16L, sin0|=((DES_LONG)(*((in)++)))<<24L); | - | ||||||
| 39 | (sin1 =((DES_LONG)(*((in)++))) , sin1|=((DES_LONG)(*((in)++)))<< 8L, sin1|=((DES_LONG)(*((in)++)))<<16L, sin1|=((DES_LONG)(*((in)++)))<<24L); | - | ||||||
| 40 | tin[0] = sin0; | - | ||||||
| 41 | tin[1] = sin1; | - | ||||||
| 42 | DES_encrypt1((DES_LONG *)tin, schedule, 0); | - | ||||||
| 43 | tout0 = tin[0] ^ xor0; | - | ||||||
| 44 | tout1 = tin[1] ^ xor1; | - | ||||||
| 45 | if (length >= 8
| 1-3 | ||||||
| 46 | (*((out)++)=(unsigned char)(((tout0) )&0xff), *((out)++)=(unsigned char)(((tout0)>> 8L)&0xff), *((out)++)=(unsigned char)(((tout0)>>16L)&0xff), *((out)++)=(unsigned char)(((tout0)>>24L)&0xff)); | - | ||||||
| 47 | (*((out)++)=(unsigned char)(((tout1) )&0xff), *((out)++)=(unsigned char)(((tout1)>> 8L)&0xff), *((out)++)=(unsigned char)(((tout1)>>16L)&0xff), *((out)++)=(unsigned char)(((tout1)>>24L)&0xff)); | - | ||||||
| 48 | } executed 3 times by 1 test: elseend of blockExecuted by:
| 3 | ||||||
| 49 | { out+=length; switch (length) { 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:
executed 1 time by 1 test: ;end of blockExecuted by:
| 0-1 | ||||||
| 50 | xor0 = tout0 ^ sin0; | - | ||||||
| 51 | xor1 = tout1 ^ sin1; | - | ||||||
| 52 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||
| 53 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||
| 54 | tin[0] = tin[1] = 0; | - | ||||||
| 55 | sin0 = sin1 = xor0 = xor1 = tout0 = tout1 = 0; | - | ||||||
| 56 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||
| Switch to Source code | Preprocessed file |