From e5454e63a086e549f54c23a686ff300b99a83b58 Mon Sep 17 00:00:00 2001 From: "@syxhe" Date: Fri, 4 Apr 2025 21:04:18 -0500 Subject: Make decryptto function also use named temporary files for writing --- src/encryption.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/encryption.h') diff --git a/src/encryption.h b/src/encryption.h index b5fe04e..b02216f 100644 --- a/src/encryption.h +++ b/src/encryption.h @@ -90,12 +90,22 @@ void vxgg_setsodiumfailcb(const vxgg_naclfailcb cb, void *data); // open() with the flags O_TMPFILE, O_WRONLY, O_CLOEXEC, and O_SYNC. Opened with mode S_IRUSR, S_IWUSR int maketmp(const char * const dest); -int encrypttofile(FILE *dst, FILE *src, unsigned char key[crypto_secretstream_xchacha20poly1305_KEYBYTES]); -int decrypttofile(FILE *dst, FILE *src, unsigned char key[crypto_secretstream_xchacha20poly1305_KEYBYTES]); +// Encrypt src to dst using libsodium's xchacha encryption suite +int encrypttofile(FILE *src, FILE *dst, const unsigned char key[crypto_secretstream_xchacha20poly1305_KEYBYTES]); +// Decrypt src to dst using libsodium's xchacha encryption suite +int decrypttofile(FILE *src, FILE *dst, const unsigned char key[crypto_secretstream_xchacha20poly1305_KEYBYTES]); + +// Encrypt file at `target` to `output` using Linux's named temp file system to do it in the background int encryptviatmp(const char * const target, const char * const output, const unsigned char key[crypto_secretstream_xchacha20poly1305_KEYBYTES]); + +// Decrypt the file at `encrypted` to `target` int decryptto(const char * const encrypted, const char * const target, const unsigned char key[crypto_secretstream_xchacha20poly1305_KEYBYTES]); +// +int linkto(const char * const target, int tgfd); + +// int genpassword(char **str, unsigned int words); #endif \ No newline at end of file -- cgit v1.2.3