Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\apparmor\crypto.c Create Date:2022-07-28 19:55:00
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:aa_calc_hash

Proto:char *aa_calc_hash(void *data, size_t len)

Type:char

Parameter:

TypeParameterName
void *data
size_tlen
30  SHASH_DESC_ON_STACK(desc, apparmor_tfm)
31  char * hash = NULL
32  error = -ENOMEM
34  If Not apparmor_tfm Then Return NULL
37  hash = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc).
38  If Not hash Then Go to fail
41  tfm = apparmor_tfm
43  error = 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
44  If error Then Go to fail
46  error = 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
47  If error Then Go to fail
49  error = 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
50  If error Then Go to fail
53  Return hash
55  fail :
56  kfree(hash)
58  Return ERR_PTR(error)