blob: 34b3f6b5fd7380b7a3ba11461e23a00cd76d305c [file] [log] [blame]
Nicolas Toromanoffdb13fac2020-09-30 17:36:45 +02001/*
Lionel Debieve39ff5922023-05-03 11:40:09 +02002 * Copyright (c) 2022-2023, STMicroelectronics - All Rights Reserved
Nicolas Toromanoffdb13fac2020-09-30 17:36:45 +02003 *
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 Toromanoffdb13fac2020-09-30 17:36:45 +020012enum stm32_pka_ecdsa_curve_id {
Nicolas Toromanoffdb13fac2020-09-30 17:36:45 +020013 PKA_NIST_P256,
Nicolas Toromanoffdb13fac2020-09-30 17:36:45 +020014 PKA_BRAINPOOL_P256R1,
Nicolas Toromanoffdb13fac2020-09-30 17:36:45 +020015 PKA_BRAINPOOL_P256T1,
Nicolas Toromanoffdb13fac2020-09-30 17:36:45 +020016 PKA_NIST_P521,
Nicolas Toromanoffdb13fac2020-09-30 17:36:45 +020017};
18
19struct stm32_pka_platdata {
20 uintptr_t base;
21 unsigned long clock_id;
22 unsigned int reset_id;
23};
24
25int stm32_pka_init(void);
26int 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 */