1 .. SPDX-License-Identifier: GPL-2.0 2 3 Crypto Engine 4 ============= 5 6 Overview 7 -------- 8 The crypto engine (CE) API is a crypto queue m 9 10 Requirement 11 ----------- 12 You must put, at the start of your transform c 13 crypto_engine: 14 15 :: 16 17 struct your_tfm_ctx { 18 struct crypto_engine engine; 19 ... 20 }; 21 22 The crypto engine only manages asynchronous re 23 crypto_async_request. It cannot know the under 24 has access to the transform structure. It is n 25 using container_of. In addition, the engine kn 26 structure "``struct your_tfm_ctx``". The engin 27 of the known member ``struct crypto_engine`` a 28 29 Order of operations 30 ------------------- 31 You are required to obtain a struct crypto_eng 32 Start it via ``crypto_engine_start()``. When f 33 engine using ``crypto_engine_stop()`` and dest 34 ``crypto_engine_exit()``. 35 36 Before transferring any request, you have to f 37 providing functions for the following: 38 39 * ``prepare_crypt_hardware``: Called once befo 40 called. 41 42 * ``unprepare_crypt_hardware``: Called once af 43 been called. 44 45 * ``prepare_cipher_request``/``prepare_hash_re 46 corresponding request is performed. If some 47 work is required, do it here. 48 49 * ``unprepare_cipher_request``/``unprepare_has 50 request is handled. Clean up / undo what was 51 52 * ``cipher_one_request``/``hash_one_request``: 53 performing the operation. 54 55 Note that these functions access the crypto_as 56 associated with the received request. You are 57 request by using: 58 59 :: 60 61 container_of(areq, struct yourrequestt 62 63 When your driver receives a crypto_request, yo 64 the crypto engine via one of: 65 66 * crypto_transfer_aead_request_to_engine() 67 68 * crypto_transfer_akcipher_request_to_engine() 69 70 * crypto_transfer_hash_request_to_engine() 71 72 * crypto_transfer_kpp_request_to_engine() 73 74 * crypto_transfer_skcipher_request_to_engine() 75 76 At the end of the request process, a call to o 77 78 * crypto_finalize_aead_request() 79 80 * crypto_finalize_akcipher_request() 81 82 * crypto_finalize_hash_request() 83 84 * crypto_finalize_kpp_request() 85 86 * crypto_finalize_skcipher_request()
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.