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); |
| 7 | int crypt_whole_undofile(int method_nr); |
| 8 | int crypt_get_header_len(int method_nr); |
Christian Brabandt | 226b28b | 2021-06-21 21:08:08 +0200 | [diff] [blame] | 9 | int crypt_get_max_header_len(void); |
Bram Moolenaar | ef26954 | 2016-01-19 13:22:12 +0100 | [diff] [blame] | 10 | void crypt_set_cm_option(buf_T *buf, int method_nr); |
| 11 | int crypt_self_test(void); |
| 12 | cryptstate_T *crypt_create(int method_nr, char_u *key, char_u *salt, int salt_len, char_u *seed, int seed_len); |
| 13 | cryptstate_T *crypt_create_from_header(int method_nr, char_u *key, char_u *header); |
| 14 | cryptstate_T *crypt_create_from_file(FILE *fp, char_u *key); |
| 15 | cryptstate_T *crypt_create_for_writing(int method_nr, char_u *key, char_u **header, int *header_len); |
| 16 | void crypt_free_state(cryptstate_T *state); |
Christian Brabandt | f573c6e | 2021-06-20 14:02:16 +0200 | [diff] [blame] | 17 | long crypt_encode_alloc(cryptstate_T *state, char_u *from, size_t len, char_u **newptr, int last); |
| 18 | long crypt_decode_alloc(cryptstate_T *state, char_u *ptr, long len, char_u **newptr, int last); |
| 19 | void crypt_encode(cryptstate_T *state, char_u *from, size_t len, char_u *to, int last); |
| 20 | void crypt_encode_inplace(cryptstate_T *state, char_u *buf, size_t len, int last); |
| 21 | 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] | 22 | void crypt_free_key(char_u *key); |
| 23 | void crypt_check_method(int method); |
| 24 | void crypt_check_current_method(void); |
| 25 | char_u *crypt_get_key(int store, int twice); |
| 26 | void crypt_append_msg(buf_T *buf); |
K.Takata | 1a8825d | 2022-01-19 13:32:57 +0000 | [diff] [blame] | 27 | int crypt_sodium_munlock(void *const addr, const size_t len); |
| 28 | void crypt_sodium_randombytes_buf(void *const buf, const size_t size); |
K.Takata | a8cdb4e | 2022-12-06 16:17:01 +0000 | [diff] [blame] | 29 | int crypt_sodium_init(void); |
| 30 | uint32_t crypt_sodium_randombytes_random(void); |
Bram Moolenaar | 8f4ac01 | 2014-08-10 13:38:34 +0200 | [diff] [blame] | 31 | /* vim: set ft=c : */ |