Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Encrypt/decrypt big_key data

Proto:static int big_key_crypt(enum big_key_op op, struct big_key_buf *buf, size_t datalen, u8 *key)

Type:int

Parameter:

TypeParameterName
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  If Not aead_req Then Return -ENOMEM
116  memset(zero_nonce, 0, size of 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  If 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 Then
123  ret = -EAGAIN
124  Go to error
126  If op == BIG_KEY_ENC Then ret = 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  Else 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  Return ret
Caller
NameDescribe
big_key_preparsePreparse a big key
big_key_readad the key data* - the key's semaphore is read-locked