From 623dffe2c054d1639dbf9c8f21ddfb088c7950fb Mon Sep 17 00:00:00 2001 From: Dennis Brentjes Date: Sat, 11 Feb 2017 14:48:52 +0100 Subject: Working Ed25519 Implementation of libcmix. --- libcmix-crypto/api.h | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'libcmix-crypto/api.h') diff --git a/libcmix-crypto/api.h b/libcmix-crypto/api.h index 0fa4916..8279dbb 100644 --- a/libcmix-crypto/api.h +++ b/libcmix-crypto/api.h @@ -60,6 +60,16 @@ typedef void(*BufferDeleter)(void*); */ typedef GroupElement(*ArrayToElement)(char const*, size_t size, bool); +/*! + * + */ +typedef GroupElement(*MessageToElement)(char const*, size_t size, bool); + +/*! + * + */ +typedef void(*ElementToMessage)(unsigned char** message, const GroupElement element); + /*! * */ @@ -88,13 +98,23 @@ typedef GroupElement(*KeyExchangeValueGetter)(GroupElement); /*! * */ -typedef GroupElement(*GroupElementMultiplier)(GroupElement, GroupElement, bool); +typedef GroupElement(*GroupElementCombiner)(GroupElement, GroupElement, bool); + +/*! + * + */ +typedef GroupElement(*GroupElementUncombiner)(GroupElement, GroupElement, bool); /*! * */ typedef size_t(*GroupElementArraySizeGetter)(); +/*! + * + */ +typedef size_t(*MessageSizeGetter)(); + /*! * */ @@ -130,13 +150,17 @@ struct Api { ElementToArray element_to_array; ///< Get the array representation of a public key BufferDeleter free_buffer; ///< frees library allocated buffers. ArrayToElement array_to_element; ///< The the GroupElement representation of this array. + MessageToElement message_to_element; ///< Convert Message to element. + ElementToMessage element_to_message; ///< Convert Element to message. PubKeyHashGetter get_pub_key_hash; ///< Get the hash of the public key. PubKeyHashLengthGetter get_pub_key_hash_length; ///< Get the length of the pubkey hash. GroupElementGetter get_group_element; ///< get group element GroupElementArraySizeGetter get_group_element_array_size; ///< Return the size required to store a groupelement in an array; + MessageSizeGetter get_message_size; ///< Retrieve how large a message can be. GroupElementDeleter free_group_element; ///< frees a base type of the cryptolibrary. KeyExchangeValueGetter get_key_exchange_value; ///< get generator *op* group element. - GroupElementMultiplier multiply; ///< Multiplies two groupelements modulo group. + GroupElementCombiner combine; ///< Combines two groupelements modulo group. + GroupElementUncombiner uncombine; ///< Uncombines two groupelements; DecryptionShareGetter get_decryption_share; ///< calculates the first argument to the power of Inverse second argument; PublicShareAdder add_public_share; ///< Adds the public key stored in void* to the existing share. SharedKeyDeriver derive_shared_key; ///< Pointer to shared key derivation function -- cgit v1.2.3-70-g09d2