Lines Matching refs:cdata
261 void cryptodev_cipher_deinit(struct cipher_data *cdata) in cryptodev_cipher_deinit() argument
263 if (cdata->init) { in cryptodev_cipher_deinit()
264 if (cdata->aead == 0) { in cryptodev_cipher_deinit()
265 cryptodev_blkcipher_request_free(cdata->async.request); in cryptodev_cipher_deinit()
266 cryptodev_crypto_free_blkcipher(cdata->async.s); in cryptodev_cipher_deinit()
268 if (cdata->async.arequest) in cryptodev_cipher_deinit()
269 aead_request_free(cdata->async.arequest); in cryptodev_cipher_deinit()
270 if (cdata->async.as) in cryptodev_cipher_deinit()
271 crypto_free_aead(cdata->async.as); in cryptodev_cipher_deinit()
274 cdata->init = 0; in cryptodev_cipher_deinit()
305 ssize_t cryptodev_cipher_encrypt(struct cipher_data *cdata, in cryptodev_cipher_encrypt() argument
311 reinit_completion(&cdata->async.result.completion); in cryptodev_cipher_encrypt()
313 if (cdata->aead == 0) { in cryptodev_cipher_encrypt()
314 cryptodev_blkcipher_request_set_crypt(cdata->async.request, in cryptodev_cipher_encrypt()
316 len, cdata->async.iv); in cryptodev_cipher_encrypt()
317 ret = cryptodev_crypto_blkcipher_encrypt(cdata->async.request); in cryptodev_cipher_encrypt()
319 aead_request_set_crypt(cdata->async.arequest, in cryptodev_cipher_encrypt()
321 len, cdata->async.iv); in cryptodev_cipher_encrypt()
322 ret = crypto_aead_encrypt(cdata->async.arequest); in cryptodev_cipher_encrypt()
325 return waitfor(&cdata->async.result, ret); in cryptodev_cipher_encrypt()
328 ssize_t cryptodev_cipher_decrypt(struct cipher_data *cdata, in cryptodev_cipher_decrypt() argument
334 reinit_completion(&cdata->async.result.completion); in cryptodev_cipher_decrypt()
335 if (cdata->aead == 0) { in cryptodev_cipher_decrypt()
336 cryptodev_blkcipher_request_set_crypt(cdata->async.request, in cryptodev_cipher_decrypt()
338 len, cdata->async.iv); in cryptodev_cipher_decrypt()
339 ret = cryptodev_crypto_blkcipher_decrypt(cdata->async.request); in cryptodev_cipher_decrypt()
341 aead_request_set_crypt(cdata->async.arequest, in cryptodev_cipher_decrypt()
343 len, cdata->async.iv); in cryptodev_cipher_decrypt()
344 ret = crypto_aead_decrypt(cdata->async.arequest); in cryptodev_cipher_decrypt()
347 return waitfor(&cdata->async.result, ret); in cryptodev_cipher_decrypt()