blob: 4c6cce95b93aec3394aa03a498429a641bf5a008 [file] [log] [blame]
Steven Cooremancd84cb42020-07-16 20:28:36 +02001/*
2 * Function signatures for functionality that can be provided by
3 * cryptographic accelerators.
Steven Cooreman56250fd2020-09-04 13:07:15 +02004 * Warning: This file will be auto-generated in the future.
Steven Cooremancd84cb42020-07-16 20:28:36 +02005 */
Steven Cooreman2c7b2f82020-09-02 13:43:46 +02006/* Copyright The Mbed TLS Contributors
Steven Cooremancd84cb42020-07-16 20:28:36 +02007 * 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 Cooremancd84cb42020-07-16 20:28:36 +020020 */
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 Cooreman37941cb2020-07-28 18:49:51 +020028/*
29 * Signature functions
30 */
Steven Cooremancd84cb42020-07-16 20:28:36 +020031psa_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 Cooreman55ae2172020-07-17 19:46:15 +020039psa_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 Cooreman04524762020-10-13 17:43:44 +020046/*
47 * Key handling functions
48 */
49
Steven Cooreman55ae2172020-07-17 19:46:15 +020050psa_status_t psa_driver_wrapper_generate_key( const psa_key_attributes_t *attributes,
51 psa_key_slot_t *slot );
52
Ronald Cron83282872020-11-22 14:02:39 +010053psa_status_t psa_driver_wrapper_import_key(
54 const psa_key_attributes_t *attributes,
55 const uint8_t *data, size_t data_length,
56 uint8_t *key_buffer, size_t key_buffer_size,
57 size_t *key_buffer_length, size_t *bits );
Steven Cooreman04524762020-10-13 17:43:44 +020058
Steven Cooremanb9b84422020-10-14 14:39:20 +020059psa_status_t psa_driver_wrapper_export_public_key( const psa_key_slot_t *slot,
60 uint8_t *data,
61 size_t data_size,
62 size_t *data_length );
63
Steven Cooreman37941cb2020-07-28 18:49:51 +020064/*
65 * Cipher functions
66 */
67psa_status_t psa_driver_wrapper_cipher_encrypt(
68 psa_key_slot_t *slot,
69 psa_algorithm_t alg,
70 const uint8_t *input,
71 size_t input_length,
72 uint8_t *output,
73 size_t output_size,
74 size_t *output_length );
75
76psa_status_t psa_driver_wrapper_cipher_decrypt(
77 psa_key_slot_t *slot,
78 psa_algorithm_t alg,
79 const uint8_t *input,
80 size_t input_length,
81 uint8_t *output,
82 size_t output_size,
83 size_t *output_length );
84
85psa_status_t psa_driver_wrapper_cipher_encrypt_setup(
Steven Cooremanfb81aa52020-09-09 12:01:43 +020086 psa_operation_driver_context_t *operation,
Steven Cooreman37941cb2020-07-28 18:49:51 +020087 psa_key_slot_t *slot,
88 psa_algorithm_t alg );
89
90psa_status_t psa_driver_wrapper_cipher_decrypt_setup(
Steven Cooremanfb81aa52020-09-09 12:01:43 +020091 psa_operation_driver_context_t *operation,
Steven Cooreman37941cb2020-07-28 18:49:51 +020092 psa_key_slot_t *slot,
93 psa_algorithm_t alg );
94
95psa_status_t psa_driver_wrapper_cipher_generate_iv(
Steven Cooremanfb81aa52020-09-09 12:01:43 +020096 psa_operation_driver_context_t *operation,
Steven Cooreman37941cb2020-07-28 18:49:51 +020097 uint8_t *iv,
98 size_t iv_size,
99 size_t *iv_length );
100
101psa_status_t psa_driver_wrapper_cipher_set_iv(
Steven Cooremanfb81aa52020-09-09 12:01:43 +0200102 psa_operation_driver_context_t *operation,
Steven Cooreman37941cb2020-07-28 18:49:51 +0200103 const uint8_t *iv,
104 size_t iv_length );
105
106psa_status_t psa_driver_wrapper_cipher_update(
Steven Cooremanfb81aa52020-09-09 12:01:43 +0200107 psa_operation_driver_context_t *operation,
Steven Cooreman37941cb2020-07-28 18:49:51 +0200108 const uint8_t *input,
109 size_t input_length,
110 uint8_t *output,
111 size_t output_size,
112 size_t *output_length );
113
114psa_status_t psa_driver_wrapper_cipher_finish(
Steven Cooremanfb81aa52020-09-09 12:01:43 +0200115 psa_operation_driver_context_t *operation,
Steven Cooreman37941cb2020-07-28 18:49:51 +0200116 uint8_t *output,
117 size_t output_size,
118 size_t *output_length );
119
120psa_status_t psa_driver_wrapper_cipher_abort(
Steven Cooremanfb81aa52020-09-09 12:01:43 +0200121 psa_operation_driver_context_t *operation );
Steven Cooreman37941cb2020-07-28 18:49:51 +0200122
Steven Cooremancd84cb42020-07-16 20:28:36 +0200123#endif /* PSA_CRYPTO_DRIVER_WRAPPERS_H */
124
125/* End of automatically generated file. */