函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Compute HKDF-Extract using the given master key as the input keying material,* and prepare an HMAC transform object keyed by the resulting pseudorandom key.* Afterwards, the keyed HMAC transform object can be used for HKDF-Expand many

函数原型:int fscrypt_init_hkdf(struct fscrypt_hkdf *hkdf, const u8 *master_key, unsigned int master_key_size)

返回类型:int

参数:

类型参数名称
struct fscrypt_hkdf *hkdf
const u8 *master_key
unsigned intmaster_key_size
74  hmac_tfm等于crypto_alloc_shash(HKDF supports any unkeyed cryptographic hash algorithm, but fscrypt uses* SHA-512 because it is reasonably secure and efficient; and since it produces* a 64-byte digest, deriving an AES-256-XTS key preserves all 64 bytes of, 0, 0)
75  如果是错误
76  fscrypt_err(NULL, "Error allocating "HKDF supports any unkeyed cryptographic hash algorithm, but fscrypt uses* SHA-512 because it is reasonably secure and efficient; and since it produces* a 64-byte digest, deriving an AES-256-XTS key preserves all 64 bytes of": %ld", 错误)
78  返回:错误
81  如果WARN_ON(获得消息文摘大小 != prk的长度)则
82  err等于负EINVAL
83  转到:err_free_tfm
86  err等于HKDF-Extract (RFC 5869 section 2.2), unsalted
87  如果err则转到:err_free_tfm
90  err等于rypto_shash_setkey() - set key for message digest*@tfm: cipher handle*@key: buffer holding the key*@keylen: length of the key in bytes* The caller provided key is set for the keyed message digest cipher
91  如果err则转到:err_free_tfm
94  hmac_tfm等于hmac_tfm
95  转到:out
97  err_free_tfm :
98  归零并释放信息消化处理
99  out :
100  memzero_explicit - Fill a region of memory (e
101  返回:err
调用者
名称描述
fscrypt_ioctl_add_keyAdd a master encryption key to the filesystem, causing all files which were* encrypted with it to appear "unlocked" (decrypted) when accessed.* When adding a key for use by v1 encryption policies, this ioctl is