1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
#ifndef _LIBCRYPTSETUP_H
#define _LIBCRYPTSETUP_H
#include <stdint.h>
#define CRYPT_FLAG_PASSPHRASE (1 << 0)
#define CRYPT_FLAG_VERIFY (1 << 1)
#define CRYPT_FLAG_READONLY (1 << 2)
struct crypt_options {
const char *name;
const char *device;
const char *cipher;
const char *hash;
const char *passphrase;
int passphrase_fd;
const char *key_file;
int key_size;
unsigned int flags;
uint64_t size;
uint64_t offset;
uint64_t skip;
};
int crypt_create_device(struct crypt_options *options);
int crypt_update_device(struct crypt_options *options);
int crypt_resize_device(struct crypt_options *options);
int crypt_query_device(struct crypt_options *options);
int crypt_remove_device(struct crypt_options *options);
void crypt_get_error(char *buf, size_t size);
void crypt_put_options(struct crypt_options *options);
const char *crypt_get_dir(void);
#endif /* _LIBCRYPTSETUP_H */
|