OpenCoverage

m_sha1.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/evp/m_sha1.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4static int init(EVP_MD_CTX *ctx)-
5{-
6 return
executed 69553 times by 1 test: return SHA1_Init(EVP_MD_CTX_md_data(ctx));
Executed by:
  • libcrypto.so.1.1
SHA1_Init(EVP_MD_CTX_md_data(ctx));
executed 69553 times by 1 test: return SHA1_Init(EVP_MD_CTX_md_data(ctx));
Executed by:
  • libcrypto.so.1.1
69553
7}-
8-
9static int update(EVP_MD_CTX *ctx, const void *data, size_t count)-
10{-
11 return
executed 178243 times by 1 test: return SHA1_Update(EVP_MD_CTX_md_data(ctx), data, count);
Executed by:
  • libcrypto.so.1.1
SHA1_Update(EVP_MD_CTX_md_data(ctx), data, count);
executed 178243 times by 1 test: return SHA1_Update(EVP_MD_CTX_md_data(ctx), data, count);
Executed by:
  • libcrypto.so.1.1
178243
12}-
13-
14static int final(EVP_MD_CTX *ctx, unsigned char *md)-
15{-
16 return
executed 149975 times by 1 test: return SHA1_Final(md, EVP_MD_CTX_md_data(ctx));
Executed by:
  • libcrypto.so.1.1
SHA1_Final(md, EVP_MD_CTX_md_data(ctx));
executed 149975 times by 1 test: return SHA1_Final(md, EVP_MD_CTX_md_data(ctx));
Executed by:
  • libcrypto.so.1.1
149975
17}-
18-
19static int ctrl(EVP_MD_CTX *ctx, int cmd, int mslen, void *ms)-
20{-
21 unsigned char padtmp[40];-
22 unsigned char sha1tmp[20];-
23-
24 SHA_CTX *sha1;-
25-
26 if (cmd != 0x1d
cmd != 0x1dDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
)
0-3
27 return
executed 3 times by 1 test: return -2;
Executed by:
  • libcrypto.so.1.1
-2;
executed 3 times by 1 test: return -2;
Executed by:
  • libcrypto.so.1.1
3
28-
29 if (ctx ==
ctx == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
30 ((void *)0)
ctx == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
31 )-
32 return
never executed: return 0;
0;
never executed: return 0;
0
33-
34 sha1 = EVP_MD_CTX_md_data(ctx);-
35-
36-
37 if (mslen != 48
mslen != 48Description
TRUEnever evaluated
FALSEnever evaluated
)
0
38 return
never executed: return 0;
0;
never executed: return 0;
0
39-
40-
41-
42-
43-
44 if (SHA1_Update(sha1, ms, mslen) <= 0
SHA1_Update(sh...s, mslen) <= 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
45 return
never executed: return 0;
0;
never executed: return 0;
0
46-
47-
48 memset(padtmp, 0x36, sizeof(padtmp));-
49-
50 if (!SHA1_Update(sha1, padtmp, sizeof(padtmp))
!SHA1_Update(s...izeof(padtmp))Description
TRUEnever evaluated
FALSEnever evaluated
)
0
51 return
never executed: return 0;
0;
never executed: return 0;
0
52-
53 if (!SHA1_Final(sha1tmp, sha1)
!SHA1_Final(sha1tmp, sha1)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
54 return
never executed: return 0;
0;
never executed: return 0;
0
55-
56-
57-
58 if (!SHA1_Init(sha1)
!SHA1_Init(sha1)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
59 return
never executed: return 0;
0;
never executed: return 0;
0
60-
61 if (SHA1_Update(sha1, ms, mslen) <= 0
SHA1_Update(sh...s, mslen) <= 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
62 return
never executed: return 0;
0;
never executed: return 0;
0
63-
64-
65 memset(padtmp, 0x5c, sizeof(padtmp));-
66-
67 if (!SHA1_Update(sha1, padtmp, sizeof(padtmp))
!SHA1_Update(s...izeof(padtmp))Description
TRUEnever evaluated
FALSEnever evaluated
)
0
68 return
never executed: return 0;
0;
never executed: return 0;
0
69-
70 if (!SHA1_Update(sha1, sha1tmp, sizeof(sha1tmp))
!SHA1_Update(s...zeof(sha1tmp))Description
TRUEnever evaluated
FALSEnever evaluated
)
0
71 return
never executed: return 0;
0;
never executed: return 0;
0
72-
73-
74 OPENSSL_cleanse(sha1tmp, sizeof(sha1tmp));-
75-
76 return
never executed: return 1;
1;
never executed: return 1;
0
77-
78}-
79-
80static const EVP_MD sha1_md = {-
81 64,-
82 65,-
83 20,-
84 0x0008,-
85 init,-
86 update,-
87 final,-
88 -
89 ((void *)0)-
90 ,-
91 -
92 ((void *)0)-
93 ,-
94 (16*4),-
95 sizeof(EVP_MD *) + sizeof(SHA_CTX),-
96 ctrl-
97};-
98-
99const EVP_MD *EVP_sha1(void)-
100{-
101 return
executed 102544 times by 1 test: return &sha1_md;
Executed by:
  • libcrypto.so.1.1
&sha1_md;
executed 102544 times by 1 test: return &sha1_md;
Executed by:
  • libcrypto.so.1.1
102544
102}-
103-
104static int init224(EVP_MD_CTX *ctx)-
105{-
106 return
executed 51 times by 1 test: return SHA224_Init(EVP_MD_CTX_md_data(ctx));
Executed by:
  • libcrypto.so.1.1
SHA224_Init(EVP_MD_CTX_md_data(ctx));
executed 51 times by 1 test: return SHA224_Init(EVP_MD_CTX_md_data(ctx));
Executed by:
  • libcrypto.so.1.1
51
107}-
108-
109static int update224(EVP_MD_CTX *ctx, const void *data, size_t count)-
110{-
111 return
executed 15681 times by 1 test: return SHA224_Update(EVP_MD_CTX_md_data(ctx), data, count);
Executed by:
  • libcrypto.so.1.1
SHA224_Update(EVP_MD_CTX_md_data(ctx), data, count);
executed 15681 times by 1 test: return SHA224_Update(EVP_MD_CTX_md_data(ctx), data, count);
Executed by:
  • libcrypto.so.1.1
15681
112}-
113-
114static int final224(EVP_MD_CTX *ctx, unsigned char *md)-
115{-
116 return
executed 51 times by 1 test: return SHA224_Final(md, EVP_MD_CTX_md_data(ctx));
Executed by:
  • libcrypto.so.1.1
SHA224_Final(md, EVP_MD_CTX_md_data(ctx));
executed 51 times by 1 test: return SHA224_Final(md, EVP_MD_CTX_md_data(ctx));
Executed by:
  • libcrypto.so.1.1
51
117}-
118-
119static int init256(EVP_MD_CTX *ctx)-
120{-
121 return
executed 276922 times by 2 tests: return SHA256_Init(EVP_MD_CTX_md_data(ctx));
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
SHA256_Init(EVP_MD_CTX_md_data(ctx));
executed 276922 times by 2 tests: return SHA256_Init(EVP_MD_CTX_md_data(ctx));
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
276922
122}-
123-
124static int update256(EVP_MD_CTX *ctx, const void *data, size_t count)-
125{-
126 return
executed 978004 times by 2 tests: return SHA256_Update(EVP_MD_CTX_md_data(ctx), data, count);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
SHA256_Update(EVP_MD_CTX_md_data(ctx), data, count);
executed 978004 times by 2 tests: return SHA256_Update(EVP_MD_CTX_md_data(ctx), data, count);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
978004
127}-
128-
129static int final256(EVP_MD_CTX *ctx, unsigned char *md)-
130{-
131 return
executed 332776 times by 2 tests: return SHA256_Final(md, EVP_MD_CTX_md_data(ctx));
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
SHA256_Final(md, EVP_MD_CTX_md_data(ctx));
executed 332776 times by 2 tests: return SHA256_Final(md, EVP_MD_CTX_md_data(ctx));
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
332776
132}-
133-
134static const EVP_MD sha224_md = {-
135 675,-
136 671,-
137 28,-
138 0x0008,-
139 init224,-
140 update224,-
141 final224,-
142 -
143 ((void *)0)-
144 ,-
145 -
146 ((void *)0)-
147 ,-
148 (16*4),-
149 sizeof(EVP_MD *) + sizeof(SHA256_CTX),-
150};-
151-
152const EVP_MD *EVP_sha224(void)-
153{-
154 return
executed 3927 times by 1 test: return &sha224_md;
Executed by:
  • libcrypto.so.1.1
&sha224_md;
executed 3927 times by 1 test: return &sha224_md;
Executed by:
  • libcrypto.so.1.1
3927
155}-
156-
157static const EVP_MD sha256_md = {-
158 672,-
159 668,-
160 32,-
161 0x0008,-
162 init256,-
163 update256,-
164 final256,-
165 -
166 ((void *)0)-
167 ,-
168 -
169 ((void *)0)-
170 ,-
171 (16*4),-
172 sizeof(EVP_MD *) + sizeof(SHA256_CTX),-
173};-
174-
175const EVP_MD *EVP_sha256(void)-
176{-
177 return
executed 11264 times by 2 tests: return &sha256_md;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
&sha256_md;
executed 11264 times by 2 tests: return &sha256_md;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
11264
178}-
179-
180static int init512_224(EVP_MD_CTX *ctx)-
181{-
182 return
executed 7 times by 1 test: return sha512_224_init(EVP_MD_CTX_md_data(ctx));
Executed by:
  • libcrypto.so.1.1
sha512_224_init(EVP_MD_CTX_md_data(ctx));
executed 7 times by 1 test: return sha512_224_init(EVP_MD_CTX_md_data(ctx));
Executed by:
  • libcrypto.so.1.1
7
183}-
184-
185static int init512_256(EVP_MD_CTX *ctx)-
186{-
187 return
executed 7 times by 1 test: return sha512_256_init(EVP_MD_CTX_md_data(ctx));
Executed by:
  • libcrypto.so.1.1
sha512_256_init(EVP_MD_CTX_md_data(ctx));
executed 7 times by 1 test: return sha512_256_init(EVP_MD_CTX_md_data(ctx));
Executed by:
  • libcrypto.so.1.1
7
188}-
189-
190static int init384(EVP_MD_CTX *ctx)-
191{-
192 return
executed 66329 times by 1 test: return SHA384_Init(EVP_MD_CTX_md_data(ctx));
Executed by:
  • libcrypto.so.1.1
SHA384_Init(EVP_MD_CTX_md_data(ctx));
executed 66329 times by 1 test: return SHA384_Init(EVP_MD_CTX_md_data(ctx));
Executed by:
  • libcrypto.so.1.1
66329
193}-
194-
195static int update384(EVP_MD_CTX *ctx, const void *data, size_t count)-
196{-
197 return
executed 190411 times by 1 test: return SHA384_Update(EVP_MD_CTX_md_data(ctx), data, count);
Executed by:
  • libcrypto.so.1.1
SHA384_Update(EVP_MD_CTX_md_data(ctx), data, count);
executed 190411 times by 1 test: return SHA384_Update(EVP_MD_CTX_md_data(ctx), data, count);
Executed by:
  • libcrypto.so.1.1
190411
198}-
199-
200static int final384(EVP_MD_CTX *ctx, unsigned char *md)-
201{-
202 return
executed 86807 times by 1 test: return SHA384_Final(md, EVP_MD_CTX_md_data(ctx));
Executed by:
  • libcrypto.so.1.1
SHA384_Final(md, EVP_MD_CTX_md_data(ctx));
executed 86807 times by 1 test: return SHA384_Final(md, EVP_MD_CTX_md_data(ctx));
Executed by:
  • libcrypto.so.1.1
86807
203}-
204-
205static int init512(EVP_MD_CTX *ctx)-
206{-
207 return
executed 233813 times by 1 test: return SHA512_Init(EVP_MD_CTX_md_data(ctx));
Executed by:
  • libcrypto.so.1.1
SHA512_Init(EVP_MD_CTX_md_data(ctx));
executed 233813 times by 1 test: return SHA512_Init(EVP_MD_CTX_md_data(ctx));
Executed by:
  • libcrypto.so.1.1
233813
208}-
209-
210-
211static int update512(EVP_MD_CTX *ctx, const void *data, size_t count)-
212{-
213 return
executed 853277 times by 1 test: return SHA512_Update(EVP_MD_CTX_md_data(ctx), data, count);
Executed by:
  • libcrypto.so.1.1
SHA512_Update(EVP_MD_CTX_md_data(ctx), data, count);
executed 853277 times by 1 test: return SHA512_Update(EVP_MD_CTX_md_data(ctx), data, count);
Executed by:
  • libcrypto.so.1.1
853277
214}-
215-
216static int final512(EVP_MD_CTX *ctx, unsigned char *md)-
217{-
218 return
executed 258396 times by 1 test: return SHA512_Final(md, EVP_MD_CTX_md_data(ctx));
Executed by:
  • libcrypto.so.1.1
SHA512_Final(md, EVP_MD_CTX_md_data(ctx));
executed 258396 times by 1 test: return SHA512_Final(md, EVP_MD_CTX_md_data(ctx));
Executed by:
  • libcrypto.so.1.1
258396
219}-
220-
221static const EVP_MD sha512_224_md = {-
222 1094,-
223 1145,-
224 28,-
225 0x0008,-
226 init512_224,-
227 update512,-
228 final512,-
229 -
230 ((void *)0)-
231 ,-
232 -
233 ((void *)0)-
234 ,-
235 (16*8),-
236 sizeof(EVP_MD *) + sizeof(SHA512_CTX),-
237};-
238-
239const EVP_MD *EVP_sha512_224(void)-
240{-
241 return
executed 1969 times by 1 test: return &sha512_224_md;
Executed by:
  • libcrypto.so.1.1
&sha512_224_md;
executed 1969 times by 1 test: return &sha512_224_md;
Executed by:
  • libcrypto.so.1.1
1969
242}-
243-
244static const EVP_MD sha512_256_md = {-
245 1095,-
246 1146,-
247 32,-
248 0x0008,-
249 init512_256,-
250 update512,-
251 final512,-
252 -
253 ((void *)0)-
254 ,-
255 -
256 ((void *)0)-
257 ,-
258 (16*8),-
259 sizeof(EVP_MD *) + sizeof(SHA512_CTX),-
260};-
261-
262const EVP_MD *EVP_sha512_256(void)-
263{-
264 return
executed 1969 times by 1 test: return &sha512_256_md;
Executed by:
  • libcrypto.so.1.1
&sha512_256_md;
executed 1969 times by 1 test: return &sha512_256_md;
Executed by:
  • libcrypto.so.1.1
1969
265}-
266-
267static const EVP_MD sha384_md = {-
268 673,-
269 669,-
270 48,-
271 0x0008,-
272 init384,-
273 update384,-
274 final384,-
275 -
276 ((void *)0)-
277 ,-
278 -
279 ((void *)0)-
280 ,-
281 (16*8),-
282 sizeof(EVP_MD *) + sizeof(SHA512_CTX),-
283};-
284-
285const EVP_MD *EVP_sha384(void)-
286{-
287 return
executed 3927 times by 1 test: return &sha384_md;
Executed by:
  • libcrypto.so.1.1
&sha384_md;
executed 3927 times by 1 test: return &sha384_md;
Executed by:
  • libcrypto.so.1.1
3927
288}-
289-
290static const EVP_MD sha512_md = {-
291 674,-
292 670,-
293 64,-
294 0x0008,-
295 init512,-
296 update512,-
297 final512,-
298 -
299 ((void *)0)-
300 ,-
301 -
302 ((void *)0)-
303 ,-
304 (16*8),-
305 sizeof(EVP_MD *) + sizeof(SHA512_CTX),-
306};-
307-
308const EVP_MD *EVP_sha512(void)-
309{-
310 return
executed 3937 times by 1 test: return &sha512_md;
Executed by:
  • libcrypto.so.1.1
&sha512_md;
executed 3937 times by 1 test: return &sha512_md;
Executed by:
  • libcrypto.so.1.1
3937
311}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2