Nicolas Toromanoff | db13fac | 2020-09-30 17:36:45 +0200 | [diff] [blame] | 1 | /* |
Lionel Debieve | 39ff592 | 2023-05-03 11:40:09 +0200 | [diff] [blame] | 2 | * Copyright (c) 2022-2023, STMicroelectronics - All Rights Reserved |
Nicolas Toromanoff | db13fac | 2020-09-30 17:36:45 +0200 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | #ifndef STM32_PKA_H |
| 8 | #define STM32_PKA_H |
| 9 | |
| 10 | #include <stdint.h> |
| 11 | |
Nicolas Toromanoff | db13fac | 2020-09-30 17:36:45 +0200 | [diff] [blame] | 12 | enum stm32_pka_ecdsa_curve_id { |
Nicolas Toromanoff | db13fac | 2020-09-30 17:36:45 +0200 | [diff] [blame] | 13 | PKA_NIST_P256, |
Nicolas Toromanoff | db13fac | 2020-09-30 17:36:45 +0200 | [diff] [blame] | 14 | PKA_BRAINPOOL_P256R1, |
Nicolas Toromanoff | db13fac | 2020-09-30 17:36:45 +0200 | [diff] [blame] | 15 | PKA_BRAINPOOL_P256T1, |
Nicolas Toromanoff | db13fac | 2020-09-30 17:36:45 +0200 | [diff] [blame] | 16 | PKA_NIST_P521, |
Nicolas Toromanoff | db13fac | 2020-09-30 17:36:45 +0200 | [diff] [blame] | 17 | }; |
| 18 | |
| 19 | struct stm32_pka_platdata { |
| 20 | uintptr_t base; |
| 21 | unsigned long clock_id; |
| 22 | unsigned int reset_id; |
| 23 | }; |
| 24 | |
| 25 | int stm32_pka_init(void); |
| 26 | int stm32_pka_ecdsa_verif(void *hash, unsigned int hash_size, |
| 27 | void *sig_r_ptr, unsigned int sig_r_size, |
| 28 | void *sig_s_ptr, unsigned int sig_s_size, |
| 29 | void *pk_x_ptr, unsigned int pk_x_size, |
| 30 | void *pk_y_ptr, unsigned int pk_y_size, |
| 31 | enum stm32_pka_ecdsa_curve_id cid); |
| 32 | |
| 33 | #endif /* STM32_PKA_H */ |