|
2 | 2 | /*
|
3 | 3 | * Copyright 2018-2020 NXP
|
4 | 4 | *
|
5 |
| - * Cipher interface calling the HW crypto driver. |
| 5 | + * Cipher interface calling the crypto driver. |
6 | 6 | */
|
7 | 7 | #ifndef __DRVCRYPT_CIPHER_H__
|
8 | 8 | #define __DRVCRYPT_CIPHER_H__
|
|
11 | 11 | #include <tee_api_types.h>
|
12 | 12 |
|
13 | 13 | /*
|
14 |
| - * Format the CIPHER context to keep the reference to the |
15 |
| - * operation driver |
| 14 | + * Cipher operation context |
16 | 15 | */
|
17 | 16 | struct crypto_cipher {
|
18 |
| - struct crypto_cipher_ctx cipher_ctx; /* Crypto Cipher API context */ |
19 |
| - void *ctx; /* Cipher Context */ |
| 17 | + struct crypto_cipher_ctx cipher_ctx; /* Crypto cipher API context */ |
| 18 | + void *ctx; /* Cipher context */ |
20 | 19 | struct drvcrypt_cipher *op; /* Reference to the operation */
|
21 | 20 | };
|
22 | 21 |
|
23 | 22 | /*
|
24 |
| - * Cipher Algorithm initialization data |
| 23 | + * Cipher algorithm initialization data |
25 | 24 | */
|
26 | 25 | struct drvcrypt_cipher_init {
|
27 |
| - void *ctx; /* Software Context */ |
| 26 | + void *ctx; /* Software context */ |
28 | 27 | bool encrypt; /* Encrypt or decrypt direction */
|
29 |
| - struct drvcrypt_buf key1; /* First Key */ |
30 |
| - struct drvcrypt_buf key2; /* Second Key */ |
31 |
| - struct drvcrypt_buf iv; /* Initial Vector */ |
| 28 | + struct drvcrypt_buf key1; /* First key */ |
| 29 | + struct drvcrypt_buf key2; /* Second key */ |
| 30 | + struct drvcrypt_buf iv; /* Initial vector */ |
32 | 31 | };
|
33 | 32 |
|
34 | 33 | /*
|
35 |
| - * Cipher Algorithm update data |
| 34 | + * Cipher algorithm update data |
36 | 35 | */
|
37 | 36 | struct drvcrypt_cipher_update {
|
38 |
| - void *ctx; /* Software Context */ |
| 37 | + void *ctx; /* Software context */ |
39 | 38 | bool encrypt; /* Encrypt or decrypt direction */
|
40 | 39 | bool last; /* Last block to handle */
|
41 |
| - struct drvcrypt_buf src; /* Buffer source (Message or Cipher) */ |
42 |
| - struct drvcrypt_buf dst; /* Buffer dest (Message or Cipher) */ |
| 40 | + struct drvcrypt_buf src; /* Buffer source (message or cipher) */ |
| 41 | + struct drvcrypt_buf dst; /* Buffer dest (message or cipher) */ |
43 | 42 | };
|
44 | 43 |
|
45 | 44 | /*
|
46 |
| - * Crypto Library Cipher driver operations |
| 45 | + * Crypto library cipher driver operations |
47 | 46 | */
|
48 | 47 | struct drvcrypt_cipher {
|
49 |
| - /* Allocate of the Software context */ |
| 48 | + /* Allocate context */ |
50 | 49 | TEE_Result (*alloc_ctx)(void **ctx, uint32_t algo);
|
51 |
| - /* Free of the Software context */ |
| 50 | + /* Free context */ |
52 | 51 | void (*free_ctx)(void *ctx);
|
53 | 52 | /* Initialize the cipher operation */
|
54 | 53 | TEE_Result (*init)(struct drvcrypt_cipher_init *dinit);
|
55 | 54 | /* Update the cipher operation */
|
56 | 55 | TEE_Result (*update)(struct drvcrypt_cipher_update *dupdate);
|
57 | 56 | /* Finalize the cipher operation */
|
58 | 57 | void (*final)(void *ctx);
|
59 |
| - /* Copy Cipher context */ |
| 58 | + /* Copy cipher context */ |
60 | 59 | void (*copy_state)(void *dst_ctx, void *src_ctx);
|
61 | 60 | };
|
62 | 61 |
|
63 | 62 | /*
|
64 | 63 | * Register a cipher processing driver in the crypto API
|
65 | 64 | *
|
66 |
| - * @ops - Driver operations in the HW layer |
| 65 | + * @ops - Driver operations |
67 | 66 | */
|
68 | 67 | static inline TEE_Result drvcrypt_register_cipher(struct drvcrypt_cipher *ops)
|
69 | 68 | {
|
|
0 commit comments