diff options
Diffstat (limited to 'libcmix-crypto')
| -rw-r--r-- | libcmix-crypto/elgamal/elgamal.c | 1 | ||||
| -rw-r--r-- | libcmix-crypto/elgamal/elgamal.h | 2 | ||||
| -rw-r--r-- | libcmix-crypto/elgamal/gcrypt/gcrypt_elgamal.c | 6 |
3 files changed, 9 insertions, 0 deletions
diff --git a/libcmix-crypto/elgamal/elgamal.c b/libcmix-crypto/elgamal/elgamal.c index d103230..607a155 100644 --- a/libcmix-crypto/elgamal/elgamal.c +++ b/libcmix-crypto/elgamal/elgamal.c @@ -11,6 +11,7 @@ struct Api get_elgamal_implementation() .free_buffer = elgamal_free_buffer, .array_to_element = elgamal_array_to_element, .message_to_element = elgamal_message_to_element, + .element_to_message = elgamal_element_to_message, .get_pub_key_hash = elgamal_get_pub_key_hash, .get_pub_key_hash_length = elgamal_get_pub_key_hash_length, .get_group_element = elgamal_get_group_element, diff --git a/libcmix-crypto/elgamal/elgamal.h b/libcmix-crypto/elgamal/elgamal.h index 4cc3013..9788f95 100644 --- a/libcmix-crypto/elgamal/elgamal.h +++ b/libcmix-crypto/elgamal/elgamal.h @@ -24,6 +24,8 @@ extern ArrayToElement elgamal_array_to_element; extern MessageToElement elgamal_message_to_element; +extern ElementToMessage elgamal_element_to_message; + extern PubKeyHashGetter elgamal_get_pub_key_hash; extern PubKeyHashLengthGetter elgamal_get_pub_key_hash_length; diff --git a/libcmix-crypto/elgamal/gcrypt/gcrypt_elgamal.c b/libcmix-crypto/elgamal/gcrypt/gcrypt_elgamal.c index dff75b1..4e6115c 100644 --- a/libcmix-crypto/elgamal/gcrypt/gcrypt_elgamal.c +++ b/libcmix-crypto/elgamal/gcrypt/gcrypt_elgamal.c @@ -149,6 +149,11 @@ GroupElement gcrypt_elgamal_message_to_element(char const* buffer, size_t len, b return gcrypt_elgamal_array_to_element(buffer, len, secure); } +void gcrypt_elgamal_element_to_message(unsigned char** buffer, GroupElement el) { + size_t len; + gcrypt_elgamal_element_to_array(buffer, &len, el); +} + void gcrypt_elgamal_get_pub_key_hash(char** buffer, size_t* len, GroupElement const pub) { gcry_sexp_t pubkey; gcry_error_t error; @@ -366,6 +371,7 @@ ElementToArray elgamal_element_to_array = &gcrypt_elgamal_element_to_array; BufferDeleter elgamal_free_buffer = &gcrypt_elgamal_free_buffer; ArrayToElement elgamal_array_to_element = &gcrypt_elgamal_array_to_element; MessageToElement elgamal_message_to_element = &gcrypt_elgamal_message_to_element; +ElementToMessage elgamal_element_to_message = &gcrypt_elgamal_element_to_message; PubKeyHashGetter elgamal_get_pub_key_hash = &gcrypt_elgamal_get_pub_key_hash; PubKeyHashLengthGetter elgamal_get_pub_key_hash_length = &gcrypt_elgamal_get_pub_key_hash_length; GroupElementGetter elgamal_get_group_element = &gcrypt_elgamal_get_group_element; |
