32#ifndef _LIBCRYPTSETUP_H
33#define _LIBCRYPTSETUP_H
49struct crypt_keyslot_context;
66int crypt_init(
struct crypt_device **cd,
const char *device);
83 const char *data_device);
106 const char *header_device);
142 int (*confirm)(
const char *msg,
void *usrptr),
187#define CRYPT_LOG_NORMAL 0
189#define CRYPT_LOG_ERROR 1
191#define CRYPT_LOG_VERBOSE 2
193#define CRYPT_LOG_DEBUG -1
195#define CRYPT_LOG_DEBUG_JSON -2
208 void (*log)(
int level,
const char *msg,
void *usrptr),
220void crypt_log(
struct crypt_device *cd,
int level,
const char *msg);
229void crypt_logf(
struct crypt_device *cd,
int level,
const char *format, ...);
239#define CRYPT_RNG_URANDOM 0
241#define CRYPT_RNG_RANDOM 1
275#define CRYPT_PBKDF_ITER_TIME_SET (UINT32_C(1) << 0)
277#define CRYPT_PBKDF_NO_BENCHMARK (UINT32_C(1) << 1)
280#define CRYPT_KDF_PBKDF2 "pbkdf2"
282#define CRYPT_KDF_ARGON2I "argon2i"
284#define CRYPT_KDF_ARGON2ID "argon2id"
389 uint64_t metadata_size,
390 uint64_t keyslots_size);
403 uint64_t *metadata_size,
404 uint64_t *keyslots_size);
417#define CRYPT_PLAIN "PLAIN"
419#define CRYPT_LUKS1 "LUKS1"
421#define CRYPT_LUKS2 "LUKS2"
423#define CRYPT_LOOPAES "LOOPAES"
425#define CRYPT_VERITY "VERITY"
427#define CRYPT_TCRYPT "TCRYPT"
429#define CRYPT_INTEGRITY "INTEGRITY"
431#define CRYPT_BITLK "BITLK"
433#define CRYPT_FVAULT2 "FVAULT2"
436#define CRYPT_LUKS NULL
459#define CRYPT_SW_ONLY INT16_C(0)
461#define CRYPT_OPAL_HW_ONLY INT16_C(1)
463#define CRYPT_SW_AND_OPAL_HW INT16_C(2)
548#define CRYPT_VERITY_NO_HEADER (UINT32_C(1) << 0)
550#define CRYPT_VERITY_CHECK_HASH (UINT32_C(1) << 1)
552#define CRYPT_VERITY_CREATE_HASH (UINT32_C(1) << 2)
554#define CRYPT_VERITY_ROOT_HASH_SIGNATURE (UINT32_C(1) << 3)
577#define CRYPT_TCRYPT_LEGACY_MODES (UINT32_C(1) << 0)
579#define CRYPT_TCRYPT_HIDDEN_HEADER (UINT32_C(1) << 1)
581#define CRYPT_TCRYPT_BACKUP_HEADER (UINT32_C(1) << 2)
583#define CRYPT_TCRYPT_SYSTEM_HEADER (UINT32_C(1) << 3)
588#define CRYPT_TCRYPT_VERA_MODES (UINT32_C(1) << 4)
685 const char *cipher_mode,
687 const char *volume_key,
688 size_t volume_key_size,
712 const char *cipher_mode,
714 const char *volume_keys,
715 size_t volume_keys_size,
737#define CRYPT_COMPAT_LEGACY_INTEGRITY_PADDING (UINT32_C(1) << 0)
739#define CRYPT_COMPAT_LEGACY_INTEGRITY_HMAC (UINT32_C(1) << 1)
741#define CRYPT_COMPAT_LEGACY_INTEGRITY_RECALC (UINT32_C(1) << 2)
791 const char *subsystem);
847 const char *requested_type,
866 const char *requested_type,
921 const char *passphrase,
922 size_t passphrase_size);
941 uint64_t keyfile_offset);
951 size_t keyfile_offset);
960 size_t keyfile_size);
973 const char *volume_key,
974 size_t volume_key_size);
1028 struct crypt_keyslot_context *kc);
1038#define CRYPT_ANY_SLOT -1
1056 const char *passphrase,
1057 size_t passphrase_size,
1058 const char *new_passphrase,
1059 size_t new_passphrase_size);
1079 const char *passphrase,
1080 size_t passphrase_size,
1081 const char *new_passphrase,
1082 size_t new_passphrase_size);
1102 const char *keyfile,
1103 size_t keyfile_size,
1104 uint64_t keyfile_offset,
1105 const char *new_keyfile,
1106 size_t new_keyfile_size,
1107 uint64_t new_keyfile_offset);
1114 const char *keyfile,
1115 size_t keyfile_size,
1116 size_t keyfile_offset,
1117 const char *new_keyfile,
1118 size_t new_keyfile_size,
1119 size_t new_keyfile_offset);
1126 const char *keyfile,
1127 size_t keyfile_size,
1128 const char *new_keyfile,
1129 size_t new_keyfile_size);
1147 const char *volume_key,
1148 size_t volume_key_size,
1149 const char *passphrase,
1150 size_t passphrase_size);
1153#define CRYPT_VOLUME_KEY_NO_SEGMENT (UINT32_C(1) << 0)
1156#define CRYPT_VOLUME_KEY_SET (UINT32_C(1) << 1)
1159#define CRYPT_VOLUME_KEY_DIGEST_REUSE (UINT32_C(1) << 2)
1192 const char *volume_key,
1193 size_t volume_key_size,
1194 const char *passphrase,
1195 size_t passphrase_size,
1222 const char *passphrase,
1223 size_t passphrase_size,
1224 struct crypt_keyslot_context **kc);
1239 const char *keyfile,
1240 size_t keyfile_size,
1241 uint64_t keyfile_offset,
1242 struct crypt_keyslot_context **kc);
1261 const char *pin,
size_t pin_size,
1263 struct crypt_keyslot_context **kc);
1278 const char *volume_key,
1279 size_t volume_key_size,
1280 struct crypt_keyslot_context **kc);
1298 const char *volume_key,
1299 size_t volume_key_size,
1300 const char *signature,
1301 size_t signature_size,
1302 struct crypt_keyslot_context **kc);
1316 const char *key_description,
1317 struct crypt_keyslot_context **kc);
1332 const char *key_description,
1333 struct crypt_keyslot_context **kc);
1362 const char *pin,
size_t pin_size,
1363 struct crypt_keyslot_context *kc);
1371#define CRYPT_KC_TYPE_PASSPHRASE INT16_C(1)
1373#define CRYPT_KC_TYPE_KEYFILE INT16_C(2)
1375#define CRYPT_KC_TYPE_TOKEN INT16_C(3)
1377#define CRYPT_KC_TYPE_KEY INT16_C(4)
1381#define CRYPT_KC_TYPE_KEYRING INT16_C(5)
1385#define CRYPT_KC_TYPE_VK_KEYRING INT16_C(6)
1387#define CRYPT_KC_TYPE_SIGNED_KEY INT16_C(7)
1436 int keyslot_existing,
1437 struct crypt_keyslot_context *kc,
1439 struct crypt_keyslot_context *new_kc,
1465#define CRYPT_ACTIVATE_READONLY (UINT32_C(1) << 0)
1467#define CRYPT_ACTIVATE_NO_UUID (UINT32_C(1) << 1)
1469#define CRYPT_ACTIVATE_SHARED (UINT32_C(1) << 2)
1471#define CRYPT_ACTIVATE_ALLOW_DISCARDS (UINT32_C(1) << 3)
1473#define CRYPT_ACTIVATE_PRIVATE (UINT32_C(1) << 4)
1475#define CRYPT_ACTIVATE_CORRUPTED (UINT32_C(1) << 5)
1477#define CRYPT_ACTIVATE_SAME_CPU_CRYPT (UINT32_C(1) << 6)
1479#define CRYPT_ACTIVATE_SUBMIT_FROM_CRYPT_CPUS (UINT32_C(1) << 7)
1481#define CRYPT_ACTIVATE_IGNORE_CORRUPTION (UINT32_C(1) << 8)
1483#define CRYPT_ACTIVATE_RESTART_ON_CORRUPTION (UINT32_C(1) << 9)
1485#define CRYPT_ACTIVATE_IGNORE_ZERO_BLOCKS (UINT32_C(1) << 10)
1487#define CRYPT_ACTIVATE_KEYRING_KEY (UINT32_C(1) << 11)
1489#define CRYPT_ACTIVATE_NO_JOURNAL (UINT32_C(1) << 12)
1491#define CRYPT_ACTIVATE_RECOVERY (UINT32_C(1) << 13)
1493#define CRYPT_ACTIVATE_IGNORE_PERSISTENT (UINT32_C(1) << 14)
1495#define CRYPT_ACTIVATE_CHECK_AT_MOST_ONCE (UINT32_C(1) << 15)
1497#define CRYPT_ACTIVATE_ALLOW_UNBOUND_KEY (UINT32_C(1) << 16)
1499#define CRYPT_ACTIVATE_RECALCULATE (UINT32_C(1) << 17)
1501#define CRYPT_ACTIVATE_REFRESH (UINT32_C(1) << 18)
1503#define CRYPT_ACTIVATE_SERIALIZE_MEMORY_HARD_PBKDF (UINT32_C(1) << 19)
1505#define CRYPT_ACTIVATE_NO_JOURNAL_BITMAP (UINT32_C(1) << 20)
1507#define CRYPT_ACTIVATE_SUSPENDED (UINT32_C(1) << 21)
1509#define CRYPT_ACTIVATE_IV_LARGE_SECTORS (UINT32_C(1) << 22)
1511#define CRYPT_ACTIVATE_PANIC_ON_CORRUPTION (UINT32_C(1) << 23)
1513#define CRYPT_ACTIVATE_NO_READ_WORKQUEUE (UINT32_C(1) << 24)
1515#define CRYPT_ACTIVATE_NO_WRITE_WORKQUEUE (UINT32_C(1) << 25)
1517#define CRYPT_ACTIVATE_RECALCULATE_RESET (UINT32_C(1) << 26)
1519#define CRYPT_ACTIVATE_TASKLETS (UINT32_C(1) << 27)
1568#define CRYPT_REQUIREMENT_OFFLINE_REENCRYPT (UINT32_C(1) << 0)
1570#define CRYPT_REQUIREMENT_ONLINE_REENCRYPT (UINT32_C(1) << 1)
1572#define CRYPT_REQUIREMENT_OPAL (UINT32_C(1) << 2)
1574#define CRYPT_REQUIREMENT_UNKNOWN (UINT32_C(1) << 31)
1654 struct crypt_keyslot_context *kc,
1655 int additional_keyslot,
1656 struct crypt_keyslot_context *additional_kc,
1674 const char *passphrase,
1675 size_t passphrase_size,
1694 const char *keyfile,
1695 size_t keyfile_size,
1696 uint64_t keyfile_offset,
1705 const char *keyfile,
1706 size_t keyfile_size,
1707 size_t keyfile_offset,
1716 const char *keyfile,
1717 size_t keyfile_size,
1745 const char *volume_key,
1746 size_t volume_key_size,
1768 const char *volume_key,
1769 size_t volume_key_size,
1770 const char *signature,
1771 size_t signature_size,
1792 const char *key_description,
1797#define CRYPT_DEACTIVATE_DEFERRED (UINT32_C(1) << 0)
1799#define CRYPT_DEACTIVATE_FORCE (UINT32_C(1) << 1)
1801#define CRYPT_DEACTIVATE_DEFERRED_CANCEL (UINT32_C(1) << 2)
1854 size_t *volume_key_size,
1855 const char *passphrase,
1856 size_t passphrase_size);
1890 size_t *volume_key_size,
1891 struct crypt_keyslot_context *kc);
1907 const char *volume_key,
1908 size_t volume_key_size);
2116 const char *cipher_mode,
2117 size_t volume_key_size,
2120 double *encryption_mbs,
2121 double *decryption_mbs);
2140 const char *password,
2141 size_t password_size,
2144 size_t volume_key_size,
2145 int (*progress)(uint32_t time_ms,
void *usrptr),
2316 const char *requested_type,
2317 const char *backup_file);
2330 const char *requested_type,
2331 const char *backup_file);
2342#define CRYPT_DEBUG_ALL -1
2344#define CRYPT_DEBUG_JSON -2
2346#define CRYPT_DEBUG_NONE 0
2380 const char *keyfile,
2381 char **key,
size_t *key_size_read,
2382 uint64_t keyfile_offset,
2390 const char *keyfile,
2391 char **key,
size_t *key_size_read,
2392 size_t keyfile_offset,
2397#define CRYPT_KEYFILE_STOP_EOL (UINT32_C(1) << 0)
2436 const char *dev_path,
2440 size_t wipe_block_size,
2442 int (*progress)(uint64_t size, uint64_t offset,
void *usrptr),
2447#define CRYPT_WIPE_NO_DIRECT_IO (UINT32_C(1) << 0)
2450 CRYPT_LUKS2_SEGMENT = -2,
2451 CRYPT_NO_SEGMENT = -1,
2473 const char *password,
2474 size_t password_size,
2506#define CRYPT_ANY_TOKEN -1
2673 struct crypt_device *cd,
2703 struct crypt_device *cd,
2756typedef const char * (*crypt_token_version_func) (void);
2803#define CRYPT_TOKEN_ABI_VERSION1 "CRYPTSETUP_TOKEN_1.0"
2806#define CRYPT_TOKEN_ABI_OPEN "cryptsetup_token_open"
2808#define CRYPT_TOKEN_ABI_OPEN_PIN "cryptsetup_token_open_pin"
2810#define CRYPT_TOKEN_ABI_BUFFER_FREE "cryptsetup_token_buffer_free"
2812#define CRYPT_TOKEN_ABI_VALIDATE "cryptsetup_token_validate"
2814#define CRYPT_TOKEN_ABI_DUMP "cryptsetup_token_dump"
2816#define CRYPT_TOKEN_ABI_VERSION "cryptsetup_token_version"
2905#define CRYPT_REENCRYPT_INITIALIZE_ONLY (UINT32_C(1) << 0)
2908#define CRYPT_REENCRYPT_MOVE_FIRST_SEGMENT (UINT32_C(1) << 1)
2910#define CRYPT_REENCRYPT_RESUME_ONLY (UINT32_C(1) << 2)
2912#define CRYPT_REENCRYPT_RECOVERY (UINT32_C(1) << 3)
2914#define CRYPT_REENCRYPT_REPAIR_NEEDED (UINT32_C(1) << 4)
2975 const char *passphrase,
2976 size_t passphrase_size,
2980 const char *cipher_mode,
3004 const char *key_description,
3008 const char *cipher_mode,
3023 int (*progress)(uint64_t size, uint64_t offset,
void *usrptr))
3024__attribute__((deprecated));
3037 int (*progress)(uint64_t size, uint64_t offset,
void *usrptr),
3147 const char* key_description,
3148 const char* old_key_description,
3149 const char* key_type_desc,
3150 const char* keyring_to_link_vk);
int crypt_suspend(struct crypt_device *cd, const char *name)
int crypt_resume_by_keyslot_context(struct crypt_device *cd, const char *name, int keyslot, struct crypt_keyslot_context *kc)
int crypt_resize(struct crypt_device *cd, const char *name, uint64_t new_size)
void crypt_set_compatibility(struct crypt_device *cd, uint32_t flags)
int crypt_set_uuid(struct crypt_device *cd, const char *uuid)
int crypt_resume_by_keyfile_device_offset(struct crypt_device *cd, const char *name, int keyslot, const char *keyfile, size_t keyfile_size, uint64_t keyfile_offset)
int crypt_resume_by_token_pin(struct crypt_device *cd, const char *name, const char *type, int token, const char *pin, size_t pin_size, void *usrptr)
int crypt_resume_by_volume_key(struct crypt_device *cd, const char *name, const char *volume_key, size_t volume_key_size)
int crypt_format_luks2_opal(struct crypt_device *cd, const char *cipher, const char *cipher_mode, const char *uuid, const char *volume_keys, size_t volume_keys_size, struct crypt_params_luks2 *params, struct crypt_params_hw_opal *opal_params)
const char * crypt_get_label(struct crypt_device *cd)
int crypt_volume_key_keyring(struct crypt_device *cd, int enable)
int crypt_format(struct crypt_device *cd, const char *type, const char *cipher, const char *cipher_mode, const char *uuid, const char *volume_key, size_t volume_key_size, void *params)
int crypt_load(struct crypt_device *cd, const char *requested_type, void *params)
const char * crypt_get_subsystem(struct crypt_device *cd)
int crypt_resume_by_keyfile_offset(struct crypt_device *cd, const char *name, int keyslot, const char *keyfile, size_t keyfile_size, size_t keyfile_offset)
int crypt_repair(struct crypt_device *cd, const char *requested_type, void *params)
uint32_t crypt_get_compatibility(struct crypt_device *cd)
int crypt_convert(struct crypt_device *cd, const char *type, void *params)
int crypt_resume_by_passphrase(struct crypt_device *cd, const char *name, int keyslot, const char *passphrase, size_t passphrase_size)
int crypt_set_label(struct crypt_device *cd, const char *label, const char *subsystem)
int crypt_resume_by_keyfile(struct crypt_device *cd, const char *name, int keyslot, const char *keyfile, size_t keyfile_size)
int crypt_deactivate_by_name(struct crypt_device *cd, const char *name, uint32_t flags)
int crypt_activate_by_passphrase(struct crypt_device *cd, const char *name, int keyslot, const char *passphrase, size_t passphrase_size, uint32_t flags)
int crypt_activate_by_signed_key(struct crypt_device *cd, const char *name, const char *volume_key, size_t volume_key_size, const char *signature, size_t signature_size, uint32_t flags)
int crypt_deactivate(struct crypt_device *cd, const char *name)
int crypt_activate_by_keyfile_device_offset(struct crypt_device *cd, const char *name, int keyslot, const char *keyfile, size_t keyfile_size, uint64_t keyfile_offset, uint32_t flags)
int crypt_activate_by_volume_key(struct crypt_device *cd, const char *name, const char *volume_key, size_t volume_key_size, uint32_t flags)
int crypt_activate_by_keyfile_offset(struct crypt_device *cd, const char *name, int keyslot, const char *keyfile, size_t keyfile_size, size_t keyfile_offset, uint32_t flags)
int crypt_activate_by_keyfile(struct crypt_device *cd, const char *name, int keyslot, const char *keyfile, size_t keyfile_size, uint32_t flags)
int crypt_activate_by_keyslot_context(struct crypt_device *cd, const char *name, int keyslot, struct crypt_keyslot_context *kc, int additional_keyslot, struct crypt_keyslot_context *additional_kc, uint32_t flags)
int crypt_activate_by_keyring(struct crypt_device *cd, const char *name, const char *key_description, int keyslot, uint32_t flags)
uint64_t crypt_get_active_integrity_failures(struct crypt_device *cd, const char *name)
int crypt_get_active_device(struct crypt_device *cd, const char *name, struct crypt_active_device *cad)
int crypt_header_backup(struct crypt_device *cd, const char *requested_type, const char *backup_file)
int crypt_header_restore(struct crypt_device *cd, const char *requested_type, const char *backup_file)
int crypt_benchmark(struct crypt_device *cd, const char *cipher, const char *cipher_mode, size_t volume_key_size, size_t iv_size, size_t buffer_size, double *encryption_mbs, double *decryption_mbs)
int crypt_benchmark_pbkdf(struct crypt_device *cd, struct crypt_pbkdf_type *pbkdf, const char *password, size_t password_size, const char *salt, size_t salt_size, size_t volume_key_size, int(*progress)(uint32_t time_ms, void *usrptr), void *usrptr)
void crypt_set_debug_level(int level)
int crypt_dump(struct crypt_device *cd)
const char * crypt_get_cipher_mode(struct crypt_device *cd)
int crypt_get_verity_info(struct crypt_device *cd, struct crypt_params_verity *vp)
int crypt_header_is_detached(struct crypt_device *cd)
uint64_t crypt_get_data_offset(struct crypt_device *cd)
int crypt_get_volume_key_size(struct crypt_device *cd)
int crypt_dump_json(struct crypt_device *cd, const char **json, uint32_t flags)
int crypt_get_sector_size(struct crypt_device *cd)
crypt_status_info
Definition libcryptsetup.h:1920
uint64_t crypt_get_iv_offset(struct crypt_device *cd)
const char * crypt_get_metadata_device_name(struct crypt_device *cd)
const char * crypt_get_device_name(struct crypt_device *cd)
crypt_status_info crypt_status(struct crypt_device *cd, const char *name)
const char * crypt_get_uuid(struct crypt_device *cd)
int crypt_get_integrity_info(struct crypt_device *cd, struct crypt_params_integrity *ip)
const char * crypt_get_cipher(struct crypt_device *cd)
@ CRYPT_INVALID
Definition libcryptsetup.h:1921
@ CRYPT_ACTIVE
Definition libcryptsetup.h:1923
@ CRYPT_INACTIVE
Definition libcryptsetup.h:1922
@ CRYPT_BUSY
Definition libcryptsetup.h:1924
int crypt_init_by_name(struct crypt_device **cd, const char *name)
void crypt_free(struct crypt_device *cd)
int crypt_init_data_device(struct crypt_device **cd, const char *device, const char *data_device)
int crypt_set_data_offset(struct crypt_device *cd, uint64_t data_offset)
int crypt_init_by_name_and_header(struct crypt_device **cd, const char *name, const char *header_device)
int crypt_init(struct crypt_device **cd, const char *device)
void crypt_set_confirm_callback(struct crypt_device *cd, int(*confirm)(const char *msg, void *usrptr), void *usrptr)
int crypt_set_data_device(struct crypt_device *cd, const char *device)
int crypt_volume_key_verify(struct crypt_device *cd, const char *volume_key, size_t volume_key_size)
int crypt_volume_key_get_by_keyslot_context(struct crypt_device *cd, int keyslot, char *volume_key, size_t *volume_key_size, struct crypt_keyslot_context *kc)
int crypt_volume_key_get(struct crypt_device *cd, int keyslot, char *volume_key, size_t *volume_key_size, const char *passphrase, size_t passphrase_size)
int crypt_keyfile_device_read(struct crypt_device *cd, const char *keyfile, char **key, size_t *key_size_read, uint64_t keyfile_offset, size_t key_size, uint32_t flags)
int crypt_keyfile_read(struct crypt_device *cd, const char *keyfile, char **key, size_t *key_size_read, size_t keyfile_offset, size_t key_size, uint32_t flags)
int crypt_set_keyring_to_link(struct crypt_device *cd, const char *key_description, const char *old_key_description, const char *key_type_desc, const char *keyring_to_link_vk)
int crypt_keyslot_context_init_by_signed_key(struct crypt_device *cd, const char *volume_key, size_t volume_key_size, const char *signature, size_t signature_size, struct crypt_keyslot_context **kc)
int crypt_keyslot_context_init_by_keyring(struct crypt_device *cd, const char *key_description, struct crypt_keyslot_context **kc)
int crypt_keyslot_context_set_pin(struct crypt_device *cd, const char *pin, size_t pin_size, struct crypt_keyslot_context *kc)
int crypt_keyslot_context_init_by_keyfile(struct crypt_device *cd, const char *keyfile, size_t keyfile_size, uint64_t keyfile_offset, struct crypt_keyslot_context **kc)
int crypt_keyslot_context_init_by_passphrase(struct crypt_device *cd, const char *passphrase, size_t passphrase_size, struct crypt_keyslot_context **kc)
int crypt_keyslot_context_init_by_vk_in_keyring(struct crypt_device *cd, const char *key_description, struct crypt_keyslot_context **kc)
int crypt_keyslot_context_init_by_token(struct crypt_device *cd, int token, const char *type, const char *pin, size_t pin_size, void *usrptr, struct crypt_keyslot_context **kc)
int crypt_keyslot_context_get_type(const struct crypt_keyslot_context *kc)
int crypt_keyslot_context_get_error(struct crypt_keyslot_context *kc)
int crypt_keyslot_context_init_by_volume_key(struct crypt_device *cd, const char *volume_key, size_t volume_key_size, struct crypt_keyslot_context **kc)
void crypt_keyslot_context_free(struct crypt_keyslot_context *kc)
int crypt_keyslot_add_by_keyslot_context(struct crypt_device *cd, int keyslot_existing, struct crypt_keyslot_context *kc, int keyslot_new, struct crypt_keyslot_context *new_kc, uint32_t flags)
crypt_keyslot_info
Definition libcryptsetup.h:2157
int crypt_keyslot_area(struct crypt_device *cd, int keyslot, uint64_t *offset, uint64_t *length)
int crypt_keyslot_set_encryption(struct crypt_device *cd, const char *cipher, size_t key_size)
int crypt_keyslot_add_by_keyfile(struct crypt_device *cd, int keyslot, const char *keyfile, size_t keyfile_size, const char *new_keyfile, size_t new_keyfile_size)
crypt_keyslot_priority
Definition libcryptsetup.h:2181
int crypt_keyslot_add_by_passphrase(struct crypt_device *cd, int keyslot, const char *passphrase, size_t passphrase_size, const char *new_passphrase, size_t new_passphrase_size)
int crypt_keyslot_change_by_passphrase(struct crypt_device *cd, int keyslot_old, int keyslot_new, const char *passphrase, size_t passphrase_size, const char *new_passphrase, size_t new_passphrase_size)
int crypt_keyslot_add_by_keyfile_device_offset(struct crypt_device *cd, int keyslot, const char *keyfile, size_t keyfile_size, uint64_t keyfile_offset, const char *new_keyfile, size_t new_keyfile_size, uint64_t new_keyfile_offset)
const char * crypt_get_dir(void)
int crypt_keyslot_add_by_key(struct crypt_device *cd, int keyslot, const char *volume_key, size_t volume_key_size, const char *passphrase, size_t passphrase_size, uint32_t flags)
int crypt_keyslot_set_priority(struct crypt_device *cd, int keyslot, crypt_keyslot_priority priority)
int crypt_keyslot_add_by_keyfile_offset(struct crypt_device *cd, int keyslot, const char *keyfile, size_t keyfile_size, size_t keyfile_offset, const char *new_keyfile, size_t new_keyfile_size, size_t new_keyfile_offset)
int crypt_keyslot_add_by_volume_key(struct crypt_device *cd, int keyslot, const char *volume_key, size_t volume_key_size, const char *passphrase, size_t passphrase_size)
int crypt_keyslot_destroy(struct crypt_device *cd, int keyslot)
int crypt_keyslot_get_pbkdf(struct crypt_device *cd, int keyslot, struct crypt_pbkdf_type *pbkdf)
crypt_keyslot_priority crypt_keyslot_get_priority(struct crypt_device *cd, int keyslot)
crypt_keyslot_info crypt_keyslot_status(struct crypt_device *cd, int keyslot)
const char * crypt_keyslot_get_encryption(struct crypt_device *cd, int keyslot, size_t *key_size)
int crypt_keyslot_max(const char *type)
int crypt_keyslot_get_key_size(struct crypt_device *cd, int keyslot)
@ CRYPT_SLOT_UNBOUND
Definition libcryptsetup.h:2163
@ CRYPT_SLOT_ACTIVE_LAST
Definition libcryptsetup.h:2161
@ CRYPT_SLOT_INACTIVE
Definition libcryptsetup.h:2159
@ CRYPT_SLOT_ACTIVE
Definition libcryptsetup.h:2160
@ CRYPT_SLOT_INVALID
Definition libcryptsetup.h:2158
@ CRYPT_SLOT_PRIORITY_IGNORE
Definition libcryptsetup.h:2183
@ CRYPT_SLOT_PRIORITY_INVALID
Definition libcryptsetup.h:2182
@ CRYPT_SLOT_PRIORITY_NORMAL
Definition libcryptsetup.h:2184
@ CRYPT_SLOT_PRIORITY_PREFER
Definition libcryptsetup.h:2185
void crypt_logf(struct crypt_device *cd, int level, const char *format,...)
void crypt_set_log_callback(struct crypt_device *cd, void(*log)(int level, const char *msg, void *usrptr), void *usrptr)
void crypt_log(struct crypt_device *cd, int level, const char *msg)
void crypt_safe_free(void *data)
void crypt_safe_memzero(void *data, size_t size)
void * crypt_safe_alloc(size_t size)
void * crypt_safe_realloc(void *data, size_t size)
int crypt_persistent_flags_get(struct crypt_device *cd, crypt_flags_type type, uint32_t *flags)
crypt_flags_type
Definition libcryptsetup.h:1579
int crypt_persistent_flags_set(struct crypt_device *cd, crypt_flags_type type, uint32_t flags)
@ CRYPT_FLAGS_REQUIREMENTS
Definition libcryptsetup.h:1581
@ CRYPT_FLAGS_ACTIVATION
Definition libcryptsetup.h:1580
int crypt_reencrypt_init_by_keyring(struct crypt_device *cd, const char *name, const char *key_description, int keyslot_old, int keyslot_new, const char *cipher, const char *cipher_mode, const struct crypt_params_reencrypt *params)
crypt_reencrypt_mode_info
Definition libcryptsetup.h:2927
int crypt_reencrypt_run(struct crypt_device *cd, int(*progress)(uint64_t size, uint64_t offset, void *usrptr), void *usrptr)
crypt_reencrypt_info
Definition libcryptsetup.h:3043
int crypt_reencrypt_init_by_passphrase(struct crypt_device *cd, const char *name, const char *passphrase, size_t passphrase_size, int keyslot_old, int keyslot_new, const char *cipher, const char *cipher_mode, const struct crypt_params_reencrypt *params)
crypt_reencrypt_info crypt_reencrypt_status(struct crypt_device *cd, struct crypt_params_reencrypt *params)
int crypt_reencrypt(struct crypt_device *cd, int(*progress)(uint64_t size, uint64_t offset, void *usrptr)) __attribute__((deprecated))
crypt_reencrypt_direction_info
Definition libcryptsetup.h:2919
@ CRYPT_REENCRYPT_ENCRYPT
Definition libcryptsetup.h:2929
@ CRYPT_REENCRYPT_DECRYPT
Definition libcryptsetup.h:2930
@ CRYPT_REENCRYPT_REENCRYPT
Definition libcryptsetup.h:2928
@ CRYPT_REENCRYPT_INVALID
Definition libcryptsetup.h:3047
@ CRYPT_REENCRYPT_NONE
Definition libcryptsetup.h:3044
@ CRYPT_REENCRYPT_CLEAN
Definition libcryptsetup.h:3045
@ CRYPT_REENCRYPT_CRASH
Definition libcryptsetup.h:3046
@ CRYPT_REENCRYPT_BACKWARD
Definition libcryptsetup.h:2921
@ CRYPT_REENCRYPT_FORWARD
Definition libcryptsetup.h:2920
const struct crypt_pbkdf_type * crypt_get_pbkdf_type_params(const char *pbkdf_type)
int crypt_memory_lock(struct crypt_device *cd, int lock) __attribute__((deprecated))
int crypt_get_metadata_size(struct crypt_device *cd, uint64_t *metadata_size, uint64_t *keyslots_size)
const struct crypt_pbkdf_type * crypt_get_pbkdf_default(const char *type)
void crypt_set_rng_type(struct crypt_device *cd, int rng_type)
void crypt_set_iteration_time(struct crypt_device *cd, uint64_t iteration_time_ms)
int crypt_metadata_locking(struct crypt_device *cd, int enable)
const struct crypt_pbkdf_type * crypt_get_pbkdf_type(struct crypt_device *cd)
int crypt_set_metadata_size(struct crypt_device *cd, uint64_t metadata_size, uint64_t keyslots_size)
int crypt_get_rng_type(struct crypt_device *cd)
int crypt_set_pbkdf_type(struct crypt_device *cd, const struct crypt_pbkdf_type *pbkdf)
int(* crypt_token_open_func)(struct crypt_device *cd, int token, char **buffer, size_t *buffer_len, void *usrptr)
Definition libcryptsetup.h:2672
int crypt_token_assign_keyslot(struct crypt_device *cd, int token, int keyslot)
void(* crypt_token_dump_func)(struct crypt_device *cd, const char *json)
Definition libcryptsetup.h:2746
int crypt_token_luks2_keyring_set(struct crypt_device *cd, int token, const struct crypt_token_params_luks2_keyring *params)
const char * crypt_token_external_path(void)
void crypt_token_external_disable(void)
int crypt_token_json_set(struct crypt_device *cd, int token, const char *json)
int crypt_token_luks2_keyring_get(struct crypt_device *cd, int token, struct crypt_token_params_luks2_keyring *params)
crypt_token_info
Definition libcryptsetup.h:2541
int crypt_token_unassign_keyslot(struct crypt_device *cd, int token, int keyslot)
int crypt_token_register(const crypt_token_handler *handler)
int crypt_token_max(const char *type)
int(* crypt_token_open_pin_func)(struct crypt_device *cd, int token, const char *pin, size_t pin_size, char **buffer, size_t *buffer_len, void *usrptr)
Definition libcryptsetup.h:2702
crypt_token_info crypt_token_status(struct crypt_device *cd, int token, const char **type)
int crypt_token_is_assigned(struct crypt_device *cd, int token, int keyslot)
int crypt_token_set_external_path(const char *path)
int(* crypt_token_validate_func)(struct crypt_device *cd, const char *json)
Definition libcryptsetup.h:2733
int crypt_token_json_get(struct crypt_device *cd, int token, const char **json)
int crypt_activate_by_token_pin(struct crypt_device *cd, const char *name, const char *type, int token, const char *pin, size_t pin_size, void *usrptr, uint32_t flags)
void(* crypt_token_buffer_free_func)(void *buffer, size_t buffer_len)
Definition libcryptsetup.h:2720
int crypt_activate_by_token(struct crypt_device *cd, const char *name, int token, void *usrptr, uint32_t flags)
@ CRYPT_TOKEN_INTERNAL_UNKNOWN
Definition libcryptsetup.h:2545
@ CRYPT_TOKEN_EXTERNAL_UNKNOWN
Definition libcryptsetup.h:2547
@ CRYPT_TOKEN_EXTERNAL
Definition libcryptsetup.h:2546
@ CRYPT_TOKEN_INACTIVE
Definition libcryptsetup.h:2543
@ CRYPT_TOKEN_INTERNAL
Definition libcryptsetup.h:2544
@ CRYPT_TOKEN_INVALID
Definition libcryptsetup.h:2542
const char * crypt_get_default_type(void)
int crypt_get_hw_encryption_type(struct crypt_device *cd)
const char * crypt_get_type(struct crypt_device *cd)
int crypt_get_hw_encryption_key_size(struct crypt_device *cd)
int crypt_wipe_hw_opal(struct crypt_device *cd, int segment, const char *password, size_t password_size, uint32_t flags)
int crypt_wipe(struct crypt_device *cd, const char *dev_path, crypt_wipe_pattern pattern, uint64_t offset, uint64_t length, size_t wipe_block_size, uint32_t flags, int(*progress)(uint64_t size, uint64_t offset, void *usrptr), void *usrptr)
crypt_wipe_pattern
Definition libcryptsetup.h:2408
@ CRYPT_WIPE_ZERO
Definition libcryptsetup.h:2409
@ CRYPT_WIPE_RANDOM
Definition libcryptsetup.h:2410
@ CRYPT_WIPE_SPECIAL
Definition libcryptsetup.h:2412
@ CRYPT_WIPE_ENCRYPTED_ZERO
Definition libcryptsetup.h:2411
Definition libcryptsetup.h:1524
uint64_t offset
Definition libcryptsetup.h:1525
uint64_t iv_offset
Definition libcryptsetup.h:1526
uint64_t size
Definition libcryptsetup.h:1527
uint32_t flags
Definition libcryptsetup.h:1528
Definition libcryptsetup.h:647
size_t user_key_size
Definition libcryptsetup.h:650
const char * admin_key
Definition libcryptsetup.h:648
size_t admin_key_size
Definition libcryptsetup.h:649
Definition libcryptsetup.h:601
uint32_t sector_size
Definition libcryptsetup.h:607
uint32_t journal_integrity_key_size
Definition libcryptsetup.h:614
unsigned int journal_commit_time
Definition libcryptsetup.h:604
uint32_t journal_crypt_key_size
Definition libcryptsetup.h:618
uint32_t integrity_key_size
Definition libcryptsetup.h:610
uint32_t interleave_sectors
Definition libcryptsetup.h:605
const char * journal_integrity
Definition libcryptsetup.h:612
uint64_t journal_size
Definition libcryptsetup.h:602
const char * integrity
Definition libcryptsetup.h:609
const char * journal_crypt_key
Definition libcryptsetup.h:617
const char * journal_crypt
Definition libcryptsetup.h:616
uint32_t buffer_sectors
Definition libcryptsetup.h:608
unsigned int journal_watermark
Definition libcryptsetup.h:603
const char * journal_integrity_key
Definition libcryptsetup.h:613
uint32_t tag_size
Definition libcryptsetup.h:606
Definition libcryptsetup.h:517
uint64_t skip
Definition libcryptsetup.h:520
const char * hash
Definition libcryptsetup.h:518
uint64_t offset
Definition libcryptsetup.h:519
Definition libcryptsetup.h:504
const char * hash
Definition libcryptsetup.h:505
const char * data_device
Definition libcryptsetup.h:507
size_t data_alignment
Definition libcryptsetup.h:506
Definition libcryptsetup.h:630
const struct crypt_params_integrity * integrity_params
Definition libcryptsetup.h:633
const char * label
Definition libcryptsetup.h:637
size_t data_alignment
Definition libcryptsetup.h:634
const struct crypt_pbkdf_type * pbkdf
Definition libcryptsetup.h:631
const char * subsystem
Definition libcryptsetup.h:638
uint32_t sector_size
Definition libcryptsetup.h:636
const char * data_device
Definition libcryptsetup.h:635
const char * integrity
Definition libcryptsetup.h:632
Definition libcryptsetup.h:487
uint32_t sector_size
Definition libcryptsetup.h:492
uint64_t offset
Definition libcryptsetup.h:489
const char * hash
Definition libcryptsetup.h:488
uint64_t size
Definition libcryptsetup.h:491
uint64_t skip
Definition libcryptsetup.h:490
Definition libcryptsetup.h:2936
const char * hash
Definition libcryptsetup.h:2943
crypt_reencrypt_direction_info direction
Definition libcryptsetup.h:2938
const char * resilience
Definition libcryptsetup.h:2939
uint64_t data_shift
Definition libcryptsetup.h:2944
uint64_t max_hotzone_size
Definition libcryptsetup.h:2946
crypt_reencrypt_mode_info mode
Definition libcryptsetup.h:2937
uint64_t device_size
Definition libcryptsetup.h:2948
const struct crypt_params_luks2 * luks2
Definition libcryptsetup.h:2949
uint32_t flags
Definition libcryptsetup.h:2950
Definition libcryptsetup.h:563
const char ** keyfiles
Definition libcryptsetup.h:566
const char * passphrase
Definition libcryptsetup.h:564
size_t key_size
Definition libcryptsetup.h:571
const char * mode
Definition libcryptsetup.h:570
unsigned int keyfiles_count
Definition libcryptsetup.h:567
uint32_t flags
Definition libcryptsetup.h:572
const char * hash_name
Definition libcryptsetup.h:568
size_t passphrase_size
Definition libcryptsetup.h:565
const char * cipher
Definition libcryptsetup.h:569
uint32_t veracrypt_pim
Definition libcryptsetup.h:573
Definition libcryptsetup.h:530
uint32_t fec_roots
Definition libcryptsetup.h:543
const char * data_device
Definition libcryptsetup.h:532
uint64_t data_size
Definition libcryptsetup.h:540
const char * fec_device
Definition libcryptsetup.h:534
const char * hash_name
Definition libcryptsetup.h:531
uint32_t flags
Definition libcryptsetup.h:544
uint32_t data_block_size
Definition libcryptsetup.h:538
uint32_t salt_size
Definition libcryptsetup.h:536
uint32_t hash_type
Definition libcryptsetup.h:537
uint64_t hash_area_offset
Definition libcryptsetup.h:541
const char * salt
Definition libcryptsetup.h:535
uint32_t hash_block_size
Definition libcryptsetup.h:539
const char * hash_device
Definition libcryptsetup.h:533
uint64_t fec_area_offset
Definition libcryptsetup.h:542
Definition libcryptsetup.h:264
const char * type
Definition libcryptsetup.h:265
uint32_t time_ms
Definition libcryptsetup.h:267
const char * hash
Definition libcryptsetup.h:266
uint32_t flags
Definition libcryptsetup.h:271
uint32_t max_memory_kb
Definition libcryptsetup.h:269
uint32_t iterations
Definition libcryptsetup.h:268
uint32_t parallel_threads
Definition libcryptsetup.h:270
Definition libcryptsetup.h:2761
crypt_token_dump_func dump
Definition libcryptsetup.h:2766
crypt_token_validate_func validate
Definition libcryptsetup.h:2765
const char * name
Definition libcryptsetup.h:2762
crypt_token_buffer_free_func buffer_free
Definition libcryptsetup.h:2764
crypt_token_open_func open
Definition libcryptsetup.h:2763
Definition libcryptsetup.h:2572
const char * key_description
Definition libcryptsetup.h:2573