Bram Moolenaar | 8f4ac01 | 2014-08-10 13:38:34 +0200 | [diff] [blame] | 1 | /* crypt.c */ |
K.Takata | d68b2fc | 2022-02-12 11:18:37 +0000 | [diff] [blame] | 2 | int sodium_enabled(int verbose); |
Bram Moolenaar | ef26954 | 2016-01-19 13:22:12 +0100 | [diff] [blame] | 3 | int crypt_method_nr_from_name(char_u *name); |
| 4 | int crypt_method_nr_from_magic(char *ptr, int len); |
Christian Brabandt | f573c6e | 2021-06-20 14:02:16 +0200 | [diff] [blame] | 5 | int crypt_works_inplace(cryptstate_T *state); |
Bram Moolenaar | ef26954 | 2016-01-19 13:22:12 +0100 | [diff] [blame] | 6 | int crypt_get_method_nr(buf_T *buf); |
Christian Brabandt | aae5834 | 2023-04-23 17:50:22 +0100 | [diff] [blame] | 7 | int crypt_method_is_sodium(int method); |
Bram Moolenaar | ef26954 | 2016-01-19 13:22:12 +0100 | [diff] [blame] | 8 | int crypt_whole_undofile(int method_nr); |
| 9 | int crypt_get_header_len(int method_nr); |
Christian Brabandt | 226b28b | 2021-06-21 21:08:08 +0200 | [diff] [blame] | 10 | int crypt_get_max_header_len(void); |
Bram Moolenaar | ef26954 | 2016-01-19 13:22:12 +0100 | [diff] [blame] | 11 | void crypt_set_cm_option(buf_T *buf, int method_nr); |
| 12 | int crypt_self_test(void); |
Christian Brabandt | aae5834 | 2023-04-23 17:50:22 +0100 | [diff] [blame] | 13 | cryptstate_T *crypt_create(int method_nr, char_u *key, crypt_arg_T *crypt_arg); |
Bram Moolenaar | ef26954 | 2016-01-19 13:22:12 +0100 | [diff] [blame] | 14 | cryptstate_T *crypt_create_from_header(int method_nr, char_u *key, char_u *header); |
| 15 | cryptstate_T *crypt_create_from_file(FILE *fp, char_u *key); |
| 16 | cryptstate_T *crypt_create_for_writing(int method_nr, char_u *key, char_u **header, int *header_len); |
| 17 | void crypt_free_state(cryptstate_T *state); |
Christian Brabandt | f573c6e | 2021-06-20 14:02:16 +0200 | [diff] [blame] | 18 | long crypt_encode_alloc(cryptstate_T *state, char_u *from, size_t len, char_u **newptr, int last); |
| 19 | long crypt_decode_alloc(cryptstate_T *state, char_u *ptr, long len, char_u **newptr, int last); |
| 20 | void crypt_encode(cryptstate_T *state, char_u *from, size_t len, char_u *to, int last); |
| 21 | void crypt_encode_inplace(cryptstate_T *state, char_u *buf, size_t len, int last); |
| 22 | void crypt_decode_inplace(cryptstate_T *state, char_u *buf, size_t len, int last); |
Bram Moolenaar | ef26954 | 2016-01-19 13:22:12 +0100 | [diff] [blame] | 23 | void crypt_free_key(char_u *key); |
| 24 | void crypt_check_method(int method); |
Bram Moolenaar | 3a2a60c | 2023-05-27 18:02:55 +0100 | [diff] [blame] | 25 | void crypt_check_swapfile_curbuf(void); |
Bram Moolenaar | ef26954 | 2016-01-19 13:22:12 +0100 | [diff] [blame] | 26 | void crypt_check_current_method(void); |
| 27 | char_u *crypt_get_key(int store, int twice); |
| 28 | void crypt_append_msg(buf_T *buf); |
K.Takata | 1a8825d | 2022-01-19 13:32:57 +0000 | [diff] [blame] | 29 | int crypt_sodium_munlock(void *const addr, const size_t len); |
| 30 | void crypt_sodium_randombytes_buf(void *const buf, const size_t size); |
K.Takata | a8cdb4e | 2022-12-06 16:17:01 +0000 | [diff] [blame] | 31 | int crypt_sodium_init(void); |
| 32 | uint32_t crypt_sodium_randombytes_random(void); |
Bram Moolenaar | 8f4ac01 | 2014-08-10 13:38:34 +0200 | [diff] [blame] | 33 | /* vim: set ft=c : */ |