From 315caaba7e83eb6680a0407ea13e04b5f7739788 Mon Sep 17 00:00:00 2001 From: Mark Haines Date: Tue, 3 Mar 2015 11:18:07 +0000 Subject: Add functions for signing and verifying messages using curve25519 keys --- include/axolotl/crypto.hh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'include/axolotl') diff --git a/include/axolotl/crypto.hh b/include/axolotl/crypto.hh index 162099f..d772f46 100644 --- a/include/axolotl/crypto.hh +++ b/include/axolotl/crypto.hh @@ -48,6 +48,25 @@ void curve25519_shared_secret( ); +/** Signs the message using our private key. + * The output buffer must be at least 64 bytes long. */ +void curve25519_sign( + Curve25519KeyPair const & our_key, + std::uint8_t const * message, std::size_t message_length, + std::uint8_t * output +); + + +/** Verify thei message using their public key. + * The signature input buffer must be 64 bytes long. + * Returns true if the signature is valid. */ +bool curve25519_verify( + Curve25519PublicKey const & their_key, + std::uint8_t const * message, std::size_t message_length, + std::uint8_t const * signature +); + + struct Aes256Key { static const int LENGTH = 32; std::uint8_t key[32]; -- cgit v1.2.3