OpenCoverage

i_cfb64.c

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

Generated by Squish Coco 4.2.2