SemiDrive SSDK Appication Program Interface PTG3.0
x25519.h
Go to the documentation of this file.
1/*****************************************************************************
2 *
3 *
4 *Copyright (c) 2021-2029 Semidrive Incorporated. All rights reserved.
5 *Software License Agreement
6 *
7 ******************************************************************************
8 */
9#ifndef X25519_H
10#define X25519_H
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16#include <pke.h>
17
18extern const mont_curve_t c25519[1];
19
20/*X25519 return code*/
21enum {
27};
28
29uint32_t x25519_get_pubkey_from_prikey(uint8_t prikey[32], uint8_t pubkey[32]);
30
31uint32_t x25519_getkey(uint8_t prikey[32], uint8_t pubkey[32]);
32
33uint32_t x25519_compute_key(uint8_t local_prikey[32], uint8_t peer_pubkey[32],
34 uint8_t *key, uint32_t keyByteLen, KDF_FUNC kdf);
35
36void x25519_decode_scalar(uint8_t *k, uint8_t *out, uint32_t bytes);
37#ifdef __cplusplus
38}
39#endif
40
41#endif
Semidrive CRYPTO pke header file.
@ PKE_SUCCESS
Definition: pke.h:101
void *(* KDF_FUNC)(const void *input, uint32_t bytelen, uint8_t *key, uint32_t keybytelen)
Definition: pke.h:112
Definition: eccp_curve.h:76
@ X25519_SUCCESS
Definition: x25519.h:22
@ X25519_ZERO_ALL
Definition: x25519.h:24
@ X25519_INVALID_OUTPUT
Definition: x25519.h:26
@ X25519_INVALID_INPUT
Definition: x25519.h:25
@ X25519_POINTER_NULL
Definition: x25519.h:23
uint32_t x25519_compute_key(uint8_t local_prikey[32], uint8_t peer_pubkey[32], uint8_t *key, uint32_t keyByteLen, KDF_FUNC kdf)
void x25519_decode_scalar(uint8_t *k, uint8_t *out, uint32_t bytes)
uint32_t x25519_getkey(uint8_t prikey[32], uint8_t pubkey[32])
const mont_curve_t c25519[1]
uint32_t x25519_get_pubkey_from_prikey(uint8_t prikey[32], uint8_t pubkey[32])