xref: /rk3399_ARM-atf/include/drivers/st/stm32_pka.h (revision 3e2923199d582688fd16faf8abeea3d538ca109c)
1b0fbc02aSNicolas Toromanoff /*
2*6a187a00SLionel Debieve  * Copyright (c) 2022-2023, STMicroelectronics - All Rights Reserved
3b0fbc02aSNicolas Toromanoff  *
4b0fbc02aSNicolas Toromanoff  * SPDX-License-Identifier: BSD-3-Clause
5b0fbc02aSNicolas Toromanoff  */
6b0fbc02aSNicolas Toromanoff 
7b0fbc02aSNicolas Toromanoff #ifndef STM32_PKA_H
8b0fbc02aSNicolas Toromanoff #define STM32_PKA_H
9b0fbc02aSNicolas Toromanoff 
10b0fbc02aSNicolas Toromanoff #include <stdint.h>
11b0fbc02aSNicolas Toromanoff 
12b0fbc02aSNicolas Toromanoff enum stm32_pka_ecdsa_curve_id {
13b0fbc02aSNicolas Toromanoff 	PKA_NIST_P256,
14b0fbc02aSNicolas Toromanoff 	PKA_BRAINPOOL_P256R1,
15b0fbc02aSNicolas Toromanoff 	PKA_BRAINPOOL_P256T1,
16b0fbc02aSNicolas Toromanoff 	PKA_NIST_P521,
17b0fbc02aSNicolas Toromanoff };
18b0fbc02aSNicolas Toromanoff 
19b0fbc02aSNicolas Toromanoff struct stm32_pka_platdata {
20b0fbc02aSNicolas Toromanoff 	uintptr_t base;
21b0fbc02aSNicolas Toromanoff 	unsigned long clock_id;
22b0fbc02aSNicolas Toromanoff 	unsigned int reset_id;
23b0fbc02aSNicolas Toromanoff };
24b0fbc02aSNicolas Toromanoff 
25b0fbc02aSNicolas Toromanoff int stm32_pka_init(void);
26b0fbc02aSNicolas Toromanoff int stm32_pka_ecdsa_verif(void *hash, unsigned int hash_size,
27b0fbc02aSNicolas Toromanoff 			  void *sig_r_ptr, unsigned int sig_r_size,
28b0fbc02aSNicolas Toromanoff 			  void *sig_s_ptr, unsigned int sig_s_size,
29b0fbc02aSNicolas Toromanoff 			  void *pk_x_ptr, unsigned int pk_x_size,
30b0fbc02aSNicolas Toromanoff 			  void *pk_y_ptr, unsigned int pk_y_size,
31b0fbc02aSNicolas Toromanoff 			  enum stm32_pka_ecdsa_curve_id cid);
32b0fbc02aSNicolas Toromanoff 
33b0fbc02aSNicolas Toromanoff #endif /* STM32_PKA_H */
34