Move file encryption function to public header

This commit is contained in:
William Wennerström
2020-06-28 15:16:03 +02:00
parent e98644f631
commit f4ab1ca9e7
8 changed files with 59 additions and 83 deletions

View File

@@ -33,13 +33,13 @@
*
*/
#include <stdio.h>
#include <stdbool.h>
#include <signal/signal_protocol_types.h>
#define AES128_GCM_KEY_LENGTH 16
#define AES128_GCM_IV_LENGTH 12
#define AES128_GCM_TAG_LENGTH 16
#define AES256_GCM_URL_SCHEME "aesgcm"
#define AES256_GCM_KEY_LENGTH 32
#define AES256_GCM_NONCE_LENGTH 12
@@ -186,9 +186,8 @@ int aes128gcm_decrypt(unsigned char *plaintext,
size_t ciphertext_len, const unsigned char *const iv, size_t iv_len,
const unsigned char *const key, const unsigned char *const tag);
char *aes256gcm_encrypt_file(FILE *in, FILE *out, off_t file_size, int *gcry_res);
int aes256gcm_crypt_file(FILE *in, FILE *out, off_t file_size,
unsigned char key[], unsigned char nonce[], bool encrypt);
//int aes256gcm_decrypt_file(FILE *in, FILE *out, off_t file_size,
// unsigned char key[], unsigned char nonce[]);
void aes256gcm_fragment_free(char *fragment);
char *aes256gcm_create_secure_fragment(unsigned char *key,
unsigned char *nonce);