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