diff options
| author | Dennis Brentjes <d.brentjes@gmail.com> | 2016-10-27 13:14:28 +0200 |
|---|---|---|
| committer | Dennis Brentjes <d.brentjes@gmail.com> | 2016-10-27 13:14:28 +0200 |
| commit | 158bf81343054982800d44d507e8e50f2eeb6dd4 (patch) | |
| tree | 6c09867def3377854b08656a4d5d6df7553fc80b /libcmix-crypto/api.h | |
| parent | 25db9ff8a4cfb4b98aeeaae360e8c718b9c5e20c (diff) | |
| download | cmix-158bf81343054982800d44d507e8e50f2eeb6dd4.tar.gz cmix-158bf81343054982800d44d507e8e50f2eeb6dd4.tar.bz2 cmix-158bf81343054982800d44d507e8e50f2eeb6dd4.zip | |
Added proper keyexchange for elgamal-gcrypt.
Diffstat (limited to 'libcmix-crypto/api.h')
| -rw-r--r-- | libcmix-crypto/api.h | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/libcmix-crypto/api.h b/libcmix-crypto/api.h index 5267f33..99f6417 100644 --- a/libcmix-crypto/api.h +++ b/libcmix-crypto/api.h @@ -31,7 +31,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, void const*, bool); +typedef struct SharedKey (*SharedKeyDeriver)(struct KeyPair, unsigned char const*, size_t, unsigned char const*, size_t, void*, bool); /*! * \brief Defines how a Derived Shared Key deleter function should look like. @@ -55,13 +55,31 @@ typedef void(*KeyArrayGetter)(char**, size_t* size, void*); typedef void(*PublicShareAdder)(char**, size_t*, char const*, size_t, void*); /*! + * + */ +typedef void*(*GroupElementGetter)(bool); + +/*! + * + */ +typedef void*(*KeyExchangeValueGetter)(void*); + +/*! + * + */ +typedef void(*GroupElementDeleter)(void*); + +/*! * \brief The Api struct stores pointers to functions of a specific implementation. Like a Curve25519 specific one. */ 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 - KeyArrayGetter get_key_array; ///< Get the array representation of a public key; + KeyArrayGetter get_key_array; ///< Get the array representation of a public key + GroupElementGetter get_group_element; ///< get group element + KeyExchangeValueGetter get_key_exchange_value; ///< get generator *op* group element. + GroupElementDeleter free_group_element; ///< frees a base type of the cryptolibrary. 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 SharedKeyDeleter free_shared_key; ///< Pointer to shared key deleter function |
