/*
* dm-verity volume handling
*
- * Copyright (C) 2012, Red Hat, Inc. All rights reserved.
+ * Copyright (C) 2012-2020 Red Hat, Inc. All rights reserved.
*
* This file is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
#ifndef _VERITY_H
#define _VERITY_H
-#include <unistd.h>
+#include <stddef.h>
+#include <stdint.h>
#define VERITY_MAX_HASH_TYPE 1
#define VERITY_BLOCK_SIZE_OK(x) ((x) % 512 || (x) < 512 || \
struct crypt_device;
struct crypt_params_verity;
+struct device;
int VERITY_read_sb(struct crypt_device *cd,
uint64_t sb_offset,
const char *name,
const char *root_hash,
size_t root_hash_size,
+ const char *signature_description,
+ struct device *fec_device,
struct crypt_params_verity *verity_hdr,
uint32_t activation_flags);
int VERITY_create(struct crypt_device *cd,
struct crypt_params_verity *verity_hdr,
- char *root_hash,
+ const char *root_hash,
size_t root_hash_size);
+int VERITY_FEC_process(struct crypt_device *cd,
+ struct crypt_params_verity *params,
+ struct device *fec_device,
+ int check_fec,
+ unsigned int *errors);
+
uint64_t VERITY_hash_offset_block(struct crypt_params_verity *params);
+uint64_t VERITY_hash_blocks(struct crypt_device *cd, struct crypt_params_verity *params);
+
int VERITY_UUID_generate(struct crypt_device *cd, char **uuid_string);
#endif