about summary refs log tree commit diff stats
path: root/src/omemo/crypto.h
diff options
context:
space:
mode:
authorPaul Fariello <paul@fariello.eu>2019-02-26 20:33:06 +0140
committerPaul Fariello <paul@fariello.eu>2019-04-10 16:03:50 +0200
commit0fb27dc4961608eb9b088ca659eb087dd2c1cae7 (patch)
treecaf8fd8ac5d330e98376b98f471115303b8cc523 /src/omemo/crypto.h
parentb1ae220aa47ff503fe368e4802061be159dfb42b (diff)
downloadprofani-tty-0fb27dc4961608eb9b088ca659eb087dd2c1cae7.tar.gz
Add OMEMO message encryption and decryption
Diffstat (limited to 'src/omemo/crypto.h')
-rw-r--r--src/omemo/crypto.h14
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);