25 #ifndef WOLF_CRYPT_CURVE448_H 26 #define WOLF_CRYPT_CURVE448_H 32 #include <wolfssl/wolfcrypt/fe_448.h> 35 #ifdef WOLFSSL_ASYNC_CRYPT 36 #include <wolfssl/wolfcrypt/async.h> 43 #define CURVE448_KEY_SIZE 56 44 #define CURVE448_PUB_KEY_SIZE 56 48 typedef struct curve448_key {
49 byte p[CURVE448_PUB_KEY_SIZE];
50 byte k[CURVE448_KEY_SIZE];
52 #ifdef WOLFSSL_ASYNC_CRYPT 53 WC_ASYNC_DEV asyncDev;
58 EC448_LITTLE_ENDIAN = 0,
63 int wc_curve448_make_key(
WC_RNG* rng,
int keysize, curve448_key* key);
66 int wc_curve448_shared_secret(curve448_key* private_key,
67 curve448_key* public_key,
68 byte* out, word32* outlen);
71 int wc_curve448_shared_secret_ex(curve448_key* private_key,
72 curve448_key* public_key,
73 byte* out, word32* outlen,
int endian);
76 int wc_curve448_init(curve448_key* key);
79 void wc_curve448_free(curve448_key* key);
84 int wc_curve448_import_private(
const byte* priv, word32 privSz,
87 int wc_curve448_import_private_ex(
const byte* priv, word32 privSz,
88 curve448_key* key,
int endian);
91 int wc_curve448_import_private_raw(
const byte* priv, word32 privSz,
92 const byte* pub, word32 pubSz,
95 int wc_curve448_import_private_raw_ex(
const byte* priv, word32 privSz,
96 const byte* pub, word32 pubSz,
97 curve448_key* key,
int endian);
99 int wc_curve448_export_private_raw(curve448_key* key, byte* out,
102 int wc_curve448_export_private_raw_ex(curve448_key* key, byte* out,
103 word32* outLen,
int endian);
106 int wc_curve448_import_public(
const byte* in, word32 inLen,
109 int wc_curve448_import_public_ex(
const byte* in, word32 inLen,
110 curve448_key* key,
int endian);
112 int wc_curve448_check_public(
const byte* pub, word32 pubSz,
int endian);
115 int wc_curve448_export_public(curve448_key* key, byte* out, word32* outLen);
117 int wc_curve448_export_public_ex(curve448_key* key, byte* out,
118 word32* outLen,
int endian);
121 int wc_curve448_export_key_raw(curve448_key* key,
122 byte* priv, word32 *privSz,
123 byte* pub, word32 *pubSz);
125 int wc_curve448_export_key_raw_ex(curve448_key* key,
126 byte* priv, word32 *privSz,
127 byte* pub, word32 *pubSz,
131 int wc_curve448_size(curve448_key* key);