函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\keys\big_key.c Create Date:2022-07-27 20:02:33
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Encrypt/decrypt big_key data

函数原型:static int big_key_crypt(enum big_key_op op, struct big_key_buf *buf, size_t datalen, u8 *key)

返回类型:int

参数:

类型参数名称
enum big_key_opop
struct big_key_buf *buf
size_tdatalen
u8 *key
112  aead_req等于aead_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.* Allocate the request data structure that must be used with the AEAD
113  如果非aead_req则返回:负ENOMEM
116  memset(zero_nonce, 0, zero_nonce的长度)
117  aead_request_set_crypt - set data buffers*@req: request handle*@src: source scatter / gather list*@dst: destination scatter / gather list*@cryptlen: number of bytes to process from @src*@iv: IV for the cipher operation which must comply with the IV size
118  aead_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 size;*
119  aead_request_set_ad - set associated data information*@req: request handle*@assoclen: number of bytes in associated data* Setting the AD information. This function sets the length of* the associated data.
121  mutex_lock( & Since changing the key affects the entire object, we need a mutex.)
122  如果rypto_aead_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 AEAD referenced by the cipher* handle.* Note, the key length determines the cipher type
123  ret等于负EAGAIN
124  转到:error
126  如果op恒等于BIG_KEY_ENCret等于rypto_aead_encrypt() - encrypt plaintext*@req: reference to the aead_request handle that holds all information* needed to perform the cipher operation* Encrypt plaintext data using the aead_request handle
128  否则ret等于rypto_aead_decrypt() - decrypt ciphertext*@req: reference to the aead_request handle that holds all information* needed to perform the cipher operation* Decrypt ciphertext data using the aead_request handle
130  error :
131  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
132  aead_request_free() - zeroize and free request data structure*@req: request data structure cipher handle to be freed
133  返回:ret
调用者
名称描述
big_key_preparsePreparse a big key
big_key_readad the key data* - the key's semaphore is read-locked