OpenCoverage

sha256.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/sha/sha256.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5int SHA224_Init(SHA256_CTX *c)-
6{-
7 memset(c, 0, sizeof(*c));-
8 c->h[0] = 0xc1059ed8UL;-
9 c->h[1] = 0x367cd507UL;-
10 c->h[2] = 0x3070dd17UL;-
11 c->h[3] = 0xf70e5939UL;-
12 c->h[4] = 0xffc00b31UL;-
13 c->h[5] = 0x68581511UL;-
14 c->h[6] = 0x64f98fa7UL;-
15 c->h[7] = 0xbefa4fa4UL;-
16 c->md_len = 28;-
17 return
executed 51 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 51 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
51
18}-
19-
20int SHA256_Init(SHA256_CTX *c)-
21{-
22 memset(c, 0, sizeof(*c));-
23 c->h[0] = 0x6a09e667UL;-
24 c->h[1] = 0xbb67ae85UL;-
25 c->h[2] = 0x3c6ef372UL;-
26 c->h[3] = 0xa54ff53aUL;-
27 c->h[4] = 0x510e527fUL;-
28 c->h[5] = 0x9b05688cUL;-
29 c->h[6] = 0x1f83d9abUL;-
30 c->h[7] = 0x5be0cd19UL;-
31 c->md_len = 32;-
32 return
executed 300509 times by 2 tests: return 1;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
1;
executed 300509 times by 2 tests: return 1;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
300509
33}-
34-
35unsigned char *SHA224(const unsigned char *d, size_t n, unsigned char *md)-
36{-
37 SHA256_CTX c;-
38 static unsigned char m[28];-
39-
40 if (md ==
md == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
41 ((void *)0)
md == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
42 )-
43 md = m;
never executed: md = m;
0
44 SHA224_Init(&c);-
45 SHA256_Update(&c, d, n);-
46 SHA256_Final(md, &c);-
47 OPENSSL_cleanse(&c, sizeof(c));-
48 return
never executed: return md;
md;
never executed: return md;
0
49}-
50-
51unsigned char *SHA256(const unsigned char *d, size_t n, unsigned char *md)-
52{-
53 SHA256_CTX c;-
54 static unsigned char m[32];-
55-
56 if (md ==
md == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 14697 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-14697
57 ((void *)0)
md == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 14697 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-14697
58 )-
59 md = m;
never executed: md = m;
0
60 SHA256_Init(&c);-
61 SHA256_Update(&c, d, n);-
62 SHA256_Final(md, &c);-
63 OPENSSL_cleanse(&c, sizeof(c));-
64 return
executed 14697 times by 1 test: return md;
Executed by:
  • libcrypto.so.1.1
md;
executed 14697 times by 1 test: return md;
Executed by:
  • libcrypto.so.1.1
14697
65}-
66-
67int SHA224_Update(SHA256_CTX *c, const void *data, size_t len)-
68{-
69 return
executed 15681 times by 1 test: return SHA256_Update(c, data, len);
Executed by:
  • libcrypto.so.1.1
SHA256_Update(c, data, len);
executed 15681 times by 1 test: return SHA256_Update(c, data, len);
Executed by:
  • libcrypto.so.1.1
15681
70}-
71-
72int SHA224_Final(unsigned char *md, SHA256_CTX *c)-
73{-
74 return
executed 51 times by 1 test: return SHA256_Final(md, c);
Executed by:
  • libcrypto.so.1.1
SHA256_Final(md, c);
executed 51 times by 1 test: return SHA256_Final(md, c);
Executed by:
  • libcrypto.so.1.1
51
75}-
76void sha256_block_data_order(SHA256_CTX *ctx, const void *in, size_t num);-
77-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2