| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/libressl/src/crypto/des/ofb64enc.c |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||
|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||
| 2 | - | |||||||
| 3 | - | |||||||
| 4 | - | |||||||
| 5 | - | |||||||
| 6 | void DES_ofb64_encrypt(const unsigned char *in, | - | ||||||
| 7 | unsigned char *out, long length, | - | ||||||
| 8 | DES_key_schedule *schedule, DES_cblock *ivec, int *num) | - | ||||||
| 9 | { | - | ||||||
| 10 | unsigned int v0,v1,t; | - | ||||||
| 11 | int n= *num; | - | ||||||
| 12 | long l=length; | - | ||||||
| 13 | DES_cblock d; | - | ||||||
| 14 | unsigned char *dp; | - | ||||||
| 15 | unsigned int ti[2]; | - | ||||||
| 16 | unsigned char *iv; | - | ||||||
| 17 | int save=0; | - | ||||||
| 18 | - | |||||||
| 19 | iv = &(*ivec)[0]; | - | ||||||
| 20 | (v0 =((unsigned int)(*((iv)++))) , v0|=((unsigned int)(*((iv)++)))<< 8L, v0|=((unsigned int)(*((iv)++)))<<16L, v0|=((unsigned int)(*((iv)++)))<<24L); | - | ||||||
| 21 | (v1 =((unsigned int)(*((iv)++))) , v1|=((unsigned int)(*((iv)++)))<< 8L, v1|=((unsigned int)(*((iv)++)))<<16L, v1|=((unsigned int)(*((iv)++)))<<24L); | - | ||||||
| 22 | ti[0]=v0; | - | ||||||
| 23 | ti[1]=v1; | - | ||||||
| 24 | dp=d; | - | ||||||
| 25 | (*((dp)++)=(unsigned char)(((v0) )&0xff), *((dp)++)=(unsigned char)(((v0)>> 8L)&0xff), *((dp)++)=(unsigned char)(((v0)>>16L)&0xff), *((dp)++)=(unsigned char)(((v0)>>24L)&0xff)); | - | ||||||
| 26 | (*((dp)++)=(unsigned char)(((v1) )&0xff), *((dp)++)=(unsigned char)(((v1)>> 8L)&0xff), *((dp)++)=(unsigned char)(((v1)>>16L)&0xff), *((dp)++)=(unsigned char)(((v1)>>24L)&0xff)); | - | ||||||
| 27 | while (l--
| 29-3600 | ||||||
| 28 | { | - | ||||||
| 29 | if (n == 0
| 450-3150 | ||||||
| 30 | { | - | ||||||
| 31 | DES_encrypt1(ti,schedule,1); | - | ||||||
| 32 | dp=d; | - | ||||||
| 33 | t=ti[0]; (*((dp)++)=(unsigned char)(((t) )&0xff), *((dp)++)=(unsigned char)(((t)>> 8L)&0xff), *((dp)++)=(unsigned char)(((t)>>16L)&0xff), *((dp)++)=(unsigned char)(((t)>>24L)&0xff)); | - | ||||||
| 34 | t=ti[1]; (*((dp)++)=(unsigned char)(((t) )&0xff), *((dp)++)=(unsigned char)(((t)>> 8L)&0xff), *((dp)++)=(unsigned char)(((t)>>16L)&0xff), *((dp)++)=(unsigned char)(((t)>>24L)&0xff)); | - | ||||||
| 35 | save++; | - | ||||||
| 36 | } executed 450 times by 2 tests: end of blockExecuted by:
| 450 | ||||||
| 37 | *(out++)= *(in++)^d[n]; | - | ||||||
| 38 | n=(n+1)&0x07; | - | ||||||
| 39 | } executed 3600 times by 2 tests: end of blockExecuted by:
| 3600 | ||||||
| 40 | if (save
| 8-21 | ||||||
| 41 | { | - | ||||||
| 42 | v0=ti[0]; | - | ||||||
| 43 | v1=ti[1]; | - | ||||||
| 44 | iv = &(*ivec)[0]; | - | ||||||
| 45 | (*((iv)++)=(unsigned char)(((v0) )&0xff), *((iv)++)=(unsigned char)(((v0)>> 8L)&0xff), *((iv)++)=(unsigned char)(((v0)>>16L)&0xff), *((iv)++)=(unsigned char)(((v0)>>24L)&0xff)); | - | ||||||
| 46 | (*((iv)++)=(unsigned char)(((v1) )&0xff), *((iv)++)=(unsigned char)(((v1)>> 8L)&0xff), *((iv)++)=(unsigned char)(((v1)>>16L)&0xff), *((iv)++)=(unsigned char)(((v1)>>24L)&0xff)); | - | ||||||
| 47 | } executed 8 times by 2 tests: end of blockExecuted by:
| 8 | ||||||
| 48 | t=v0=v1=ti[0]=ti[1]=0; | - | ||||||
| 49 | *num=n; | - | ||||||
| 50 | } executed 29 times by 2 tests: end of blockExecuted by:
| 29 | ||||||
| Switch to Source code | Preprocessed file |