Linux4.14加密框架中的主要数据结构(3)—— struct crypto_template(算法模板)

本文详细介绍了Linux4.14加密框架中的struct crypto_template数据结构,包括其定义、实例(如CBC和HMAC算法模板)以及算法模板的查找过程。通过对加密模板的理解,可以更好地掌握Linux加密算法的实现机制。
摘要由CSDN通过智能技术生成

目录

1. 定义

 2. 实例

2.1 CBC算法模板

2.2 HMAC算法模块

3. 算法模板的查找

3.1 crypto_lookup_template


1. 定义

      加密框架将算法模式抽象为算法模板数据结构struct crypto_template,在include/crypto/algapi.h中该数据结构定义如下所示:

struct crypto_template {
	struct list_head list;
	struct hlist_head instances;
	struct module *module;

	struct crypto_instance *(*alloc)(struct rtattr **tb);
	void (*free)(struct crypto_instance *inst);
	int (*create)(struct crypto_template *tmpl, struct rtattr **tb);

	char name[CRYPTO_MAX_ALG_NAME];
};

算法模板数据结构struct crypto_template各成员变量含义如下所示:

1) list:算法模板链表节点。加密框架通过算法模板链表(头节点为crypto_template_list)管理所

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值