blob: 560e30b8dca72653838efdcec19b5cd1e0846232 [file] [log] [blame]
Bram Moolenaar8f4ac012014-08-10 13:38:34 +02001/* crypt.c */
K.Takatad68b2fc2022-02-12 11:18:37 +00002int sodium_enabled(int verbose);
Bram Moolenaaref269542016-01-19 13:22:12 +01003int crypt_method_nr_from_name(char_u *name);
4int crypt_method_nr_from_magic(char *ptr, int len);
Christian Brabandtf573c6e2021-06-20 14:02:16 +02005int crypt_works_inplace(cryptstate_T *state);
Bram Moolenaaref269542016-01-19 13:22:12 +01006int crypt_get_method_nr(buf_T *buf);
7int crypt_whole_undofile(int method_nr);
8int crypt_get_header_len(int method_nr);
Christian Brabandt226b28b2021-06-21 21:08:08 +02009int crypt_get_max_header_len(void);
Bram Moolenaaref269542016-01-19 13:22:12 +010010void crypt_set_cm_option(buf_T *buf, int method_nr);
11int crypt_self_test(void);
12cryptstate_T *crypt_create(int method_nr, char_u *key, char_u *salt, int salt_len, char_u *seed, int seed_len);
13cryptstate_T *crypt_create_from_header(int method_nr, char_u *key, char_u *header);
14cryptstate_T *crypt_create_from_file(FILE *fp, char_u *key);
15cryptstate_T *crypt_create_for_writing(int method_nr, char_u *key, char_u **header, int *header_len);
16void crypt_free_state(cryptstate_T *state);
Christian Brabandtf573c6e2021-06-20 14:02:16 +020017long crypt_encode_alloc(cryptstate_T *state, char_u *from, size_t len, char_u **newptr, int last);
18long crypt_decode_alloc(cryptstate_T *state, char_u *ptr, long len, char_u **newptr, int last);
19void crypt_encode(cryptstate_T *state, char_u *from, size_t len, char_u *to, int last);
20void crypt_encode_inplace(cryptstate_T *state, char_u *buf, size_t len, int last);
21void crypt_decode_inplace(cryptstate_T *state, char_u *buf, size_t len, int last);
Bram Moolenaaref269542016-01-19 13:22:12 +010022void crypt_free_key(char_u *key);
23void crypt_check_method(int method);
24void crypt_check_current_method(void);
25char_u *crypt_get_key(int store, int twice);
26void crypt_append_msg(buf_T *buf);
K.Takata1a8825d2022-01-19 13:32:57 +000027int crypt_sodium_munlock(void *const addr, const size_t len);
28void crypt_sodium_randombytes_buf(void *const buf, const size_t size);
K.Takataa8cdb4e2022-12-06 16:17:01 +000029int crypt_sodium_init(void);
30uint32_t crypt_sodium_randombytes_random(void);
Bram Moolenaar8f4ac012014-08-10 13:38:34 +020031/* vim: set ft=c : */