Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\keys\dh.c Create Date:2022-07-28 18:27:06
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Implementation of the KDF in counter mode according to SP800-108 section 5

Proto:static int kdf_ctr(struct kdf_sdesc *sdesc, const u8 *src, unsigned int slen, u8 *dst, unsigned int dlen, unsigned int zlen)

Type:int

Parameter:

TypeParameterName
struct kdf_sdesc *sdesc
const u8 *src
unsigned intslen
u8 *dst
unsigned intdlen
unsigned intzlen
146  desc = shash
147  h = 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
148  err = 0
149  dst_orig = dst
150  counter = cpu_to_be32(1)
152  When dlen cycle
153  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
154  If err Then Go to err
157  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
158  If err Then Go to err
161  If zlen && h Then
164  memset(tmpbuffer, 0, chunk)
166  Do
174  When zlen cycle
177  If src && slen Then
179  If err Then Go to err
183  err = rypto_shash_final() - calculate message digest*@desc: operational state handle that is already filled with data*@out: output buffer filled with the message digest* Finalize the message digest operation and create the message digest
184  If err Then Go to err
187  dlen -= h
188  dst += h
189  counter = cpu_to_be32(be32_to_cpu(counter) + 1)
192  Return 0
194  err :
195  memzero_explicit - Fill a region of memory (e
196  Return err
Caller
NameDescribe
keyctl_dh_compute_kdf