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:HKDF-Expand (RFC 5869 section 2

Proto:int fscrypt_hkdf_expand(struct fscrypt_hkdf *hkdf, u8 context, const u8 *info, unsigned int infolen, u8 *okm, unsigned int okmlen)

Type:int

Parameter:

TypeParameterName
struct fscrypt_hkdf *hkdf
u8context
const u8 *info
unsigned intinfolen
u8 *okm
unsigned intokmlen
119  SHASH_DESC_ON_STACK(desc, hmac_tfm)
123  const u8 * prev = NULL
124  counter = 1
127  If WARN_ON(okmlen > 255 * HKDF_HASHLEN) Then Return -EINVAL
130  tfm = hmac_tfm
132  memcpy(prefix, "fscrypt\0", 8)
133  prefix[8] = context
135  When i < okmlen cycle
137  err = rypto_shash_init() - (re)initialize message digest*@desc: operational state handle that is already filled* The call (re-)initializes the message digest referenced by the* operational state handle. Any potentially existing state created by
138  If err Then Go to out
141  If prev Then
143  If err Then Go to out
147  err = rypto_shash_update() - add data to message digest for processing*@desc: operational state handle that is already initialized*@data: input data to be added to the message digest*@len: length of the input data
148  If err Then Go to out
151  err = rypto_shash_update() - add data to message digest for processing*@desc: operational state handle that is already initialized*@data: input data to be added to the message digest*@len: length of the input data
152  If err Then Go to out
155  BUILD_BUG_ON - break compile if a condition is true( size of counter != 1)
156  If okmlen - i < HKDF_HASHLEN Then
158  If err Then Go to out
160  memcpy( & okm[i], tmp, okmlen - i)
162  Else
164  If err Then Go to out
167  counter++
168  prev = okm[i]
170  err = 0
171  out :
172  If Value for the false possibility is greater at compile time(err) Then memzero_explicit - Fill a region of memory (e
174  shash_desc_zero(desc)
175  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
setup_per_mode_key
fscrypt_setup_v2_file_key