aboutsummaryrefslogtreecommitdiff
path: root/libcmix-crypto/api.h
diff options
context:
space:
mode:
authorDennis Brentjes <d.brentjes@gmail.com>2017-02-11 14:48:52 +0100
committerDennis Brentjes <d.brentjes@gmail.com>2017-02-11 17:54:40 +0100
commit623dffe2c054d1639dbf9c8f21ddfb088c7950fb (patch)
treef8159c5b3cf9872f9b271d03ad5a4b65ecec19b8 /libcmix-crypto/api.h
parentb229dc91d8825689c5e66264b462ce01398e621e (diff)
downloadcmix-623dffe2c054d1639dbf9c8f21ddfb088c7950fb.tar.gz
cmix-623dffe2c054d1639dbf9c8f21ddfb088c7950fb.tar.bz2
cmix-623dffe2c054d1639dbf9c8f21ddfb088c7950fb.zip
Working Ed25519 Implementation of libcmix.
Diffstat (limited to 'libcmix-crypto/api.h')
-rw-r--r--libcmix-crypto/api.h28
1 files changed, 26 insertions, 2 deletions
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
@@ -63,6 +63,16 @@ 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);
+
+/*!
+ *
+ */
typedef void(*PubKeyHashGetter)(char** buffer, size_t* len, GroupElement const pub);
/*!
@@ -88,7 +98,12 @@ typedef GroupElement(*KeyExchangeValueGetter)(GroupElement);
/*!
*
*/
-typedef GroupElement(*GroupElementMultiplier)(GroupElement, GroupElement, bool);
+typedef GroupElement(*GroupElementCombiner)(GroupElement, GroupElement, bool);
+
+/*!
+ *
+ */
+typedef GroupElement(*GroupElementUncombiner)(GroupElement, GroupElement, bool);
/*!
*
@@ -98,6 +113,11 @@ typedef size_t(*GroupElementArraySizeGetter)();
/*!
*
*/
+typedef size_t(*MessageSizeGetter)();
+
+/*!
+ *
+ */
typedef void(*GroupElementDeleter)(GroupElement);
/*!
@@ -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