Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\crypto\hkdf.c Create Date:2022-07-28 20:23:43
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name: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

Proto:int fscrypt_init_hkdf(struct fscrypt_hkdf *hkdf, const u8 *master_key, unsigned int master_key_size)

Type:int

Parameter:

TypeParameterName
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  If IS_ERR(hmac_tfm) Then
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", PTR_ERR(hmac_tfm))
78  Return PTR_ERR(hmac_tfm)
81  If WARN_ON(rypto_shash_digestsize() - obtain message digest size*@tfm: cipher handle* The size for the message digest created by the message digest cipher* referenced with the cipher handle is returned.* Return: digest size of cipher != size of prk ) Then
82  err = -EINVAL
83  Go to err_free_tfm
86  err = HKDF-Extract (RFC 5869 section 2.2), unsalted
87  If err Then Go to 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  If err Then Go to err_free_tfm
94  hmac_tfm = hmac_tfm
95  Go to out
97  err_free_tfm :
98  rypto_free_shash() - zeroize and free the message digest handle*@tfm: cipher handle to be freed
99  out :
100  memzero_explicit - Fill a region of memory (e
101  Return err
Caller
NameDescribe
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