OpenCoverage

bf_cfb64.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/libressl/src/crypto/bf/bf_cfb64.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7void BF_cfb64_encrypt(const unsigned char *in, unsigned char *out, long length,-
8 const BF_KEY *schedule, unsigned char *ivec, int *num, int encrypt)-
9 {-
10 unsigned int v0,v1,t;-
11 int n= *num;-
12 long l=length;-
13 unsigned int ti[2];-
14 unsigned char *iv,c,cc;-
15-
16 iv=(unsigned char *)ivec;-
17 if (encrypt
encryptDescription
TRUEevaluated 4 times by 2 tests
Evaluated by:
  • bftest
  • libcrypto.so.44.0.1
FALSEevaluated 4 times by 2 tests
Evaluated by:
  • bftest
  • libcrypto.so.44.0.1
)
4
18 {-
19 while (l--
l--Description
TRUEevaluated 1805 times by 2 tests
Evaluated by:
  • bftest
  • libcrypto.so.44.0.1
FALSEevaluated 4 times by 2 tests
Evaluated by:
  • bftest
  • libcrypto.so.44.0.1
)
4-1805
20 {-
21 if (n == 0
n == 0Description
TRUEevaluated 226 times by 2 tests
Evaluated by:
  • bftest
  • libcrypto.so.44.0.1
FALSEevaluated 1579 times by 2 tests
Evaluated by:
  • bftest
  • libcrypto.so.44.0.1
)
226-1579
22 {-
23 (v0 =((unsigned long)(*((iv)++)))<<24L, v0|=((unsigned long)(*((iv)++)))<<16L, v0|=((unsigned long)(*((iv)++)))<< 8L, v0|=((unsigned long)(*((iv)++)))); ti[0]=v0;-
24 (v1 =((unsigned long)(*((iv)++)))<<24L, v1|=((unsigned long)(*((iv)++)))<<16L, v1|=((unsigned long)(*((iv)++)))<< 8L, v1|=((unsigned long)(*((iv)++)))); ti[1]=v1;-
25 BF_encrypt((unsigned int *)ti,schedule);-
26 iv=(unsigned char *)ivec;-
27 t=ti[0]; (*((iv)++)=(unsigned char)(((t)>>24L)&0xff), *((iv)++)=(unsigned char)(((t)>>16L)&0xff), *((iv)++)=(unsigned char)(((t)>> 8L)&0xff), *((iv)++)=(unsigned char)(((t) )&0xff));-
28 t=ti[1]; (*((iv)++)=(unsigned char)(((t)>>24L)&0xff), *((iv)++)=(unsigned char)(((t)>>16L)&0xff), *((iv)++)=(unsigned char)(((t)>> 8L)&0xff), *((iv)++)=(unsigned char)(((t) )&0xff));-
29 iv=(unsigned char *)ivec;-
30 }
executed 226 times by 2 tests: end of block
Executed by:
  • bftest
  • libcrypto.so.44.0.1
226
31 c= *(in++)^iv[n];-
32 *(out++)=c;-
33 iv[n]=c;-
34 n=(n+1)&0x07;-
35 }
executed 1805 times by 2 tests: end of block
Executed by:
  • bftest
  • libcrypto.so.44.0.1
1805
36 }
executed 4 times by 2 tests: end of block
Executed by:
  • bftest
  • libcrypto.so.44.0.1
4
37 else-
38 {-
39 while (l--
l--Description
TRUEevaluated 1805 times by 2 tests
Evaluated by:
  • bftest
  • libcrypto.so.44.0.1
FALSEevaluated 4 times by 2 tests
Evaluated by:
  • bftest
  • libcrypto.so.44.0.1
)
4-1805
40 {-
41 if (n == 0
n == 0Description
TRUEevaluated 226 times by 2 tests
Evaluated by:
  • bftest
  • libcrypto.so.44.0.1
FALSEevaluated 1579 times by 2 tests
Evaluated by:
  • bftest
  • libcrypto.so.44.0.1
)
226-1579
42 {-
43 (v0 =((unsigned long)(*((iv)++)))<<24L, v0|=((unsigned long)(*((iv)++)))<<16L, v0|=((unsigned long)(*((iv)++)))<< 8L, v0|=((unsigned long)(*((iv)++)))); ti[0]=v0;-
44 (v1 =((unsigned long)(*((iv)++)))<<24L, v1|=((unsigned long)(*((iv)++)))<<16L, v1|=((unsigned long)(*((iv)++)))<< 8L, v1|=((unsigned long)(*((iv)++)))); ti[1]=v1;-
45 BF_encrypt((unsigned int *)ti,schedule);-
46 iv=(unsigned char *)ivec;-
47 t=ti[0]; (*((iv)++)=(unsigned char)(((t)>>24L)&0xff), *((iv)++)=(unsigned char)(((t)>>16L)&0xff), *((iv)++)=(unsigned char)(((t)>> 8L)&0xff), *((iv)++)=(unsigned char)(((t) )&0xff));-
48 t=ti[1]; (*((iv)++)=(unsigned char)(((t)>>24L)&0xff), *((iv)++)=(unsigned char)(((t)>>16L)&0xff), *((iv)++)=(unsigned char)(((t)>> 8L)&0xff), *((iv)++)=(unsigned char)(((t) )&0xff));-
49 iv=(unsigned char *)ivec;-
50 }
executed 226 times by 2 tests: end of block
Executed by:
  • bftest
  • libcrypto.so.44.0.1
226
51 cc= *(in++);-
52 c=iv[n];-
53 iv[n]=cc;-
54 *(out++)=c^cc;-
55 n=(n+1)&0x07;-
56 }
executed 1805 times by 2 tests: end of block
Executed by:
  • bftest
  • libcrypto.so.44.0.1
1805
57 }
executed 4 times by 2 tests: end of block
Executed by:
  • bftest
  • libcrypto.so.44.0.1
4
58 v0=v1=ti[0]=ti[1]=t=c=cc=0;-
59 *num=n;-
60 }
executed 8 times by 2 tests: end of block
Executed by:
  • bftest
  • libcrypto.so.44.0.1
8
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2