aboutsummaryrefslogtreecommitdiff
path: root/libcmix-crypto/api.h
diff options
context:
space:
mode:
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