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
48typedef 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,
63int wc_curve448_make_key(
WC_RNG* rng,
int keysize, curve448_key* key);
66int wc_curve448_shared_secret(curve448_key* private_key,
67 curve448_key* public_key,
68 byte* out, word32* outlen);
71int wc_curve448_shared_secret_ex(curve448_key* private_key,
72 curve448_key* public_key,
73 byte* out, word32* outlen,
int endian);
76int wc_curve448_init(curve448_key* key);
79void wc_curve448_free(curve448_key* key);
84int wc_curve448_import_private(
const byte* priv, word32 privSz,
87int wc_curve448_import_private_ex(
const byte* priv, word32 privSz,
88 curve448_key* key,
int endian);
91int wc_curve448_import_private_raw(
const byte* priv, word32 privSz,
92 const byte* pub, word32 pubSz,
95int wc_curve448_import_private_raw_ex(
const byte* priv, word32 privSz,
96 const byte* pub, word32 pubSz,
97 curve448_key* key,
int endian);
99int wc_curve448_export_private_raw(curve448_key* key,
byte* out,
102int wc_curve448_export_private_raw_ex(curve448_key* key,
byte* out,
103 word32* outLen,
int endian);
106int wc_curve448_import_public(
const byte* in, word32 inLen,
109int wc_curve448_import_public_ex(
const byte* in, word32 inLen,
110 curve448_key* key,
int endian);
112int wc_curve448_check_public(
const byte* pub, word32 pubSz,
int endian);
115int wc_curve448_export_public(curve448_key* key,
byte* out, word32* outLen);
117int wc_curve448_export_public_ex(curve448_key* key,
byte* out,
118 word32* outLen,
int endian);
121int wc_curve448_export_key_raw(curve448_key* key,
122 byte* priv, word32 *privSz,
123 byte* pub, word32 *pubSz);
125int wc_curve448_export_key_raw_ex(curve448_key* key,
126 byte* priv, word32 *privSz,
127 byte* pub, word32 *pubSz,
131int wc_curve448_size(curve448_key* key);