cecies
|
ECIES decryption implementation using Curve25519 or Curve448, AES256-GCM and MbedTLS. More...
Go to the source code of this file.
Functions | |
CECIES_API int | cecies_curve25519_decrypt (const uint8_t *encrypted_data, size_t encrypted_data_length, int encrypted_data_base64, cecies_curve25519_key private_key, uint8_t **output, size_t *output_length) |
CECIES_API int | cecies_curve448_decrypt (const uint8_t *encrypted_data, size_t encrypted_data_length, int encrypted_data_base64, cecies_curve448_key private_key, uint8_t **output, size_t *output_length) |
ECIES decryption implementation using Curve25519 or Curve448, AES256-GCM and MbedTLS.
CECIES_API int cecies_curve25519_decrypt | ( | const uint8_t * | encrypted_data, |
size_t | encrypted_data_length, | ||
int | encrypted_data_base64, | ||
cecies_curve25519_key | private_key, | ||
uint8_t ** | output, | ||
size_t * | output_length | ||
) |
Decrypts the given data using ECIES, Curve25519 and AES256-GCM.
encrypted_data | The data to decrypt. |
encrypted_data_length | The length of the data array. |
encrypted_data_base64 | Is the input encrypted_data base64-encoded? Pass 0 for false , anything else for true . |
private_key | The private key to decrypt the data with (hex-string, as is the output of cecies_generate_curve25519_keypair()). This is passed by value and will be destroyed after usage! |
output | Where to write the decrypted output into (this will ONLY be allocated if decryption succeeds; if the procedure fails in any way this is left untouched). On success: DO NOT FORGET TO FREE THIS YOURSELF! Use cecies_free() for freeing. |
output_length | Where to write the output buffer length into (how many bytes were written into it). |
0
if decryption succeeded; error codes as defined inside the header file or MbedTLS otherwise. CECIES_API int cecies_curve448_decrypt | ( | const uint8_t * | encrypted_data, |
size_t | encrypted_data_length, | ||
int | encrypted_data_base64, | ||
cecies_curve448_key | private_key, | ||
uint8_t ** | output, | ||
size_t * | output_length | ||
) |
Decrypts the given data using ECIES, Curve448 and AES256-GCM.
encrypted_data | The data to decrypt. |
encrypted_data_length | The length of the data array. |
encrypted_data_base64 | Is the input encrypted_data base64-encoded? Pass 0 for false , anything else for true . |
private_key | The private key to decrypt the data with (hex-string, as is the output of cecies_generate_curve448_keypair()). This is passed by value and will be destroyed after usage! |
output | Where to write the decrypted output into (this will ONLY be allocated if decryption succeeds; if the procedure fails in any way this is left untouched). On success: DO NOT FORGET TO FREE THIS YOURSELF! Use cecies_free() for freeing. |
output_length | Where to write the output buffer length into (how many bytes were written into it). |
0
if decryption succeeded; error codes as defined inside the header file or MbedTLS otherwise.