Steven Cooreman | a70d588 | 2020-07-16 20:26:18 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Test driver for signature functions |
| 3 | */ |
| 4 | /* Copyright (C) 2020, ARM Limited, All Rights Reserved |
| 5 | * SPDX-License-Identifier: Apache-2.0 |
| 6 | * |
| 7 | * Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 8 | * not use this file except in compliance with the License. |
| 9 | * You may obtain a copy of the License at |
| 10 | * |
| 11 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | * |
| 13 | * Unless required by applicable law or agreed to in writing, software |
| 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | * See the License for the specific language governing permissions and |
| 17 | * limitations under the License. |
| 18 | * |
| 19 | * This file is part of mbed TLS (https://tls.mbed.org) |
| 20 | */ |
| 21 | |
| 22 | #ifndef MBEDTLS_PSA_CRYPTO_TEST_DRIVERS_SIGNATURE_H |
| 23 | #define MBEDTLS_PSA_CRYPTO_TEST_DRIVERS_SIGNATURE_H |
| 24 | |
| 25 | #if !defined(MBEDTLS_CONFIG_FILE) |
| 26 | #include "mbedtls/config.h" |
| 27 | #else |
| 28 | #include MBEDTLS_CONFIG_FILE |
| 29 | #endif |
| 30 | |
| 31 | #if defined(MBEDTLS_TEST_HOOKS) |
| 32 | #include <psa/crypto_driver_common.h> |
| 33 | |
| 34 | extern void *test_driver_forced_output; |
| 35 | extern size_t test_driver_forced_output_length; |
| 36 | |
| 37 | extern psa_status_t test_transparent_signature_sign_hash_status; |
| 38 | extern unsigned long test_transparent_signature_sign_hash_hit; |
| 39 | |
Steven Cooreman | 55ae217 | 2020-07-17 19:46:15 +0200 | [diff] [blame^] | 40 | extern psa_status_t test_transparent_signature_verify_hash_status; |
| 41 | extern unsigned long test_transparent_signature_verify_hash_hit; |
| 42 | |
Steven Cooreman | a70d588 | 2020-07-16 20:26:18 +0200 | [diff] [blame] | 43 | psa_status_t test_transparent_signature_sign_hash( |
| 44 | const psa_key_attributes_t *attributes, |
| 45 | const uint8_t *key, size_t key_length, |
| 46 | psa_algorithm_t alg, |
| 47 | const uint8_t *hash, size_t hash_length, |
| 48 | uint8_t *signature, size_t signature_size, size_t *signature_length ); |
| 49 | |
| 50 | psa_status_t test_opaque_signature_sign_hash( |
| 51 | const psa_key_attributes_t *attributes, |
| 52 | const uint8_t *key, size_t key_length, |
| 53 | psa_algorithm_t alg, |
| 54 | const uint8_t *hash, size_t hash_length, |
| 55 | uint8_t *signature, size_t signature_size, size_t *signature_length ); |
| 56 | |
Steven Cooreman | 55ae217 | 2020-07-17 19:46:15 +0200 | [diff] [blame^] | 57 | psa_status_t test_transparent_signature_verify_hash( |
| 58 | const psa_key_attributes_t *attributes, |
| 59 | const uint8_t *key, size_t key_length, |
| 60 | psa_algorithm_t alg, |
| 61 | const uint8_t *hash, size_t hash_length, |
| 62 | const uint8_t *signature, size_t signature_length ); |
| 63 | |
| 64 | psa_status_t test_opaque_signature_verify_hash( |
| 65 | const psa_key_attributes_t *attributes, |
| 66 | const uint8_t *key, size_t key_length, |
| 67 | psa_algorithm_t alg, |
| 68 | const uint8_t *hash, size_t hash_length, |
| 69 | const uint8_t *signature, size_t signature_length ); |
| 70 | |
Steven Cooreman | a70d588 | 2020-07-16 20:26:18 +0200 | [diff] [blame] | 71 | #endif /* MBEDTLS_TEST_HOOKS */ |
| 72 | #endif /* MBEDTLS_PSA_CRYPTO_TEST_DRIVERS_SIGNATURE_H */ |