函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\verity\hash_algs.c Create Date:2022-07-29 10:58:20
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:sverity_get_hash_alg() - validate and prepare a hash algorithm*@inode: optional inode for logging purposes*@num: the hash algorithm number* Get the struct fsverity_hash_alg for the given hash algorithm number, and

函数原型:const struct fsverity_hash_alg *fsverity_get_hash_alg(const struct inode *inode, unsigned int num)

返回类型:struct fsverity_hash_alg

参数:

类型参数名称
const struct inode *inode
unsigned intnum
46  如果num大于等于ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(The hash algorithms supported by fs-verity )或非crypto API name, e.g. sha256
48  fsverity_warn(inode, "Unknown hash algorithm number: %u", num)
49  返回:错误号
51  alg等于The hash algorithms supported by fs-verity [num]
54  tfm等于READ_ONCE(hash tfm, allocated on demand )
55  如果此条件成立可能性大(为编译器优化)(tfm != NULL)则返回:alg
61  tfm等于crypto_alloc_ahash(crypto API name, e.g. sha256 , 0, 0)
62  如果是错误
63  如果错误恒等于负ENOENT
64  fsverity_warn(inode, "Missing crypto API support for hash algorithm \"%s\"", crypto API name, e.g. sha256 )
67  返回:错误号
69  fsverity_err(inode, "Error allocating hash algorithm \"%s\": %ld", crypto API name, e.g. sha256 , 错误)
72  返回:错误指示
75  err等于负EINVAL
76  如果WARN_ON(digest size in bytes, e.g. 32 for SHA-256 != 获得消息文摘大小)则转到:err_free_tfm
78  如果WARN_ON(lock size in bytes, e.g. 64 for SHA-256 != rypto_ahash_blocksize() - obtain block size for cipher*@tfm: cipher handle* The block size for the message digest cipher referenced with the cipher* handle is returned.* Return: block size of cipher)则转到:err_free_tfm
81  打印信息("%s using implementation \"%s\"\n", crypto API name, e.g. sha256 , crypto_ahash_driver_name(tfm))
85  如果(cmpxchg( & hash tfm, allocated on demand , NULL, tfm) != NULL)则归零并释放ahash
88  返回:alg
90  err_free_tfm :
91  归零并释放ahash
92  返回:错误号
调用者
名称描述
fsverity_init_merkle_tree_paramssverity_init_merkle_tree_params() - initialize Merkle tree parameters*@params: the parameters struct to initialize*@inode: the inode for which the Merkle tree is being built*@hash_algorithm: number of hash algorithm to use*@log_blocksize: log base 2 of