| 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 | */ | 
| Steven Cooreman | cd84cb4 | 2020-07-16 20:28:36 +0200 | [diff] [blame] | 31 | psa_status_t psa_driver_wrapper_sign_hash( psa_key_slot_t *slot, | 
|  | 32 | psa_algorithm_t alg, | 
|  | 33 | const uint8_t *hash, | 
|  | 34 | size_t hash_length, | 
|  | 35 | uint8_t *signature, | 
|  | 36 | size_t signature_size, | 
|  | 37 | size_t *signature_length ); | 
|  | 38 |  | 
| Steven Cooreman | 55ae217 | 2020-07-17 19:46:15 +0200 | [diff] [blame] | 39 | psa_status_t psa_driver_wrapper_verify_hash( psa_key_slot_t *slot, | 
|  | 40 | psa_algorithm_t alg, | 
|  | 41 | const uint8_t *hash, | 
|  | 42 | size_t hash_length, | 
|  | 43 | const uint8_t *signature, | 
|  | 44 | size_t signature_length ); | 
|  | 45 |  | 
| Steven Cooreman | 0452476 | 2020-10-13 17:43:44 +0200 | [diff] [blame] | 46 | /* | 
|  | 47 | * Key handling functions | 
|  | 48 | */ | 
|  | 49 |  | 
| Ronald Cron | 8328287 | 2020-11-22 14:02:39 +0100 | [diff] [blame] | 50 | psa_status_t psa_driver_wrapper_import_key( | 
|  | 51 | const psa_key_attributes_t *attributes, | 
|  | 52 | const uint8_t *data, size_t data_length, | 
|  | 53 | uint8_t *key_buffer, size_t key_buffer_size, | 
|  | 54 | size_t *key_buffer_length, size_t *bits ); | 
| Steven Cooreman | 0452476 | 2020-10-13 17:43:44 +0200 | [diff] [blame] | 55 |  | 
| Ronald Cron | 6722798 | 2020-11-26 15:16:05 +0100 | [diff] [blame] | 56 | psa_status_t psa_driver_wrapper_export_key( | 
|  | 57 | const psa_key_attributes_t *attributes, | 
|  | 58 | const uint8_t *key_buffer, size_t key_buffer_size, | 
|  | 59 | uint8_t *data, size_t data_size, size_t *data_length ); | 
|  | 60 |  | 
| Ronald Cron | 84cc994 | 2020-11-25 14:30:05 +0100 | [diff] [blame] | 61 | psa_status_t psa_driver_wrapper_export_public_key( | 
|  | 62 | const psa_key_attributes_t *attributes, | 
|  | 63 | const uint8_t *key_buffer, size_t key_buffer_size, | 
|  | 64 | uint8_t *data, size_t data_size, size_t *data_length ); | 
|  | 65 |  | 
| Ronald Cron | 9df74be | 2020-12-05 19:15:23 +0100 | [diff] [blame] | 66 | psa_status_t psa_driver_wrapper_get_key_buffer_size( | 
|  | 67 | const psa_key_attributes_t *attributes, | 
|  | 68 | size_t *key_buffer_size ); | 
|  | 69 |  | 
| Ronald Cron | 84cc994 | 2020-11-25 14:30:05 +0100 | [diff] [blame] | 70 | psa_status_t psa_driver_wrapper_generate_key( | 
|  | 71 | const psa_key_attributes_t *attributes, | 
| Ronald Cron | 977c247 | 2020-10-13 08:32:21 +0200 | [diff] [blame] | 72 | 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] | 73 |  | 
| Steven Cooreman | 37941cb | 2020-07-28 18:49:51 +0200 | [diff] [blame] | 74 | /* | 
|  | 75 | * Cipher functions | 
|  | 76 | */ | 
|  | 77 | psa_status_t psa_driver_wrapper_cipher_encrypt( | 
|  | 78 | psa_key_slot_t *slot, | 
|  | 79 | psa_algorithm_t alg, | 
|  | 80 | const uint8_t *input, | 
|  | 81 | size_t input_length, | 
|  | 82 | uint8_t *output, | 
|  | 83 | size_t output_size, | 
|  | 84 | size_t *output_length ); | 
|  | 85 |  | 
|  | 86 | psa_status_t psa_driver_wrapper_cipher_decrypt( | 
|  | 87 | psa_key_slot_t *slot, | 
|  | 88 | psa_algorithm_t alg, | 
|  | 89 | const uint8_t *input, | 
|  | 90 | size_t input_length, | 
|  | 91 | uint8_t *output, | 
|  | 92 | size_t output_size, | 
|  | 93 | size_t *output_length ); | 
|  | 94 |  | 
|  | 95 | psa_status_t psa_driver_wrapper_cipher_encrypt_setup( | 
| Steven Cooreman | fb81aa5 | 2020-09-09 12:01:43 +0200 | [diff] [blame] | 96 | psa_operation_driver_context_t *operation, | 
| Steven Cooreman | 37941cb | 2020-07-28 18:49:51 +0200 | [diff] [blame] | 97 | psa_key_slot_t *slot, | 
|  | 98 | psa_algorithm_t alg ); | 
|  | 99 |  | 
|  | 100 | psa_status_t psa_driver_wrapper_cipher_decrypt_setup( | 
| Steven Cooreman | fb81aa5 | 2020-09-09 12:01:43 +0200 | [diff] [blame] | 101 | psa_operation_driver_context_t *operation, | 
| Steven Cooreman | 37941cb | 2020-07-28 18:49:51 +0200 | [diff] [blame] | 102 | psa_key_slot_t *slot, | 
|  | 103 | psa_algorithm_t alg ); | 
|  | 104 |  | 
|  | 105 | psa_status_t psa_driver_wrapper_cipher_generate_iv( | 
| Steven Cooreman | fb81aa5 | 2020-09-09 12:01:43 +0200 | [diff] [blame] | 106 | psa_operation_driver_context_t *operation, | 
| Steven Cooreman | 37941cb | 2020-07-28 18:49:51 +0200 | [diff] [blame] | 107 | uint8_t *iv, | 
|  | 108 | size_t iv_size, | 
|  | 109 | size_t *iv_length ); | 
|  | 110 |  | 
|  | 111 | psa_status_t psa_driver_wrapper_cipher_set_iv( | 
| Steven Cooreman | fb81aa5 | 2020-09-09 12:01:43 +0200 | [diff] [blame] | 112 | psa_operation_driver_context_t *operation, | 
| Steven Cooreman | 37941cb | 2020-07-28 18:49:51 +0200 | [diff] [blame] | 113 | const uint8_t *iv, | 
|  | 114 | size_t iv_length ); | 
|  | 115 |  | 
|  | 116 | psa_status_t psa_driver_wrapper_cipher_update( | 
| Steven Cooreman | fb81aa5 | 2020-09-09 12:01:43 +0200 | [diff] [blame] | 117 | psa_operation_driver_context_t *operation, | 
| Steven Cooreman | 37941cb | 2020-07-28 18:49:51 +0200 | [diff] [blame] | 118 | const uint8_t *input, | 
|  | 119 | size_t input_length, | 
|  | 120 | uint8_t *output, | 
|  | 121 | size_t output_size, | 
|  | 122 | size_t *output_length ); | 
|  | 123 |  | 
|  | 124 | psa_status_t psa_driver_wrapper_cipher_finish( | 
| Steven Cooreman | fb81aa5 | 2020-09-09 12:01:43 +0200 | [diff] [blame] | 125 | psa_operation_driver_context_t *operation, | 
| Steven Cooreman | 37941cb | 2020-07-28 18:49:51 +0200 | [diff] [blame] | 126 | uint8_t *output, | 
|  | 127 | size_t output_size, | 
|  | 128 | size_t *output_length ); | 
|  | 129 |  | 
|  | 130 | psa_status_t psa_driver_wrapper_cipher_abort( | 
| Steven Cooreman | fb81aa5 | 2020-09-09 12:01:43 +0200 | [diff] [blame] | 131 | psa_operation_driver_context_t *operation ); | 
| Steven Cooreman | 37941cb | 2020-07-28 18:49:51 +0200 | [diff] [blame] | 132 |  | 
| Steven Cooreman | cd84cb4 | 2020-07-16 20:28:36 +0200 | [diff] [blame] | 133 | #endif /* PSA_CRYPTO_DRIVER_WRAPPERS_H */ | 
|  | 134 |  | 
|  | 135 | /* End of automatically generated file. */ |