8 #include <openssl/ssl.h>
9 #include <openssl/crypto.h>
10 #include <openssl/err.h>
13 const EVP_CIPHER *cipher;
14 const EVP_MD *md; /* for mac tag */
15 const EVP_MD *kdf_md; /* for KDF */
16 size_t stored_key_length;
17 const EC_KEY *user_key;
28 typedef unsigned char * cryptogram_t;
30 void cryptogram_free(cryptogram_t *cryptogram);
31 unsigned char * cryptogram_key_data(const cryptogram_t *cryptogram);
32 unsigned char * cryptogram_mac_data(const cryptogram_t *cryptogram);
33 unsigned char * cryptogram_body_data(const cryptogram_t *cryptogram);
34 size_t cryptogram_key_length(const cryptogram_t *cryptogram);
35 size_t cryptogram_mac_length(const cryptogram_t *cryptogram);
36 size_t cryptogram_body_length(const cryptogram_t *cryptogram);
37 size_t cryptogram_data_sum_length(const cryptogram_t *cryptogram);
38 size_t cryptogram_total_length(const cryptogram_t *cryptogram);
39 cryptogram_t * cryptogram_alloc(size_t key, size_t mac, size_t body);
40 cryptogram_t * ecies_encrypt(const ies_ctx_t *ctx, const unsigned char *data, size_t length, char *error);
41 unsigned char * ecies_decrypt(const ies_ctx_t *ctx, const cryptogram_t *cryptogram, size_t *length, char *error);
42 ies_ctx_t *create_context(EC_KEY *user_key);