diff options
author | Paul Fariello <paul@fariello.eu> | 2019-02-26 20:33:06 +0140 |
---|---|---|
committer | Paul Fariello <paul@fariello.eu> | 2019-04-10 16:03:50 +0200 |
commit | 0fb27dc4961608eb9b088ca659eb087dd2c1cae7 (patch) | |
tree | caf8fd8ac5d330e98376b98f471115303b8cc523 /src/omemo/crypto.h | |
parent | b1ae220aa47ff503fe368e4802061be159dfb42b (diff) | |
download | profani-tty-0fb27dc4961608eb9b088ca659eb087dd2c1cae7.tar.gz |
Add OMEMO message encryption and decryption
Diffstat (limited to 'src/omemo/crypto.h')
-rw-r--r-- | src/omemo/crypto.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/omemo/crypto.h b/src/omemo/crypto.h index 759cef69..35c5d72a 100644 --- a/src/omemo/crypto.h +++ b/src/omemo/crypto.h @@ -1,6 +1,8 @@ #include <signal/signal_protocol_types.h> -#define SG_CIPHER_AES_GCM_NOPADDING 1000 +#define AES128_GCM_KEY_LENGTH 16 +#define AES128_GCM_IV_LENGTH 16 +#define AES128_GCM_TAG_LENGTH 16 int omemo_crypto_init(void); /** @@ -134,3 +136,13 @@ int omemo_decrypt_func(signal_buffer **output, const uint8_t *iv, size_t iv_len, const uint8_t *ciphertext, size_t ciphertext_len, void *user_data); + +int aes128gcm_encrypt(unsigned char *ciphertext, + size_t *ciphertext_len, const unsigned char *const cleartext, + size_t cleatext_len, const unsigned char *const iv, + const unsigned char *const key); + +int aes128gcm_decrypt(unsigned char *plaintext, + size_t *plaintext_len, const unsigned char *const ciphertext, + size_t ciphertext_len, const unsigned char *const iv, + const unsigned char *const key); |