File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,12 @@ uint64_t static inline ReadBE64(const unsigned char* ptr)
70
70
return be64toh_internal (x);
71
71
}
72
72
73
+ void static inline WriteBE16 (unsigned char * ptr, uint16_t x)
74
+ {
75
+ uint16_t v = htobe16_internal (x);
76
+ memcpy (ptr, &v, 2 );
77
+ }
78
+
73
79
void static inline WriteBE32 (unsigned char * ptr, uint32_t x)
74
80
{
75
81
uint32_t v = htobe32_internal (x);
Original file line number Diff line number Diff line change @@ -35,6 +35,10 @@ FUZZ_TARGET(crypto_common)
35
35
WriteLE64 (writele64_arr.data (), random_u64);
36
36
assert (ReadLE64 (writele64_arr.data ()) == random_u64);
37
37
38
+ std::array<uint8_t , 2 > writebe16_arr;
39
+ WriteBE16 (writebe16_arr.data (), random_u16);
40
+ assert (ReadBE16 (writebe16_arr.data ()) == random_u16);
41
+
38
42
std::array<uint8_t , 4 > writebe32_arr;
39
43
WriteBE32 (writebe32_arr.data (), random_u32);
40
44
assert (ReadBE32 (writebe32_arr.data ()) == random_u32);
You can’t perform that action at this time.
0 commit comments