diff options
| author | Dennis Brentjes <d.brentjes@gmail.com> | 2016-11-01 17:40:17 +0100 |
|---|---|---|
| committer | Dennis Brentjes <d.brentjes@gmail.com> | 2016-11-01 17:40:17 +0100 |
| commit | 9531b6bea9fb29074c588a4e4e8838f6d9335a2b (patch) | |
| tree | 4d0e9429203bf5976507b43e6663f9fe0b21e6d0 /libcmix-crypto/api.h | |
| parent | bdc26e00ad99f4f670df1a65b5e6439d0dfadc87 (diff) | |
| download | cmix-9531b6bea9fb29074c588a4e4e8838f6d9335a2b.tar.gz cmix-9531b6bea9fb29074c588a4e4e8838f6d9335a2b.tar.bz2 cmix-9531b6bea9fb29074c588a4e4e8838f6d9335a2b.zip | |
Moves cmix calculation stuff outisde of the node class.
Moves the computations and cryptography to the the libcmix library
where we can group and memory manage the underlying crypto-library.
Diffstat (limited to 'libcmix-crypto/api.h')
| -rw-r--r-- | libcmix-crypto/api.h | 14 |
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. |
