curve25519.h
1 
36 WOLFSSL_API
37 int wc_curve25519_make_key(WC_RNG* rng, int keysize, curve25519_key* key);
38 
79 WOLFSSL_API
81  curve25519_key* public_key,
82  byte* out, word32* outlen);
83 
127 WOLFSSL_API
129  curve25519_key* public_key,
130  byte* out, word32* outlen, int endian);
131 
153 WOLFSSL_API
155 
175 WOLFSSL_API
177 
207 WOLFSSL_API
208 int wc_curve25519_import_private(const byte* priv, word32 privSz,
209  curve25519_key* key);
210 
244 WOLFSSL_API
245 int wc_curve25519_import_private_ex(const byte* priv, word32 privSz,
246  curve25519_key* key, int endian);
247 
289 WOLFSSL_API
290 int wc_curve25519_import_private_raw(const byte* priv, word32 privSz,
291  const byte* pub, word32 pubSz, curve25519_key* key);
292 
334 WOLFSSL_API
335 int wc_curve25519_import_private_raw_ex(const byte* priv, word32 privSz,
336  const byte* pub, word32 pubSz,
337  curve25519_key* key, int endian);
338 
375 WOLFSSL_API
377  word32* outLen);
378 
418 WOLFSSL_API
420  word32* outLen, int endian);
421 
461 WOLFSSL_API
462 int wc_curve25519_import_public(const byte* in, word32 inLen,
463  curve25519_key* key);
464 
505 WOLFSSL_API
506 int wc_curve25519_import_public_ex(const byte* in, word32 inLen,
507  curve25519_key* key, int endian);
508 
541 WOLFSSL_API
542 int wc_curve25519_export_public(curve25519_key* key, byte* out, word32* outLen);
543 
580 WOLFSSL_API
582  word32* outLen, int endian);
583 
620 WOLFSSL_API
622  byte* priv, word32 *privSz,
623  byte* pub, word32 *pubSz);
624 
665 WOLFSSL_API
667  byte* priv, word32 *privSz,
668  byte* pub, word32 *pubSz,
669  int endian);
670 
694 WOLFSSL_API
WOLFSSL_API int wc_curve25519_shared_secret(curve25519_key *private_key, curve25519_key *public_key, byte *out, word32 *outlen)
This function computes a shared secret key given a secret private key and a received public key...
Definition: curve25519.c:101
WOLFSSL_API int wc_curve25519_import_private_raw(const byte *priv, word32 privSz, const byte *pub, word32 pubSz, curve25519_key *key)
This function imports a public-private key pair into a curve25519_key structure. Big endian only...
Definition: curve25519.c:398
WOLFSSL_API int wc_curve25519_import_private_raw_ex(const byte *priv, word32 privSz, const byte *pub, word32 pubSz, curve25519_key *key, int endian)
This function imports a public-private key pair into a curve25519_key structure. Supports both big an...
Definition: curve25519.c:409
WOLFSSL_API int wc_curve25519_export_public(curve25519_key *key, byte *out, word32 *outLen)
This function exports a public key from the given key structure and stores the result in the out buff...
Definition: curve25519.c:179
WOLFSSL_API int wc_curve25519_import_private(const byte *priv, word32 privSz, curve25519_key *key)
This function imports a curve25519 private key only. (Big endian).
Definition: curve25519.c:426
WOLFSSL_API int wc_curve25519_import_private_ex(const byte *priv, word32 privSz, curve25519_key *key, int endian)
curve25519 private key import only. (Big or Little endian).
Definition: curve25519.c:435
WOLFSSL_API int wc_curve25519_export_key_raw_ex(curve25519_key *key, byte *priv, word32 *privSz, byte *pub, word32 *pubSz, int endian)
Export curve25519 key pair. Big or little endian.
Definition: curve25519.c:375
WOLFSSL_API int wc_curve25519_make_key(WC_RNG *rng, int keysize, curve25519_key *key)
This function generates a curve25519 key using the given random number generator, rng...
Definition: curve25519.c:54
WOLFSSL_API void wc_curve25519_free(curve25519_key *key)
This function frees a curve 25519 object.
Definition: curve25519.c:488
WOLFSSL_API int wc_curve25519_export_public_ex(curve25519_key *key, byte *out, word32 *outLen, int endian)
This function exports a public key from the given key structure and stores the result in the out buff...
Definition: curve25519.c:186
WOLFSSL_API int wc_curve25519_import_public(const byte *in, word32 inLen, curve25519_key *key)
This function imports a public key from the given in buffer and stores it in the curve25519_key struc...
Definition: curve25519.c:218
WOLFSSL_API int wc_curve25519_import_public_ex(const byte *in, word32 inLen, curve25519_key *key, int endian)
This function imports a public key from the given in buffer and stores it in the curve25519_key struc...
Definition: curve25519.c:226
WOLFSSL_API int wc_curve25519_shared_secret_ex(curve25519_key *private_key, curve25519_key *public_key, byte *out, word32 *outlen, int endian)
This function computes a shared secret key given a secret private key and a received public key...
Definition: curve25519.c:109
WOLFSSL_API int wc_curve25519_export_key_raw(curve25519_key *key, byte *priv, word32 *privSz, byte *pub, word32 *pubSz)
Export curve25519 key pair. Big endian only.
Definition: curve25519.c:365
WOLFSSL_API int wc_curve25519_export_private_raw_ex(curve25519_key *key, byte *out, word32 *outLen, int endian)
This function exports a private key from a curve25519_key structure and stores it in the given out bu...
Definition: curve25519.c:336
Definition: random.h:153
WOLFSSL_API int wc_curve25519_export_private_raw(curve25519_key *key, byte *out, word32 *outLen)
This function exports a private key from a curve25519_key structure and stores it in the given out bu...
Definition: curve25519.c:326
WOLFSSL_API int wc_curve25519_size(curve25519_key *key)
This function returns the key size of the given key structure.
Definition: curve25519.c:504
WOLFSSL_API int wc_curve25519_init(curve25519_key *key)
This function initializes a curve25519 key. It should be called before generating a key for the struc...
Definition: curve25519.c:469
Definition: curve25519.h:70