Bram Moolenaar | 8f4ac01 | 2014-08-10 13:38:34 +0200 | [diff] [blame] | 1 | /* crypt.c */ |
Bram Moolenaar | ef26954 | 2016-01-19 13:22:12 +0100 | [diff] [blame] | 2 | int crypt_method_nr_from_name(char_u *name); |
| 3 | int crypt_method_nr_from_magic(char *ptr, int len); |
Christian Brabandt | f573c6e | 2021-06-20 14:02:16 +0200 | [diff] [blame] | 4 | int crypt_works_inplace(cryptstate_T *state); |
Bram Moolenaar | ef26954 | 2016-01-19 13:22:12 +0100 | [diff] [blame] | 5 | int crypt_get_method_nr(buf_T *buf); |
| 6 | int crypt_whole_undofile(int method_nr); |
| 7 | int crypt_get_header_len(int method_nr); |
Christian Brabandt | 226b28b | 2021-06-21 21:08:08 +0200 | [diff] [blame] | 8 | int crypt_get_max_header_len(void); |
Bram Moolenaar | ef26954 | 2016-01-19 13:22:12 +0100 | [diff] [blame] | 9 | void crypt_set_cm_option(buf_T *buf, int method_nr); |
| 10 | int crypt_self_test(void); |
| 11 | cryptstate_T *crypt_create(int method_nr, char_u *key, char_u *salt, int salt_len, char_u *seed, int seed_len); |
| 12 | cryptstate_T *crypt_create_from_header(int method_nr, char_u *key, char_u *header); |
| 13 | cryptstate_T *crypt_create_from_file(FILE *fp, char_u *key); |
| 14 | cryptstate_T *crypt_create_for_writing(int method_nr, char_u *key, char_u **header, int *header_len); |
| 15 | void crypt_free_state(cryptstate_T *state); |
Christian Brabandt | f573c6e | 2021-06-20 14:02:16 +0200 | [diff] [blame] | 16 | long crypt_encode_alloc(cryptstate_T *state, char_u *from, size_t len, char_u **newptr, int last); |
| 17 | long crypt_decode_alloc(cryptstate_T *state, char_u *ptr, long len, char_u **newptr, int last); |
| 18 | void crypt_encode(cryptstate_T *state, char_u *from, size_t len, char_u *to, int last); |
| 19 | void crypt_encode_inplace(cryptstate_T *state, char_u *buf, size_t len, int last); |
| 20 | 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] | 21 | void crypt_free_key(char_u *key); |
| 22 | void crypt_check_method(int method); |
| 23 | void crypt_check_current_method(void); |
| 24 | char_u *crypt_get_key(int store, int twice); |
| 25 | void crypt_append_msg(buf_T *buf); |
Christian Brabandt | f573c6e | 2021-06-20 14:02:16 +0200 | [diff] [blame] | 26 | int crypt_sodium_init(cryptstate_T *state, char_u *key, char_u *salt, int salt_len, char_u *seed, int seed_len); |
Christian Brabandt | f573c6e | 2021-06-20 14:02:16 +0200 | [diff] [blame] | 27 | long crypt_sodium_buffer_encode(cryptstate_T *state, char_u *from, size_t len, char_u **buf_out, int last); |
| 28 | long crypt_sodium_buffer_decode(cryptstate_T *state, char_u *from, size_t len, char_u **buf_out, int last); |
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); |
Bram Moolenaar | 8f4ac01 | 2014-08-10 13:38:34 +0200 | [diff] [blame] | 31 | /* vim: set ft=c : */ |