stm32_pka.h 734 B

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