Add more verity debug messages.
[platform/upstream/cryptsetup.git] / lib / verity / verity.h
1 /*
2  * dm-verity volume handling
3  *
4  * Copyright (C) 2012, Red Hat, Inc. All rights reserved.
5  *
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.
9  *
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.
14  *
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.
18  */
19
20 #ifndef _VERITY_H
21 #define _VERITY_H
22
23 #include <unistd.h>
24 #include "config.h"
25
26 struct crypt_device;
27 struct crypt_params_verity;
28
29 int VERITY_read_sb(struct crypt_device *cd,
30                    const char *device,
31                    uint64_t sb_offset,
32                    char **uuid,
33                    struct crypt_params_verity *params);
34
35 int VERITY_write_sb(struct crypt_device *cd,
36                    const char *device,
37                    uint64_t sb_offset,
38                    const char *uuid_string,
39                    struct crypt_params_verity *params);
40
41 int VERITY_activate(struct crypt_device *cd,
42                      const char *name,
43                      const char *hash_device,
44                      const char *root_hash,
45                      size_t root_hash_size,
46                      struct crypt_params_verity *verity_hdr,
47                      uint32_t activation_flags);
48
49 int VERITY_verify(struct crypt_device *cd,
50                 struct crypt_params_verity *verity_hdr,
51                 const char *data_device,
52                 const char *hash_device,
53                 const char *root_hash,
54                 size_t root_hash_size);
55
56 int VERITY_create(struct crypt_device *cd,
57                   struct crypt_params_verity *verity_hdr,
58                   const char *data_device,
59                   const char *hash_device,
60                   char *root_hash,
61                   size_t root_hash_size);
62
63 uint64_t VERITY_hash_offset_block(struct crypt_params_verity *params);
64
65 int VERITY_UUID_generate(struct crypt_device *cd, char **uuid_string);
66
67 #endif