diff options
Diffstat (limited to 'src/inexact.h')
-rw-r--r-- | src/inexact.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/inexact.h b/src/inexact.h new file mode 100644 index 0000000..f579704 --- /dev/null +++ b/src/inexact.h @@ -0,0 +1,40 @@ +/* Inexact source code package. + * + * Written in 2019 by <ben@hackade.org>. + * + * To the extent possible under law, the author have dedicated all copyright + * and related and neighboring rights to this software to the public domain + * worldwide. This software is distributed without any warranty. + * + * You should have received a copy of the CC0 Public Domain Dedication along with + * this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>. + */ + +#ifndef INEXACT_H +#define INEXACT_H + +#include <stddef.h> + +int generate_keys(const char *seckey_filename, const char *pubkey_filename, + int no_password); +int get_seckey(const char *keyfile, unsigned char *skey, unsigned char *pkey); +int get_pubkey(const char *keyfile, unsigned char *pkey); +int get_symmetrickeys(unsigned char *salt_out, unsigned char *seckey_out, + unsigned char *pubkey_out); +int check_get_symmetrickeys(const unsigned char *data, const size_t data_len, + unsigned char *seckey_out, + unsigned char *pubkey_out); +unsigned char *encrypt_data(const unsigned char *seckey, + const unsigned char *pubkey, + const unsigned char *salt, + const unsigned char *data, size_t data_len, + size_t nonce1_len, size_t tag1_len, + int base64_transformation, size_t *encrypted_len); + +unsigned char *decrypt_data(const unsigned char *seckey, + const unsigned char *pubkey, + const unsigned char *data, size_t data_len, + int symmetric_flag, size_t *data_len_out); + +#endif /* INEXACT_H */ + |