OpenCoverage

blake2_impl.h

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/blake2/blake2_impl.h
Switch to Source codePreprocessed file
LineSourceCount
1static inline uint32_t load32(const uint8_t *src)-
2{-
3 const union {-
4 long one;-
5 char little;-
6 } is_endian = { 1 };-
7-
8 if (is_endian.little
is_endian.littleDescription
TRUEevaluated 280 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-280
9 uint32_t w;-
10 memcpy(&w, src, sizeof(w));-
11 return
executed 280 times by 1 test: return w;
Executed by:
  • libcrypto.so.1.1
w;
executed 280 times by 1 test: return w;
Executed by:
  • libcrypto.so.1.1
280
12 } else {-
13 uint32_t w = ((uint32_t)src[0])-
14 | ((uint32_t)src[1] << 8)-
15 | ((uint32_t)src[2] << 16)-
16 | ((uint32_t)src[3] << 24);-
17 return
never executed: return w;
w;
never executed: return w;
0
18 }-
19}-
20-
21static inline uint64_t load64(const uint8_t *src)-
22{-
23 const union {-
24 long one;-
25 char little;-
26 } is_endian = { 1 };-
27-
28 if (is_endian.little
is_endian.littleDescription
TRUEevaluated 232 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-232
29 uint64_t w;-
30 memcpy(&w, src, sizeof(w));-
31 return
executed 232 times by 1 test: return w;
Executed by:
  • libcrypto.so.1.1
w;
executed 232 times by 1 test: return w;
Executed by:
  • libcrypto.so.1.1
232
32 } else {-
33 uint64_t w = ((uint64_t)src[0])-
34 | ((uint64_t)src[1] << 8)-
35 | ((uint64_t)src[2] << 16)-
36 | ((uint64_t)src[3] << 24)-
37 | ((uint64_t)src[4] << 32)-
38 | ((uint64_t)src[5] << 40)-
39 | ((uint64_t)src[6] << 48)-
40 | ((uint64_t)src[7] << 56);-
41 return
never executed: return w;
w;
never executed: return w;
0
42 }-
43}-
44-
45static inline void store32(uint8_t *dst, uint32_t w)-
46{-
47 const union {-
48 long one;-
49 char little;-
50 } is_endian = { 1 };-
51-
52 if (is_endian.little
is_endian.littleDescription
TRUEevaluated 90 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-90
53 memcpy(dst, &w, sizeof(w));-
54 }
executed 90 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
90
55 uint8_t *p = (uint8_t *)dst;-
56 int i;-
57-
58 for (i = 0; i < 4
i < 4Description
TRUEnever evaluated
FALSEnever evaluated
; i++)
0
59 p[i] = (uint8_t)(w >> (8 * i));
never executed: p[i] = (uint8_t)(w >> (8 * i));
0
60 }
never executed: end of block
0
61}-
62-
63static inline void store64(uint8_t *dst, uint64_t w)-
64{-
65 const union {-
66 long one;-
67 char little;-
68 } is_endian = { 1 };-
69-
70 if (is_endian.little
is_endian.littleDescription
TRUEevaluated 81 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-81
71 memcpy(dst, &w, sizeof(w));-
72 }
executed 81 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
81
73 uint8_t *p = (uint8_t *)dst;-
74 int i;-
75-
76 for (i = 0; i < 8
i < 8Description
TRUEnever evaluated
FALSEnever evaluated
; i++)
0
77 p[i] = (uint8_t)(w >> (8 * i));
never executed: p[i] = (uint8_t)(w >> (8 * i));
0
78 }
never executed: end of block
0
79}-
80-
81static inline uint64_t load48(const uint8_t *src)-
82{-
83 uint64_t w = ((uint64_t)src[0])-
84 | ((uint64_t)src[1] << 8)-
85 | ((uint64_t)src[2] << 16)-
86 | ((uint64_t)src[3] << 24)-
87 | ((uint64_t)src[4] << 32)-
88 | ((uint64_t)src[5] << 40);-
89 return
never executed: return w;
w;
never executed: return w;
0
90}-
91-
92static inline void store48(uint8_t *dst, uint64_t w)-
93{-
94 uint8_t *p = (uint8_t *)dst;-
95 p[0] = (uint8_t)w;-
96 p[1] = (uint8_t)(w>>8);-
97 p[2] = (uint8_t)(w>>16);-
98 p[3] = (uint8_t)(w>>24);-
99 p[4] = (uint8_t)(w>>32);-
100 p[5] = (uint8_t)(w>>40);-
101}
executed 9 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
9
102-
103static inline uint32_t rotr32(const uint32_t w, const unsigned int c)-
104{-
105 return
executed 4160 times by 1 test: return (w >> c) | (w << (32 - c));
Executed by:
  • libcrypto.so.1.1
(w >> c) | (w << (32 - c));
executed 4160 times by 1 test: return (w >> c) | (w << (32 - c));
Executed by:
  • libcrypto.so.1.1
4160
106}-
107-
108static inline uint64_t rotr64(const uint64_t w, const unsigned int c)-
109{-
110 return
executed 3840 times by 1 test: return (w >> c) | (w << (64 - c));
Executed by:
  • libcrypto.so.1.1
(w >> c) | (w << (64 - c));
executed 3840 times by 1 test: return (w >> c) | (w << (64 - c));
Executed by:
  • libcrypto.so.1.1
3840
111}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2