Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:calc_hmac

Proto:static int calc_hmac(u8 *digest, const u8 *key, unsigned int keylen, const u8 *buf, unsigned int buflen)

Type:int

Parameter:

TypeParameterName
u8 *digest
const u8 *key
unsigned intkeylen
const u8 *buf
unsigned intbuflen
345  tfm = crypto_alloc_shash(hmac_alg, 0, 0)
346  If IS_ERR(tfm) Then
347  pr_err("encrypted_key: can't alloc %s transform: %ld\n", hmac_alg, PTR_ERR(tfm))
349  Return PTR_ERR(tfm)
352  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
353  If Not err Then err = calc_hash(tfm, digest, buf, buflen)
355  rypto_free_shash() - zeroize and free the message digest handle*@tfm: cipher handle to be freed
356  Return err
Caller
NameDescribe
datablob_hmac_append
datablob_hmac_verifyverify HMAC before decrypting encrypted key