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:09
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:init_skcipher_req

Proto:static struct skcipher_request *init_skcipher_req(const u8 *key, unsigned int key_len)

Type:struct skcipher_request

Parameter:

TypeParameterName
const u8 *key
unsigned intkey_len
396  tfm = rypto_alloc_skcipher() - allocate symmetric key cipher handle*@alg_name: is the cra_name / name or cra_driver_name / driver name of the* skcipher cipher*@type: specifies the type of the cipher*@mask: specifies the mask for the cipher
397  If IS_ERR(tfm) Then
398  pr_err("encrypted_key: failed to load %s transform (%ld)\n", blkcipher_alg, PTR_ERR(tfm))
400  Return ERR_CAST - Explicitly cast an error-valued pointer to another pointer type*@ptr: The pointer to cast.* Explicitly cast an error-valued pointer to another pointer type in such a* way as to make it clear that's what's going on.
403  ret = rypto_skcipher_setkey() - set key for cipher*@tfm: cipher handle*@key: buffer holding the key*@keylen: length of the key in bytes* The caller provided key is set for the skcipher referenced by the cipher* handle.
404  If ret < 0 Then
405  pr_err("encrypted_key: failed to setkey (%d)\n", ret)
406  rypto_free_skcipher() - zeroize and free cipher handle*@tfm: cipher handle to be freed
407  Return ERR_PTR(ret)
410  req = skcipher_request_alloc() - allocate request data structure*@tfm: cipher handle to be registered with the request*@gfp: memory allocation flag that is handed to kmalloc by the API call
411  If Not req Then
412  pr_err("encrypted_key: failed to allocate request for %s\n", blkcipher_alg)
414  rypto_free_skcipher() - zeroize and free cipher handle*@tfm: cipher handle to be freed
415  Return ERR_PTR( - ENOMEM)
418  skcipher_request_set_callback() - set asynchronous callback function*@req: request handle*@flags: specify zero or an ORing of the flags* CRYPTO_TFM_REQ_MAY_BACKLOG the request queue may back log and* increase the wait queue beyond the initial maximum
419  Return req
Caller
NameDescribe
derived_key_encryptBefore returning data to userspace, encrypt decrypted data.
derived_key_decrypt