aboutsummaryrefslogtreecommitdiff
path: root/lib/endian.h
diff options
context:
space:
mode:
authoraqua <aqua@iserlohn-fortress.net>2022-12-31 16:03:20 +0200
committeraqua <aqua@iserlohn-fortress.net>2023-01-29 11:41:29 +0200
commitf6b7365dc8759d6df5d340e4a68fb75537c07be4 (patch)
treec15614d8dee445dd4c6ae75da2959c701e69daae /lib/endian.h
parentMove blake2s selftest to test/ (diff)
downloadkernel-f6b7365dc8759d6df5d340e4a68fb75537c07be4.tar.xz
blake2: use makefiles instead of meson.build
Diffstat (limited to 'lib/endian.h')
-rw-r--r--lib/endian.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/endian.h b/lib/endian.h
new file mode 100644
index 0000000..70bc5f7
--- /dev/null
+++ b/lib/endian.h
@@ -0,0 +1,17 @@
+//=====================================================================
+// spdx-license-identifier: ISC
+//=====================================================================
+
+#pragma once
+
+#include <stdint.h>
+
+// These functions convert the byte encoding of integer values from host byte order to and from little-endian and
+// big-endian byte order
+uint16_t htole16(uint16_t host_16b);
+uint32_t htole32(uint32_t host_32b);
+uint64_t htole64(uint64_t host_64b);
+
+uint16_t htobe16(uint16_t host_16b);
+uint32_t htobe32(uint32_t host_32b);
+uint64_t htobe64(uint64_t host_64b);