| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/des/ofb_enc.c |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||
|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||
| 2 | - | |||||||
| 3 | - | |||||||
| 4 | - | |||||||
| 5 | - | |||||||
| 6 | - | |||||||
| 7 | - | |||||||
| 8 | void DES_ofb_encrypt(const unsigned char *in, unsigned char *out, int numbits, | - | ||||||
| 9 | long length, DES_key_schedule *schedule, | - | ||||||
| 10 | DES_cblock *ivec) | - | ||||||
| 11 | { | - | ||||||
| 12 | register DES_LONG d0, d1, vv0, vv1, v0, v1, n = (numbits + 7) / 8; | - | ||||||
| 13 | register DES_LONG mask0, mask1; | - | ||||||
| 14 | register long l = length; | - | ||||||
| 15 | register int num = numbits; | - | ||||||
| 16 | DES_LONG ti[2]; | - | ||||||
| 17 | unsigned char *iv; | - | ||||||
| 18 | - | |||||||
| 19 | if (num > 64
| 0-2 | ||||||
| 20 | return; never executed: return; | 0 | ||||||
| 21 | if (num > 32
| 0-2 | ||||||
| 22 | mask0 = 0xffffffffL; | - | ||||||
| 23 | if (num >= 64
| 0-2 | ||||||
| 24 | mask1 = mask0; executed 2 times by 1 test: mask1 = mask0;Executed by:
| 2 | ||||||
| 25 | else | - | ||||||
| 26 | mask1 = (1L << (num - 32)) - 1; never executed: mask1 = (1L << (num - 32)) - 1; | 0 | ||||||
| 27 | } else { | - | ||||||
| 28 | if (num == 32
| 0 | ||||||
| 29 | mask0 = 0xffffffffL; never executed: mask0 = 0xffffffffL; | 0 | ||||||
| 30 | else | - | ||||||
| 31 | mask0 = (1L << num) - 1; never executed: mask0 = (1L << num) - 1; | 0 | ||||||
| 32 | mask1 = 0x00000000L; | - | ||||||
| 33 | } never executed: end of block | 0 | ||||||
| 34 | - | |||||||
| 35 | iv = &(*ivec)[0]; | - | ||||||
| 36 | (v0 =((DES_LONG)(*((iv)++))) , v0|=((DES_LONG)(*((iv)++)))<< 8L, v0|=((DES_LONG)(*((iv)++)))<<16L, v0|=((DES_LONG)(*((iv)++)))<<24L); | - | ||||||
| 37 | (v1 =((DES_LONG)(*((iv)++))) , v1|=((DES_LONG)(*((iv)++)))<< 8L, v1|=((DES_LONG)(*((iv)++)))<<16L, v1|=((DES_LONG)(*((iv)++)))<<24L); | - | ||||||
| 38 | ti[0] = v0; | - | ||||||
| 39 | ti[1] = v1; | - | ||||||
| 40 | while (l-- > 0
| 2-6 | ||||||
| 41 | ti[0] = v0; | - | ||||||
| 42 | ti[1] = v1; | - | ||||||
| 43 | DES_encrypt1((DES_LONG *)ti, schedule, 1); | - | ||||||
| 44 | vv0 = ti[0]; | - | ||||||
| 45 | vv1 = ti[1]; | - | ||||||
| 46 | { in+=n; d0=d1=0; switch (n) { case executed 6 times by 1 test: 8:case 8:Executed by:
executed 6 times by 1 test: d1 =((DES_LONG)(*(--(in))))<<24L; casecase 8:Executed by:
never executed: case 7:code before this statement executed 6 times by 1 test: case 7:Executed by:
never executed: 7:case 7:code before this statement executed 6 times by 1 test: case 7:Executed by:
never executed: d1|=((DES_LONG)(*(--(in))))<<16L; casecase 7:never executed: case 6:code before this statement executed 6 times by 1 test: case 6:Executed by:
never executed: 6:case 6:code before this statement executed 6 times by 1 test: case 6:Executed by:
never executed: d1|=((DES_LONG)(*(--(in))))<< 8L; casecase 6:never executed: case 5:code before this statement executed 6 times by 1 test: case 5:Executed by:
never executed: 5:case 5:code before this statement executed 6 times by 1 test: case 5:Executed by:
never executed: d1|=((DES_LONG)(*(--(in)))); casecase 5:never executed: case 4:code before this statement executed 6 times by 1 test: case 4:Executed by:
never executed: 4:case 4:code before this statement executed 6 times by 1 test: case 4:Executed by:
never executed: d0 =((DES_LONG)(*(--(in))))<<24L; casecase 4:never executed: case 3:code before this statement executed 6 times by 1 test: case 3:Executed by:
never executed: 3:case 3:code before this statement executed 6 times by 1 test: case 3:Executed by:
never executed: d0|=((DES_LONG)(*(--(in))))<<16L; casecase 3:never executed: case 2:code before this statement executed 6 times by 1 test: case 2:Executed by:
never executed: 2:case 2:code before this statement executed 6 times by 1 test: case 2:Executed by:
never executed: d0|=((DES_LONG)(*(--(in))))<< 8L; casecase 2:executed 6 times by 1 test: 1:case 1:Executed by:
executed 6 times by 1 test: case 1:Executed by:
code before this statement executed 6 times by 1 test: d0|=((DES_LONG)(*(--(in)))); }case 1:Executed by:
executed 6 times by 1 test: };end of blockExecuted by:
| 0-6 | ||||||
| 47 | in += n; | - | ||||||
| 48 | d0 = (d0 ^ vv0) & mask0; | - | ||||||
| 49 | d1 = (d1 ^ vv1) & mask1; | - | ||||||
| 50 | { out+=n; switch (n) { case executed 6 times by 1 test: 8:case 8:Executed by:
executed 6 times by 1 test: *(--(out))=(unsigned char)(((d1)>>24L)&0xff); casecase 8:Executed by:
never executed: case 7:code before this statement executed 6 times by 1 test: case 7:Executed by:
never executed: 7:case 7:code before this statement executed 6 times by 1 test: case 7:Executed by:
never executed: *(--(out))=(unsigned char)(((d1)>>16L)&0xff); casecase 7:never executed: case 6:code before this statement executed 6 times by 1 test: case 6:Executed by:
never executed: 6:case 6:code before this statement executed 6 times by 1 test: case 6:Executed by:
never executed: *(--(out))=(unsigned char)(((d1)>> 8L)&0xff); casecase 6:never executed: case 5:code before this statement executed 6 times by 1 test: case 5:Executed by:
never executed: 5:case 5:code before this statement executed 6 times by 1 test: case 5:Executed by:
never executed: *(--(out))=(unsigned char)(((d1) )&0xff); casecase 5:never executed: case 4:code before this statement executed 6 times by 1 test: case 4:Executed by:
never executed: 4:case 4:code before this statement executed 6 times by 1 test: case 4:Executed by:
never executed: *(--(out))=(unsigned char)(((d0)>>24L)&0xff); casecase 4:never executed: case 3:code before this statement executed 6 times by 1 test: case 3:Executed by:
never executed: 3:case 3:code before this statement executed 6 times by 1 test: case 3:Executed by:
never executed: *(--(out))=(unsigned char)(((d0)>>16L)&0xff); casecase 3:never executed: case 2:code before this statement executed 6 times by 1 test: case 2:Executed by:
never executed: 2:case 2:code before this statement executed 6 times by 1 test: case 2:Executed by:
never executed: *(--(out))=(unsigned char)(((d0)>> 8L)&0xff); casecase 2:executed 6 times by 1 test: 1:case 1:Executed by:
executed 6 times by 1 test: case 1:Executed by:
code before this statement executed 6 times by 1 test: *(--(out))=(unsigned char)(((d0) )&0xff); }case 1:Executed by:
executed 6 times by 1 test: };end of blockExecuted by:
| 0-6 | ||||||
| 51 | out += n; | - | ||||||
| 52 | - | |||||||
| 53 | if (num == 32
| 0-6 | ||||||
| 54 | v0 = v1; | - | ||||||
| 55 | v1 = vv0; | - | ||||||
| 56 | } never executed: else if (num == 64end of block
| 0-6 | ||||||
| 57 | v0 = vv0; | - | ||||||
| 58 | v1 = vv1; | - | ||||||
| 59 | } executed 6 times by 1 test: else if (num > 32end of blockExecuted by:
| 0-6 | ||||||
| 60 | v0 = ((v1 >> (num - 32)) | (vv0 << (64 - num))) & 0xffffffffL; | - | ||||||
| 61 | v1 = ((vv0 >> (num - 32)) | (vv1 << (64 - num))) & 0xffffffffL; | - | ||||||
| 62 | } never executed: else {end of block | 0 | ||||||
| 63 | - | |||||||
| 64 | v0 = ((v0 >> num) | (v1 << (32 - num))) & 0xffffffffL; | - | ||||||
| 65 | v1 = ((v1 >> num) | (vv0 << (32 - num))) & 0xffffffffL; | - | ||||||
| 66 | } never executed: end of block | 0 | ||||||
| 67 | } | - | ||||||
| 68 | iv = &(*ivec)[0]; | - | ||||||
| 69 | (*((iv)++)=(unsigned char)(((v0) )&0xff), *((iv)++)=(unsigned char)(((v0)>> 8L)&0xff), *((iv)++)=(unsigned char)(((v0)>>16L)&0xff), *((iv)++)=(unsigned char)(((v0)>>24L)&0xff)); | - | ||||||
| 70 | (*((iv)++)=(unsigned char)(((v1) )&0xff), *((iv)++)=(unsigned char)(((v1)>> 8L)&0xff), *((iv)++)=(unsigned char)(((v1)>>16L)&0xff), *((iv)++)=(unsigned char)(((v1)>>24L)&0xff)); | - | ||||||
| 71 | v0 = v1 = d0 = d1 = ti[0] = ti[1] = vv0 = vv1 = 0; | - | ||||||
| 72 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||
| Switch to Source code | Preprocessed file |