| 1 |
/* SPDX-License-Identifier: LGPL-2.1-or-later */ |
| 2 |
#pragma once |
| 3 |
|
| 4 |
#include "shared-forward.h" |
| 5 |
|
| 6 |
typedef enum { |
| 7 |
INTEGRITY_ALGORITHM_CRC32, |
| 8 |
INTEGRITY_ALGORITHM_CRC32C, |
| 9 |
INTEGRITY_ALGORITHM_XXHASH64, |
| 10 |
INTEGRITY_ALGORITHM_SHA1, |
| 11 |
INTEGRITY_ALGORITHM_SHA256, |
| 12 |
INTEGRITY_ALGORITHM_HMAC_SHA256, |
| 13 |
INTEGRITY_ALGORITHM_HMAC_SHA512, |
| 14 |
INTEGRITY_ALGORITHM_PHMAC_SHA256, |
| 15 |
INTEGRITY_ALGORITHM_PHMAC_SHA512, |
| 16 |
_INTEGRITY_ALGORITHM_MAX, |
| 17 |
_INTEGRITY_ALGORITHM_INVALID = -EINVAL, |
| 18 |
} IntegrityAlgorithm; |
| 19 |
|
| 20 |
int parse_integrity_options( |
| 21 |
const char *options, |
| 22 |
uint32_t *ret_activate_flags, |
| 23 |
int *ret_percent, |
| 24 |
usec_t *ret_commit_time, |
| 25 |
char **ret_data_device, |
| 26 |
IntegrityAlgorithm *ret_integrity_alg); |
| 27 |
|
| 28 |
#define DM_MAX_KEY_SIZE 4096 /* Maximum size of key allowed for dm-integrity */ |