Imported Upstream version 2.6.1
[platform/upstream/cryptsetup.git] / src / utils_luks.h
1 /*
2  * Helper utilities for LUKS in cryptsetup
3  *
4  * Copyright (C) 2018-2023 Red Hat, Inc. All rights reserved.
5  * Copyright (C) 2018-2023 Milan Broz
6  * Copyright (C) 2018-2023 Ondrej Kozina
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21  */
22
23 #ifndef UTILS_LUKS_H
24 #define UTILS_LUKS_H
25
26 #include <stdint.h>
27
28 const char *luksType(const char *type);
29
30 bool isLUKS1(const char *type);
31
32 bool isLUKS2(const char *type);
33
34 int verify_passphrase(int def);
35
36 void set_activation_flags(uint32_t *flags);
37
38 int set_pbkdf_params(struct crypt_device *cd, const char *dev_type);
39
40 int set_tries_tty(void);
41
42 int get_adjusted_key_size(const char *cipher_mode, uint32_t default_size_bits, int integrity_keysize);
43
44 int luksFormat(struct crypt_device **r_cd, char **r_password, size_t *r_passwordLen);
45
46 int reencrypt(int action_argc, const char **action_argv);
47
48 int reencrypt_luks1(const char *device);
49
50 int reencrypt_luks1_in_progress(const char *device);
51
52 #endif /* UTILS_LUKS_H */