2 * dm-verity volume handling
4 * Copyright (C) 2012, Red Hat, Inc. All rights reserved.
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * version 2 as published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 #define VERITY_MAX_HASH_TYPE 1
27 #define VERITY_BLOCK_SIZE_OK(x) ((x) % 512 || (x) < 512 || \
28 (x) > (512 * 1024) || (x) & ((x)-1))
31 struct crypt_params_verity;
33 int VERITY_read_sb(struct crypt_device *cd,
36 struct crypt_params_verity *params);
38 int VERITY_write_sb(struct crypt_device *cd,
40 const char *uuid_string,
41 struct crypt_params_verity *params);
43 int VERITY_activate(struct crypt_device *cd,
45 const char *root_hash,
46 size_t root_hash_size,
47 struct crypt_params_verity *verity_hdr,
48 uint32_t activation_flags);
50 int VERITY_verify(struct crypt_device *cd,
51 struct crypt_params_verity *verity_hdr,
52 const char *root_hash,
53 size_t root_hash_size);
55 int VERITY_create(struct crypt_device *cd,
56 struct crypt_params_verity *verity_hdr,
58 size_t root_hash_size);
60 uint64_t VERITY_hash_offset_block(struct crypt_params_verity *params);
62 int VERITY_UUID_generate(struct crypt_device *cd, char **uuid_string);