提交 ea58a6cc 编写于 作者: X Xiongfeng Wang 提交者: Xie XiuQi

dm-crypt: Add IV generation templates

hulk inclusion
category: feature
bugzilla: 20209
CVE: NA
---------------------------

Currently, the IV generation algorithms are implemented in crypt layer.
This patch implements these algorithms as templates, so that dm-crypt
layer can be simplified, and also these algorithms can be implemented in
hardware for performance.

This patch is based on the patchset originally started by
Binoy Jayan <binoy.jayan@linaro.org>
( crypto: Add IV generation algorithms
https://patchwork.kernel.org/patch/9803469/ )
Signed-off-by: NBinoy Jayan <binoy.jayan@linaro.org>
Signed-off-by: NXiongfeng Wang <xiongfeng.wang@linaro.org>
Reviewed-by: NZhangXiaoxu <zhangxiaoxu5@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 cadafa01
此差异已折叠。
/* SPDX-License-Identifier: GPL-2.0 */
/*
* geniv.h: common interface for IV generation algorithms
*
* Copyright (C) 2018, Linaro
*
* This file define the data structure the user should pass to the template.
*/
#ifndef _CRYPTO_GENIV_H
#define _CRYPTO_GENIV_H
#include <linux/types.h>
enum setkey_op {
SETKEY_OP_INIT,
SETKEY_OP_SET,
SETKEY_OP_WIPE,
};
struct geniv_key_info {
enum setkey_op keyop;
unsigned int tfms_count;
u8 *key;
char *ivopts;
sector_t iv_offset;
unsigned long cipher_flags;
unsigned short int sector_size;
unsigned int key_size;
unsigned int key_parts;
unsigned int key_mac_size;
unsigned int on_disk_tag_size;
};
struct geniv_req_info {
sector_t cc_sector;
unsigned int nents;
u8 *integrity_metadata;
};
#endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册