Steven Cooreman | cd84cb4 | 2020-07-16 20:28:36 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Function signatures for functionality that can be provided by |
| 3 | * cryptographic accelerators. |
Steven Cooreman | 56250fd | 2020-09-04 13:07:15 +0200 | [diff] [blame] | 4 | * Warning: This file will be auto-generated in the future. |
Steven Cooreman | cd84cb4 | 2020-07-16 20:28:36 +0200 | [diff] [blame] | 5 | */ |
Steven Cooreman | 2c7b2f8 | 2020-09-02 13:43:46 +0200 | [diff] [blame] | 6 | /* Copyright The Mbed TLS Contributors |
Steven Cooreman | cd84cb4 | 2020-07-16 20:28:36 +0200 | [diff] [blame] | 7 | * SPDX-License-Identifier: Apache-2.0 |
| 8 | * |
| 9 | * Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 10 | * not use this file except in compliance with the License. |
| 11 | * You may obtain a copy of the License at |
| 12 | * |
| 13 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 14 | * |
| 15 | * Unless required by applicable law or agreed to in writing, software |
| 16 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 18 | * See the License for the specific language governing permissions and |
| 19 | * limitations under the License. |
Steven Cooreman | cd84cb4 | 2020-07-16 20:28:36 +0200 | [diff] [blame] | 20 | */ |
| 21 | |
| 22 | #ifndef PSA_CRYPTO_DRIVER_WRAPPERS_H |
| 23 | #define PSA_CRYPTO_DRIVER_WRAPPERS_H |
| 24 | |
| 25 | #include "psa/crypto.h" |
| 26 | #include "psa/crypto_driver_common.h" |
| 27 | |
Steven Cooreman | 37941cb | 2020-07-28 18:49:51 +0200 | [diff] [blame] | 28 | /* |
| 29 | * Signature functions |
| 30 | */ |
Ronald Cron | 9f17aa4 | 2020-12-08 17:07:25 +0100 | [diff] [blame] | 31 | psa_status_t psa_driver_wrapper_sign_hash( |
| 32 | const psa_key_attributes_t *attributes, |
| 33 | const uint8_t *key_buffer, size_t key_buffer_size, |
| 34 | psa_algorithm_t alg, const uint8_t *hash, size_t hash_length, |
| 35 | uint8_t *signature, size_t signature_size, size_t *signature_length ); |
Steven Cooreman | cd84cb4 | 2020-07-16 20:28:36 +0200 | [diff] [blame] | 36 | |
Ronald Cron | 9f17aa4 | 2020-12-08 17:07:25 +0100 | [diff] [blame] | 37 | psa_status_t psa_driver_wrapper_verify_hash( |
| 38 | const psa_key_attributes_t *attributes, |
| 39 | const uint8_t *key_buffer, size_t key_buffer_size, |
| 40 | psa_algorithm_t alg, const uint8_t *hash, size_t hash_length, |
| 41 | const uint8_t *signature, size_t signature_length ); |
Steven Cooreman | 55ae217 | 2020-07-17 19:46:15 +0200 | [diff] [blame] | 42 | |
Steven Cooreman | 0452476 | 2020-10-13 17:43:44 +0200 | [diff] [blame] | 43 | /* |
| 44 | * Key handling functions |
| 45 | */ |
| 46 | |
Ronald Cron | 8328287 | 2020-11-22 14:02:39 +0100 | [diff] [blame] | 47 | psa_status_t psa_driver_wrapper_import_key( |
| 48 | const psa_key_attributes_t *attributes, |
| 49 | const uint8_t *data, size_t data_length, |
| 50 | uint8_t *key_buffer, size_t key_buffer_size, |
| 51 | size_t *key_buffer_length, size_t *bits ); |
Steven Cooreman | 0452476 | 2020-10-13 17:43:44 +0200 | [diff] [blame] | 52 | |
Ronald Cron | 6722798 | 2020-11-26 15:16:05 +0100 | [diff] [blame] | 53 | psa_status_t psa_driver_wrapper_export_key( |
| 54 | const psa_key_attributes_t *attributes, |
| 55 | const uint8_t *key_buffer, size_t key_buffer_size, |
| 56 | uint8_t *data, size_t data_size, size_t *data_length ); |
| 57 | |
Ronald Cron | 84cc994 | 2020-11-25 14:30:05 +0100 | [diff] [blame] | 58 | psa_status_t psa_driver_wrapper_export_public_key( |
| 59 | const psa_key_attributes_t *attributes, |
| 60 | const uint8_t *key_buffer, size_t key_buffer_size, |
| 61 | uint8_t *data, size_t data_size, size_t *data_length ); |
| 62 | |
Ronald Cron | 9df74be | 2020-12-05 19:15:23 +0100 | [diff] [blame] | 63 | psa_status_t psa_driver_wrapper_get_key_buffer_size( |
| 64 | const psa_key_attributes_t *attributes, |
| 65 | size_t *key_buffer_size ); |
| 66 | |
Ronald Cron | 84cc994 | 2020-11-25 14:30:05 +0100 | [diff] [blame] | 67 | psa_status_t psa_driver_wrapper_generate_key( |
| 68 | const psa_key_attributes_t *attributes, |
Ronald Cron | 977c247 | 2020-10-13 08:32:21 +0200 | [diff] [blame] | 69 | uint8_t *key_buffer, size_t key_buffer_size, size_t *key_buffer_length ); |
Steven Cooreman | b9b8442 | 2020-10-14 14:39:20 +0200 | [diff] [blame] | 70 | |
Steven Cooreman | 37941cb | 2020-07-28 18:49:51 +0200 | [diff] [blame] | 71 | /* |
| 72 | * Cipher functions |
| 73 | */ |
| 74 | psa_status_t psa_driver_wrapper_cipher_encrypt( |
| 75 | psa_key_slot_t *slot, |
| 76 | psa_algorithm_t alg, |
| 77 | const uint8_t *input, |
| 78 | size_t input_length, |
| 79 | uint8_t *output, |
| 80 | size_t output_size, |
| 81 | size_t *output_length ); |
| 82 | |
| 83 | psa_status_t psa_driver_wrapper_cipher_decrypt( |
| 84 | psa_key_slot_t *slot, |
| 85 | psa_algorithm_t alg, |
| 86 | const uint8_t *input, |
| 87 | size_t input_length, |
| 88 | uint8_t *output, |
| 89 | size_t output_size, |
| 90 | size_t *output_length ); |
| 91 | |
| 92 | psa_status_t psa_driver_wrapper_cipher_encrypt_setup( |
Ronald Cron | a4af55f | 2020-12-14 14:36:06 +0100 | [diff] [blame] | 93 | psa_cipher_operation_t *operation, |
| 94 | const psa_key_attributes_t *attributes, |
| 95 | const uint8_t *key_buffer, size_t key_buffer_size, |
Steven Cooreman | 37941cb | 2020-07-28 18:49:51 +0200 | [diff] [blame] | 96 | psa_algorithm_t alg ); |
| 97 | |
| 98 | psa_status_t psa_driver_wrapper_cipher_decrypt_setup( |
Ronald Cron | a4af55f | 2020-12-14 14:36:06 +0100 | [diff] [blame] | 99 | psa_cipher_operation_t *operation, |
| 100 | const psa_key_attributes_t *attributes, |
| 101 | const uint8_t *key_buffer, size_t key_buffer_size, |
Steven Cooreman | 37941cb | 2020-07-28 18:49:51 +0200 | [diff] [blame] | 102 | psa_algorithm_t alg ); |
| 103 | |
Steven Cooreman | 37941cb | 2020-07-28 18:49:51 +0200 | [diff] [blame] | 104 | psa_status_t psa_driver_wrapper_cipher_set_iv( |
Ronald Cron | 6056fe8 | 2020-12-15 13:58:07 +0100 | [diff] [blame] | 105 | psa_cipher_operation_t *operation, |
Steven Cooreman | 37941cb | 2020-07-28 18:49:51 +0200 | [diff] [blame] | 106 | const uint8_t *iv, |
| 107 | size_t iv_length ); |
| 108 | |
| 109 | psa_status_t psa_driver_wrapper_cipher_update( |
Ronald Cron | 6056fe8 | 2020-12-15 13:58:07 +0100 | [diff] [blame] | 110 | psa_cipher_operation_t *operation, |
Steven Cooreman | 37941cb | 2020-07-28 18:49:51 +0200 | [diff] [blame] | 111 | const uint8_t *input, |
| 112 | size_t input_length, |
| 113 | uint8_t *output, |
| 114 | size_t output_size, |
| 115 | size_t *output_length ); |
| 116 | |
| 117 | psa_status_t psa_driver_wrapper_cipher_finish( |
Ronald Cron | 6056fe8 | 2020-12-15 13:58:07 +0100 | [diff] [blame] | 118 | psa_cipher_operation_t *operation, |
Steven Cooreman | 37941cb | 2020-07-28 18:49:51 +0200 | [diff] [blame] | 119 | uint8_t *output, |
| 120 | size_t output_size, |
| 121 | size_t *output_length ); |
| 122 | |
| 123 | psa_status_t psa_driver_wrapper_cipher_abort( |
Ronald Cron | 6056fe8 | 2020-12-15 13:58:07 +0100 | [diff] [blame] | 124 | psa_cipher_operation_t *operation ); |
Steven Cooreman | 37941cb | 2020-07-28 18:49:51 +0200 | [diff] [blame] | 125 | |
Steven Cooreman | 1e58235 | 2021-02-18 17:24:37 +0100 | [diff] [blame] | 126 | /* |
| 127 | * Hashing functions |
| 128 | */ |
| 129 | psa_status_t psa_driver_wrapper_hash_compute( |
| 130 | psa_algorithm_t alg, |
| 131 | const uint8_t *input, |
| 132 | size_t input_length, |
| 133 | uint8_t *hash, |
| 134 | size_t hash_size, |
| 135 | size_t *hash_length); |
| 136 | |
| 137 | psa_status_t psa_driver_wrapper_hash_setup( |
Steven Cooreman | dbf8ced | 2021-03-04 13:01:18 +0100 | [diff] [blame] | 138 | psa_hash_operation_t *operation, |
Steven Cooreman | 1e58235 | 2021-02-18 17:24:37 +0100 | [diff] [blame] | 139 | psa_algorithm_t alg ); |
| 140 | |
| 141 | psa_status_t psa_driver_wrapper_hash_clone( |
Steven Cooreman | dbf8ced | 2021-03-04 13:01:18 +0100 | [diff] [blame] | 142 | const psa_hash_operation_t *source_operation, |
| 143 | psa_hash_operation_t *target_operation ); |
Steven Cooreman | 1e58235 | 2021-02-18 17:24:37 +0100 | [diff] [blame] | 144 | |
| 145 | psa_status_t psa_driver_wrapper_hash_update( |
Steven Cooreman | dbf8ced | 2021-03-04 13:01:18 +0100 | [diff] [blame] | 146 | psa_hash_operation_t *operation, |
Steven Cooreman | 1e58235 | 2021-02-18 17:24:37 +0100 | [diff] [blame] | 147 | const uint8_t *input, |
| 148 | size_t input_length ); |
| 149 | |
| 150 | psa_status_t psa_driver_wrapper_hash_finish( |
Steven Cooreman | dbf8ced | 2021-03-04 13:01:18 +0100 | [diff] [blame] | 151 | psa_hash_operation_t *operation, |
Steven Cooreman | 1e58235 | 2021-02-18 17:24:37 +0100 | [diff] [blame] | 152 | uint8_t *hash, |
| 153 | size_t hash_size, |
| 154 | size_t *hash_length ); |
| 155 | |
| 156 | psa_status_t psa_driver_wrapper_hash_abort( |
Steven Cooreman | dbf8ced | 2021-03-04 13:01:18 +0100 | [diff] [blame] | 157 | psa_hash_operation_t *operation ); |
Steven Cooreman | 1e58235 | 2021-02-18 17:24:37 +0100 | [diff] [blame] | 158 | |
Steven Cooreman | cd84cb4 | 2020-07-16 20:28:36 +0200 | [diff] [blame] | 159 | #endif /* PSA_CRYPTO_DRIVER_WRAPPERS_H */ |
| 160 | |
| 161 | /* End of automatically generated file. */ |