OpenCoverage

md32_common.h #1

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/include/internal/md32_common.h
Switch to Source codePreprocessed file
LineSourceCount
1int MD4_Update(MD4_CTX *c, const void *data_, size_t len)-
2{-
3 const unsigned char *data = data_;-
4 unsigned char *p;-
5 unsigned int l;-
6 size_t n;-
7-
8 if (len == 0
len == 0Description
TRUEevaluated 612 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 1308473 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
612-1308473
9 return
executed 612 times by 2 tests: return 1;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
1;
executed 612 times by 2 tests: return 1;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
612
10-
11 l = (c->Nl + (((unsigned int) len) << 3)) & 0xffffffffUL;-
12 if (l < c->Nl
l < c->NlDescription
TRUEnever evaluated
FALSEevaluated 1308473 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
0-1308473
13 c->Nh++;
never executed: c->Nh++;
0
14 c->Nh += (unsigned int) (len >> 29);-
15-
16 c->Nl = l;-
17-
18 n = c->num;-
19 if (n != 0
n != 0Description
TRUEevaluated 695195 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 613278 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
613278-695195
20 p = (unsigned char *)c->data;-
21-
22 if (len >= 64
len >= 64Description
TRUEevaluated 38028 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 657167 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
|| len + n >= 64
len + n >= 64Description
TRUEevaluated 249854 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 407313 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
38028-657167
23 memcpy(p + n, data, 64 - n);-
24 md4_block_data_order(c, p, 1);-
25 n = 64 - n;-
26 data += n;-
27 len -= n;-
28 c->num = 0;-
29-
30-
31-
32-
33-
34-
35 memset(p, 0, 64);-
36 }
executed 287882 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
else {
287882
37 memcpy(p + n, data, len);-
38 c->num += (unsigned int)len;-
39 return
executed 407313 times by 2 tests: return 1;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
1;
executed 407313 times by 2 tests: return 1;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
407313
40 }-
41 }-
42-
43 n = len / 64;-
44 if (n > 0
n > 0Description
TRUEevaluated 147219 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 753941 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
147219-753941
45 md4_block_data_order(c, data, n);-
46 n *= 64;-
47 data += n;-
48 len -= n;-
49 }
executed 147219 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
147219
50-
51 if (len != 0
len != 0Description
TRUEevaluated 825976 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 75184 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
75184-825976
52 p = (unsigned char *)c->data;-
53 c->num = (unsigned int)len;-
54 memcpy(p, data, len);-
55 }
executed 825976 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
825976
56 return
executed 901160 times by 2 tests: return 1;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
1;
executed 901160 times by 2 tests: return 1;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
901160
57}-
58-
59void MD4_Transform(MD4_CTX *c, const unsigned char *data)-
60{-
61 md4_block_data_order(c, data, 1);-
62}
executed 4138 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
4138
63-
64int MD4_Final(unsigned char *md, MD4_CTX *c)-
65{-
66 unsigned char *p = (unsigned char *)c->data;-
67 size_t n = c->num;-
68-
69 p[n] = 0x80;-
70 n++;-
71-
72 if (n > (64 - 8)
n > (64 - 8)Description
TRUEevaluated 68500 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 506394 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
68500-506394
73 memset(p + n, 0, 64 - n);-
74 n = 0;-
75 md4_block_data_order(c, p, 1);-
76 }
executed 68500 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
68500
77 memset(p + n, 0, 64 - 8 - n);-
78-
79 p += 64 - 8;-
80-
81-
82-
83-
84 (void)(*((p)++)=(unsigned char)(((c->Nl) )&0xff), *((p)++)=(unsigned char)(((c->Nl)>> 8)&0xff), *((p)++)=(unsigned char)(((c->Nl)>>16)&0xff), *((p)++)=(unsigned char)(((c->Nl)>>24)&0xff), c->Nl);-
85 (void)(*((p)++)=(unsigned char)(((c->Nh) )&0xff), *((p)++)=(unsigned char)(((c->Nh)>> 8)&0xff), *((p)++)=(unsigned char)(((c->Nh)>>16)&0xff), *((p)++)=(unsigned char)(((c->Nh)>>24)&0xff), c->Nh);-
86-
87 p -= 64;-
88 md4_block_data_order(c, p, 1);-
89 c->num = 0;-
90 OPENSSL_cleanse(p, 64);-
91-
92-
93-
94-
95 do { unsigned long ll; ll=(c)->A; (void)(*(((md))++)=(unsigned char)(((ll) )&0xff), *(((md))++)=(unsigned char)(((ll)>> 8)&0xff), *(((md))++)=(unsigned char)(((ll)>>16)&0xff), *(((md))++)=(unsigned char)(((ll)>>24)&0xff), ll); ll=(c)->B; (void)(*(((md))++)=(unsigned char)(((ll) )&0xff), *(((md))++)=(unsigned char)(((ll)>> 8)&0xff), *(((md))++)=(unsigned char)(((ll)>>16)&0xff), *(((md))++)=(unsigned char)(((ll)>>24)&0xff), ll); ll=(c)->C; (void)(*(((md))++)=(unsigned char)(((ll) )&0xff), *(((md))++)=(unsigned char)(((ll)>> 8)&0xff), *(((md))++)=(unsigned char)(((ll)>>16)&0xff), *(((md))++)=(unsigned char)(((ll)>>24)&0xff), ll); ll=(c)->D; (void)(*(((md))++)=(unsigned char)(((ll) )&0xff), *(((md))++)=(unsigned char)(((ll)>> 8)&0xff), *(((md))++)=(unsigned char)(((ll)>>16)&0xff), *(((md))++)=(unsigned char)(((ll)>>24)&0xff), ll); } while (0);-
96-
97-
98 return
executed 574894 times by 2 tests: return 1;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
1;
executed 574894 times by 2 tests: return 1;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
574894
99}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2