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 | |
Steven Cooreman | 55ae217 | 2020-07-17 19:46:15 +0200 | [diff] [blame] | 50 | psa_status_t psa_driver_wrapper_generate_key( const psa_key_attributes_t *attributes, |
| 51 | psa_key_slot_t *slot ); |
| 52 | |
Steven Cooreman | 0452476 | 2020-10-13 17:43:44 +0200 | [diff] [blame^] | 53 | psa_status_t psa_driver_wrapper_validate_key( const psa_key_attributes_t *attributes, |
| 54 | const uint8_t *data, |
| 55 | size_t data_length, |
| 56 | size_t *bits ); |
| 57 | |
Steven Cooreman | 37941cb | 2020-07-28 18:49:51 +0200 | [diff] [blame] | 58 | /* |
| 59 | * Cipher functions |
| 60 | */ |
| 61 | psa_status_t psa_driver_wrapper_cipher_encrypt( |
| 62 | psa_key_slot_t *slot, |
| 63 | psa_algorithm_t alg, |
| 64 | const uint8_t *input, |
| 65 | size_t input_length, |
| 66 | uint8_t *output, |
| 67 | size_t output_size, |
| 68 | size_t *output_length ); |
| 69 | |
| 70 | psa_status_t psa_driver_wrapper_cipher_decrypt( |
| 71 | psa_key_slot_t *slot, |
| 72 | psa_algorithm_t alg, |
| 73 | const uint8_t *input, |
| 74 | size_t input_length, |
| 75 | uint8_t *output, |
| 76 | size_t output_size, |
| 77 | size_t *output_length ); |
| 78 | |
| 79 | psa_status_t psa_driver_wrapper_cipher_encrypt_setup( |
Steven Cooreman | fb81aa5 | 2020-09-09 12:01:43 +0200 | [diff] [blame] | 80 | psa_operation_driver_context_t *operation, |
Steven Cooreman | 37941cb | 2020-07-28 18:49:51 +0200 | [diff] [blame] | 81 | psa_key_slot_t *slot, |
| 82 | psa_algorithm_t alg ); |
| 83 | |
| 84 | psa_status_t psa_driver_wrapper_cipher_decrypt_setup( |
Steven Cooreman | fb81aa5 | 2020-09-09 12:01:43 +0200 | [diff] [blame] | 85 | psa_operation_driver_context_t *operation, |
Steven Cooreman | 37941cb | 2020-07-28 18:49:51 +0200 | [diff] [blame] | 86 | psa_key_slot_t *slot, |
| 87 | psa_algorithm_t alg ); |
| 88 | |
| 89 | psa_status_t psa_driver_wrapper_cipher_generate_iv( |
Steven Cooreman | fb81aa5 | 2020-09-09 12:01:43 +0200 | [diff] [blame] | 90 | psa_operation_driver_context_t *operation, |
Steven Cooreman | 37941cb | 2020-07-28 18:49:51 +0200 | [diff] [blame] | 91 | uint8_t *iv, |
| 92 | size_t iv_size, |
| 93 | size_t *iv_length ); |
| 94 | |
| 95 | psa_status_t psa_driver_wrapper_cipher_set_iv( |
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 | const uint8_t *iv, |
| 98 | size_t iv_length ); |
| 99 | |
| 100 | psa_status_t psa_driver_wrapper_cipher_update( |
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 | const uint8_t *input, |
| 103 | size_t input_length, |
| 104 | uint8_t *output, |
| 105 | size_t output_size, |
| 106 | size_t *output_length ); |
| 107 | |
| 108 | psa_status_t psa_driver_wrapper_cipher_finish( |
Steven Cooreman | fb81aa5 | 2020-09-09 12:01:43 +0200 | [diff] [blame] | 109 | psa_operation_driver_context_t *operation, |
Steven Cooreman | 37941cb | 2020-07-28 18:49:51 +0200 | [diff] [blame] | 110 | uint8_t *output, |
| 111 | size_t output_size, |
| 112 | size_t *output_length ); |
| 113 | |
| 114 | psa_status_t psa_driver_wrapper_cipher_abort( |
Steven Cooreman | fb81aa5 | 2020-09-09 12:01:43 +0200 | [diff] [blame] | 115 | psa_operation_driver_context_t *operation ); |
Steven Cooreman | 37941cb | 2020-07-28 18:49:51 +0200 | [diff] [blame] | 116 | |
Steven Cooreman | cd84cb4 | 2020-07-16 20:28:36 +0200 | [diff] [blame] | 117 | #endif /* PSA_CRYPTO_DRIVER_WRAPPERS_H */ |
| 118 | |
| 119 | /* End of automatically generated file. */ |