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.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/libcmix-crypto/api.h b/libcmix-crypto/api.h
index 8c40d23..6d701d7 100644
--- a/libcmix-crypto/api.h
+++ b/libcmix-crypto/api.h
@@ -32,7 +32,7 @@ typedef void (*KeyPairDeleter)(struct KeyPair*);
* \brief Defines how a Derived Shared Key function should look like.
* Used to store a pointer to function to a implementation.
*/
-typedef struct SharedKey (*SharedKeyDeriver)(struct KeyPair, unsigned char const*, size_t, unsigned char const*, size_t, GroupElement, bool);
+typedef GroupElement (*SharedKeyDeriver)(struct KeyPair, unsigned char const*, size_t, unsigned char const*, size_t, GroupElement, bool);
/*!
* \brief Defines how a Derived Shared Key deleter function should look like.
@@ -63,7 +63,7 @@ typedef GroupElement(*ArrayToElement)(char const*, size_t size, bool);
/*!
* \brief PublicShareAdder typedef
*/
-typedef void(*PublicShareAdder)(char**, size_t*, char const*, size_t, GroupElement);
+typedef void(*PublicShareAdder)(GroupElement*, char const*, size_t, GroupElement);
/*!
*
@@ -83,6 +83,11 @@ typedef GroupElement(*GroupElementMultiplier)(GroupElement, GroupElement, bool);
/*!
*
*/
+typedef size_t(*GroupElementArraySizeGetter)();
+
+/*!
+ *
+ */
typedef void(*GroupElementDeleter)(GroupElement);
/*!
@@ -95,12 +100,13 @@ typedef void (*Encrypter)(GroupElement*, GroupElement*, GroupElement, GroupEleme
*/
struct Api {
Initializer initialize; ///< Function that will initialize the crypto library.
- KeyPairCreator create_key_pair; ///< Pointer to keypair creation function
- KeyPairDeleter free_key_pair; ///< Pointer to keypair deletor function
+ KeyPairCreator create_keypair; ///< Pointer to keypair creation function
+ KeyPairDeleter free_keypair; ///< Pointer to keypair deletor function
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;
GroupElementGetter get_group_element; ///< get group element
+ GroupElementArraySizeGetter get_group_element_array_size; ///< Return the size required to store a groupelement in an array;
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.