1 /* 2 * Function signatures for functionality that can be provided by 3 * cryptographic accelerators. 4 * Warning: This file will be auto-generated in the future. 5 */ 6 /* Copyright The Mbed TLS Contributors 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. 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 28 /* 29 * Signature functions 30 */ 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 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 46 /* 47 * Key handling functions 48 */ 49 50 psa_status_t psa_driver_wrapper_generate_key( const psa_key_attributes_t *attributes, 51 psa_key_slot_t *slot ); 52 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 58 psa_status_t psa_driver_wrapper_export_public_key( const psa_key_slot_t *slot, 59 uint8_t *data, 60 size_t data_size, 61 size_t *data_length ); 62 63 /* 64 * Cipher functions 65 */ 66 psa_status_t psa_driver_wrapper_cipher_encrypt( 67 psa_key_slot_t *slot, 68 psa_algorithm_t alg, 69 const uint8_t *input, 70 size_t input_length, 71 uint8_t *output, 72 size_t output_size, 73 size_t *output_length ); 74 75 psa_status_t psa_driver_wrapper_cipher_decrypt( 76 psa_key_slot_t *slot, 77 psa_algorithm_t alg, 78 const uint8_t *input, 79 size_t input_length, 80 uint8_t *output, 81 size_t output_size, 82 size_t *output_length ); 83 84 psa_status_t psa_driver_wrapper_cipher_encrypt_setup( 85 psa_operation_driver_context_t *operation, 86 psa_key_slot_t *slot, 87 psa_algorithm_t alg ); 88 89 psa_status_t psa_driver_wrapper_cipher_decrypt_setup( 90 psa_operation_driver_context_t *operation, 91 psa_key_slot_t *slot, 92 psa_algorithm_t alg ); 93 94 psa_status_t psa_driver_wrapper_cipher_generate_iv( 95 psa_operation_driver_context_t *operation, 96 uint8_t *iv, 97 size_t iv_size, 98 size_t *iv_length ); 99 100 psa_status_t psa_driver_wrapper_cipher_set_iv( 101 psa_operation_driver_context_t *operation, 102 const uint8_t *iv, 103 size_t iv_length ); 104 105 psa_status_t psa_driver_wrapper_cipher_update( 106 psa_operation_driver_context_t *operation, 107 const uint8_t *input, 108 size_t input_length, 109 uint8_t *output, 110 size_t output_size, 111 size_t *output_length ); 112 113 psa_status_t psa_driver_wrapper_cipher_finish( 114 psa_operation_driver_context_t *operation, 115 uint8_t *output, 116 size_t output_size, 117 size_t *output_length ); 118 119 psa_status_t psa_driver_wrapper_cipher_abort( 120 psa_operation_driver_context_t *operation ); 121 122 #endif /* PSA_CRYPTO_DRIVER_WRAPPERS_H */ 123 124 /* End of automatically generated file. */ 125