cryptsetup API
Public cryptsetup API
Data Structures | Macros | Functions
Cryptsetup on-disk format types

Data Structures

struct  crypt_params_plain
 
struct  crypt_params_luks1
 
struct  crypt_params_loopaes
 
struct  crypt_params_verity
 
struct  crypt_params_tcrypt
 
struct  crypt_params_integrity
 
struct  crypt_params_luks2
 

Macros

#define CRYPT_PLAIN   "PLAIN"
 
#define CRYPT_LUKS1   "LUKS1"
 
#define CRYPT_LUKS2   "LUKS2"
 
#define CRYPT_LOOPAES   "LOOPAES"
 
#define CRYPT_VERITY   "VERITY"
 
#define CRYPT_TCRYPT   "TCRYPT"
 
#define CRYPT_INTEGRITY   "INTEGRITY"
 
#define CRYPT_BITLK   "BITLK"
 
#define CRYPT_LUKS   NULL
 
#define CRYPT_VERITY_NO_HEADER   (1 << 0)
 
#define CRYPT_VERITY_CHECK_HASH   (1 << 1)
 
#define CRYPT_VERITY_CREATE_HASH   (1 << 2)
 
#define CRYPT_VERITY_ROOT_HASH_SIGNATURE   (1 << 3)
 
#define CRYPT_TCRYPT_LEGACY_MODES   (1 << 0)
 
#define CRYPT_TCRYPT_HIDDEN_HEADER   (1 << 1)
 
#define CRYPT_TCRYPT_BACKUP_HEADER   (1 << 2)
 
#define CRYPT_TCRYPT_SYSTEM_HEADER   (1 << 3)
 
#define CRYPT_TCRYPT_VERA_MODES   (1 << 4)
 

Functions

const char * crypt_get_type (struct crypt_device *cd)
 
const char * crypt_get_default_type (void)
 

Detailed Description

Set of functions, #defines and structs related to on-disk format types

Macro Definition Documentation

◆ CRYPT_BITLK

#define CRYPT_BITLK   "BITLK"

BITLK (BitLocker-compatible mode)

◆ CRYPT_INTEGRITY

#define CRYPT_INTEGRITY   "INTEGRITY"

INTEGRITY dm-integrity device

◆ CRYPT_LOOPAES

#define CRYPT_LOOPAES   "LOOPAES"

loop-AES compatibility mode

◆ CRYPT_LUKS

#define CRYPT_LUKS   NULL

LUKS any version

Examples
crypt_luks_usage.c.

◆ CRYPT_LUKS1

#define CRYPT_LUKS1   "LUKS1"

LUKS version 1 header on-disk

◆ CRYPT_LUKS2

#define CRYPT_LUKS2   "LUKS2"

LUKS version 2 header on-disk

Examples
crypt_luks_usage.c.

◆ CRYPT_PLAIN

#define CRYPT_PLAIN   "PLAIN"

plain crypt device, no on-disk header

◆ CRYPT_TCRYPT

#define CRYPT_TCRYPT   "TCRYPT"

TCRYPT (TrueCrypt-compatible and VeraCrypt-compatible) mode

◆ CRYPT_TCRYPT_BACKUP_HEADER

#define CRYPT_TCRYPT_BACKUP_HEADER   (1 << 2)

Try to load backup header

◆ CRYPT_TCRYPT_HIDDEN_HEADER

#define CRYPT_TCRYPT_HIDDEN_HEADER   (1 << 1)

Try to load hidden header (describing hidden device)

◆ CRYPT_TCRYPT_LEGACY_MODES

#define CRYPT_TCRYPT_LEGACY_MODES   (1 << 0)

Include legacy modes when scanning for header

◆ CRYPT_TCRYPT_SYSTEM_HEADER

#define CRYPT_TCRYPT_SYSTEM_HEADER   (1 << 3)

Device contains encrypted system (with boot loader)

◆ CRYPT_TCRYPT_VERA_MODES

#define CRYPT_TCRYPT_VERA_MODES   (1 << 4)

Include VeraCrypt modes when scanning for header, all other TCRYPT flags applies as well. VeraCrypt device is reported as TCRYPT type.

◆ CRYPT_VERITY

#define CRYPT_VERITY   "VERITY"

dm-verity mode

◆ CRYPT_VERITY_CHECK_HASH

#define CRYPT_VERITY_CHECK_HASH   (1 << 1)

Verity hash in userspace before activation

◆ CRYPT_VERITY_CREATE_HASH

#define CRYPT_VERITY_CREATE_HASH   (1 << 2)

Create hash - format hash device

◆ CRYPT_VERITY_NO_HEADER

#define CRYPT_VERITY_NO_HEADER   (1 << 0)

No on-disk header (only hashes)

◆ CRYPT_VERITY_ROOT_HASH_SIGNATURE

#define CRYPT_VERITY_ROOT_HASH_SIGNATURE   (1 << 3)

Root hash signature required for activation

Function Documentation

◆ crypt_get_default_type()

const char* crypt_get_default_type ( void  )

Get device default LUKS type

Returns
string according to device type (CRYPT_LUKS1 or CRYPT_LUKS2).

◆ crypt_get_type()

const char* crypt_get_type ( struct crypt_device *  cd)

Get device type

Parameters
cdcrypt device handle
Returns
string according to device type or NULL if not known.
Examples
crypt_luks_usage.c.