This commit is contained in:
刘可亮
2024-01-27 08:47:24 +08:00
parent d3bd993b5f
commit 9f7ba67007
2345 changed files with 74421 additions and 76616 deletions

View File

@@ -0,0 +1,36 @@
#ifndef ECDH_H
#define ECDH_H
#ifdef __cplusplus
extern "C" {
#endif
#include "hal_pke.h"
//ECDH return code
#define ECDH_SUCCESS PKE_SUCCESS
#define ECDH_POINTOR_NULL (PKE_SUCCESS+0x60U)
#define ECDH_INVALID_INPUT (PKE_SUCCESS+0x61U)
#define ECDH_ZERO_ALL (PKE_SUCCESS+0x62U)
#define ECDH_INTEGER_TOO_BIG (PKE_SUCCESS+0x63U)
//APIs
u32 ecdh_compute_key(eccp_curve_t *curve, u8 *local_prikey, u8 *peer_pubkey, u8 *key,
u32 keyByteLen, KDF_FUNC kdf);
#ifdef ECDH_SEC
//ECDH return code(secure version)
#define ECDH_SUCCESS_S (0x8B9BC1E1U)
#define ECDH_ERROR_S (0xCBC192A3U)
u32 ecdh_compute_key_s(eccp_curve_t *curve, u8 *local_prikey, u8 *peer_pubkey, u8 *key,
u32 keyByteLen, KDF_FUNC kdf);
#endif
#ifdef __cplusplus
}
#endif
#endif