diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-07-12 15:13:30 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-07-12 15:13:30 +1000 |
commit | 81343bc06fc08d8a3ba441e6038c9be1ed093fdc (patch) | |
tree | f0e8452385604b7287d28a5e83d9f8a5d4e591d1 /source/core/StarCurve25519.hpp | |
parent | 70bfb54e5575476450a4f604507e9a8189ca144b (diff) |
Add Curve25519
Diffstat (limited to 'source/core/StarCurve25519.hpp')
-rw-r--r-- | source/core/StarCurve25519.hpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/source/core/StarCurve25519.hpp b/source/core/StarCurve25519.hpp new file mode 100644 index 0000000..15fe4d1 --- /dev/null +++ b/source/core/StarCurve25519.hpp @@ -0,0 +1,25 @@ +#ifndef STAR_CURVE_25519_HPP +#define STAR_CURVE_25519_HPP +#include "StarEncode.hpp" +#include "StarByteArray.hpp" +#include "StarArray.hpp" + +namespace Star::Curve25519 { + +constexpr size_t PublicKeySize = 32; +constexpr size_t SecretKeySize = 32; +constexpr size_t PrivateKeySize = 64; +constexpr size_t SignatureSize = 64; + +typedef Array<uint8_t, PublicKeySize> PublicKey; +typedef Array<uint8_t, SecretKeySize> SecretKey; +typedef Array<uint8_t, PrivateKeySize> PrivateKey; +typedef Array<uint8_t, SignatureSize> Signature; + +PublicKey const& publicKey(); +Signature sign(void* data, size_t len); +bool verify(uint8_t const* signature, uint8_t const* publicKey, void* data, size_t len); + +} + +#endif
\ No newline at end of file |