aboutsummaryrefslogtreecommitdiff
path: root/libcmix-crypto/elgamal/elgamal.h
diff options
context:
space:
mode:
authorDennis Brentjes <d.brentjes@gmail.com>2016-10-27 09:25:53 +0200
committerDennis Brentjes <d.brentjes@gmail.com>2016-10-27 09:25:53 +0200
commit25db9ff8a4cfb4b98aeeaae360e8c718b9c5e20c (patch)
tree079ea63fcc874506072a91b13d2612b510cf158e /libcmix-crypto/elgamal/elgamal.h
parent9eaf47d5dfa56ca79ae903aabfc2cf52bdfb981e (diff)
downloadcmix-25db9ff8a4cfb4b98aeeaae360e8c718b9c5e20c.tar.gz
cmix-25db9ff8a4cfb4b98aeeaae360e8c718b9c5e20c.tar.bz2
cmix-25db9ff8a4cfb4b98aeeaae360e8c718b9c5e20c.zip
Adds libgcrypt implementation for elgamal in multiplicative group.
Also adapts the API to both handle sodium and gcrypt libraries.
Diffstat (limited to 'libcmix-crypto/elgamal/elgamal.h')
-rw-r--r--libcmix-crypto/elgamal/elgamal.h36
1 files changed, 32 insertions, 4 deletions
diff --git a/libcmix-crypto/elgamal/elgamal.h b/libcmix-crypto/elgamal/elgamal.h
index 826ea49..0662827 100644
--- a/libcmix-crypto/elgamal/elgamal.h
+++ b/libcmix-crypto/elgamal/elgamal.h
@@ -11,16 +11,39 @@ extern "C" {
#include "api.h"
/*!
+ * \brief elgamal_initialize initializes the elgamal library
+ */
+extern void elgamal_initialize(void);
+
+/*!
* \brief elgamal_create_keypair
* \return The new keypair
*/
-extern struct KeyPair elgamal_create_keypair();
+extern struct KeyPair elgamal_create_keypair(void);
/*!
* \brief elgamal_keypair_deleter
* \param p the keypair to be freed
*/
-extern void elgamal_keypair_deleter(struct KeyPair p);
+extern void elgamal_keypair_deleter(struct KeyPair* p);
+
+/*!
+ * \brief elgamal_get_pubkey_array
+ * \param buffer
+ * \param len
+ * \param pubkey
+ */
+extern void elgamal_get_key_array(char** buffer, size_t* len, void* pubkey);
+
+/*!
+ * \brief elgamal_add_public_share
+ * \param buffer
+ * \param in_len
+ * \param share
+ * \param in_len
+ * \param pubkey
+ */
+void elgamal_add_public_share(char** buffer, size_t* out_len, char const* share, size_t in_len, void* pubkey);
/*!
* \brief elgamal_derive_shared_key
@@ -29,13 +52,18 @@ extern void elgamal_keypair_deleter(struct KeyPair p);
* \param swap_pub_order Should we swap the order in which we feed the public keys to the hash function.
* \return A Shared key
*/
-extern struct SharedKey elgamal_derive_shared_key(struct KeyPair pair, unsigned char const* pub_key, bool swap_pub_order);
+extern struct SharedKey elgamal_derive_shared_key(struct KeyPair pair, void const* pub_key, bool swap_pub_order);
/*!
* \brief elgamal_shared_key_deleter
* \param s The shared key to be freed.
*/
-extern void elgamal_shared_key_deleter(struct SharedKey s);
+extern void elgamal_shared_key_deleter(struct SharedKey* s);
+
+/*!
+ * \brief elgamal_deinitialize deinitializes the elgamal_library
+ */
+void elgamal_deinitialize(void);
/*!
* \brief get_elgamal_implementation