Add definitions for keys and signature
This commit is contained in:
parent
9f8d9a9f51
commit
aa6cc17154
43
include/relay/CryptoPrimitives.h
Normal file
43
include/relay/CryptoPrimitives.h
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#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)
|
Loading…
Reference in New Issue
Block a user