aboutsummaryrefslogtreecommitdiff
path: root/lib/sec_library/include/ecdh.h
diff options
context:
space:
mode:
authorthead_admin <occ_thead@service.alibaba.com>2023-03-05 22:36:05 +0800
committerthead_admin <occ_thead@service.alibaba.com>2023-03-05 22:36:05 +0800
commit51a2c4f06046f571caa47a9c7e4e725493020f3c (patch)
treec2dc07815806ab8236b742337e9f573a8facda6e /lib/sec_library/include/ecdh.h
parent02deb8b059118cd2b0fb3c8bbb6d73fd1f87115a (diff)
Linux_SDK_V1.1.2Linux_SDK_V1.1.2
Diffstat (limited to 'lib/sec_library/include/ecdh.h')
-rwxr-xr-x[-rw-r--r--]lib/sec_library/include/ecdh.h20
1 files changed, 11 insertions, 9 deletions
diff --git a/lib/sec_library/include/ecdh.h b/lib/sec_library/include/ecdh.h
index 06258ca1..cf1db702 100644..100755
--- a/lib/sec_library/include/ecdh.h
+++ b/lib/sec_library/include/ecdh.h
@@ -20,19 +20,21 @@
extern "C" {
#endif
+#define CSI_ECDH_PUBKEY_LEN (65-1)
+#define CSI_ECDH_PRIVKEY_LEN (32)
+#define CSI_ECDH_SHARE_LEN (64)
+#define CSI_ECDH_SHAREKEY_LEN (32)
/**
\brief ecdh cacl share secret
- \param[in] ecc ecc handle to operate.
- \param[in] pubkey Pointer to the A public key.
- \param[in] privkey Pointer to the B private key.
- \param[out] shareKey Pointer to the share secret.
- \param[out] len length of the share secret.
- \return \ref uint32_t
+ \param[in] ecc ecc handle to operate.
+ \param[in] pubkey Pointer to the A public key.
+ \param[in] prikey Pointer to the B private key.
+ \param[out] shareKey Pointer to the share secret.
+ \param[out] len length of the share secret.
+ \return Error code \ref csi_error_t
*/
-csi_error_t csi_ecdh_calc_secret(csi_ecc_t *ecc, uint8_t privkey[32],
- uint8_t pubkey[65], uint8_t shareKey[32],
- uint32_t *len);
+csi_error_t csi_ecdh_calc_secret(csi_ecc_t *ecc, uint8_t privkey[32], uint8_t pubkey[65], uint8_t shareKey[32], uint32_t *len);
#ifdef __cplusplus
extern "C" {