blob: d599238593e57b18c953c7154fc085481086e29c [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);
Christian Brabandtaae58342023-04-23 17:50:22 +01007int crypt_method_is_sodium(int method);
Bram Moolenaaref269542016-01-19 13:22:12 +01008int crypt_whole_undofile(int method_nr);
9int crypt_get_header_len(int method_nr);
Christian Brabandt226b28b2021-06-21 21:08:08 +020010int crypt_get_max_header_len(void);
Bram Moolenaaref269542016-01-19 13:22:12 +010011void crypt_set_cm_option(buf_T *buf, int method_nr);
12int crypt_self_test(void);
Christian Brabandtaae58342023-04-23 17:50:22 +010013cryptstate_T *crypt_create(int method_nr, char_u *key, crypt_arg_T *crypt_arg);
Bram Moolenaaref269542016-01-19 13:22:12 +010014cryptstate_T *crypt_create_from_header(int method_nr, char_u *key, char_u *header);
15cryptstate_T *crypt_create_from_file(FILE *fp, char_u *key);
16cryptstate_T *crypt_create_for_writing(int method_nr, char_u *key, char_u **header, int *header_len);
17void crypt_free_state(cryptstate_T *state);
Christian Brabandtf573c6e2021-06-20 14:02:16 +020018long crypt_encode_alloc(cryptstate_T *state, char_u *from, size_t len, char_u **newptr, int last);
19long crypt_decode_alloc(cryptstate_T *state, char_u *ptr, long len, char_u **newptr, int last);
20void crypt_encode(cryptstate_T *state, char_u *from, size_t len, char_u *to, int last);
21void crypt_encode_inplace(cryptstate_T *state, char_u *buf, size_t len, int last);
22void crypt_decode_inplace(cryptstate_T *state, char_u *buf, size_t len, int last);
Bram Moolenaaref269542016-01-19 13:22:12 +010023void crypt_free_key(char_u *key);
24void crypt_check_method(int method);
Bram Moolenaar3a2a60c2023-05-27 18:02:55 +010025void crypt_check_swapfile_curbuf(void);
Bram Moolenaaref269542016-01-19 13:22:12 +010026void crypt_check_current_method(void);
27char_u *crypt_get_key(int store, int twice);
28void crypt_append_msg(buf_T *buf);
K.Takata1a8825d2022-01-19 13:32:57 +000029int crypt_sodium_munlock(void *const addr, const size_t len);
30void crypt_sodium_randombytes_buf(void *const buf, const size_t size);
K.Takataa8cdb4e2022-12-06 16:17:01 +000031int crypt_sodium_init(void);
32uint32_t crypt_sodium_randombytes_random(void);
Bram Moolenaar8f4ac012014-08-10 13:38:34 +020033/* vim: set ft=c : */