From aa6cc17154af5b5cb60c5e48a1991fd943e5d174 Mon Sep 17 00:00:00 2001 From: Christoph Hagen Date: Thu, 14 Dec 2023 09:42:54 +0100 Subject: [PATCH] Add definitions for keys and signature --- include/relay/CryptoPrimitives.h | 43 ++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 include/relay/CryptoPrimitives.h diff --git a/include/relay/CryptoPrimitives.h b/include/relay/CryptoPrimitives.h new file mode 100644 index 0000000..1053367 --- /dev/null +++ b/include/relay/CryptoPrimitives.h @@ -0,0 +1,43 @@ +#pragma once + +#include + +#pragma pack(push, 1) + +/** + * @brief A private key for asymmetric cryptography + */ +typedef struct { + + /// @brief The size of a private key + static const int size = 32; + + uint8_t bytes[size]; + +} PrivateKey; + +/** + * @brief A public key for asymmetric cryptography + */ +typedef struct { + + /// @brief The size of a public key + static const int size = 32; + + uint8_t bytes[size]; + +} PublicKey; + +/** + * @brief A signature of some data using a private key + */ +typedef struct { + + /// @brief The size of a message signature + static const int size = 64; + + uint8_t bytes[size]; + +} Signature; + +#pragma pack(pop) \ No newline at end of file