ecdh.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * Copyright (C) 2017-2022 Alibaba Group Holding Limited
  3. */
  4. /******************************************************************************
  5. * @file drv/ecdh.h
  6. * @brief Header File for ECDH Driver
  7. * @version V3.3
  8. * @date 10.June 2022
  9. * @model ECC
  10. ******************************************************************************/
  11. #ifndef _DRV_ECDH_H_
  12. #define _DRV_ECDH_H_
  13. #include <stdint.h>
  14. #include "common.h"
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. /**
  19. \brief ecdh cacl share secret
  20. \param[in] ecc ecc handle to operate.
  21. \param[in] pubkey Pointer to the A public key.
  22. \param[in] privkey Pointer to the B private key.
  23. \param[out] shareKey Pointer to the share secret.
  24. \param[out] len length of the share secret.
  25. \return \ref uint32_t
  26. */
  27. csi_error_t csi_ecdh_calc_secret(csi_ecc_t *ecc, uint8_t privkey[32],
  28. uint8_t pubkey[65], uint8_t shareKey[32],
  29. uint32_t *len);
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif
  33. #endif