My Project
|
Functions | |
int | wc_curve448_make_key (WC_RNG *rng, int keysize, curve448_key *key) |
This function generates a Curve448 key using the given random number generator, rng, of the size given (keysize), and stores it in the given curve448_key structure. It should be called after the key structure has been initialized through wc_curve448_init(). | |
int | wc_curve448_shared_secret (curve448_key *private_key, curve448_key *public_key, byte *out, word32 *outlen) |
This function computes a shared secret key given a secret private key and a received public key. It stores the generated secret key in the buffer out and assigns the variable of the secret key to outlen. Only supports big endian. | |
int | wc_curve448_shared_secret_ex (curve448_key *private_key, curve448_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. It stores the generated secret key in the buffer out and assigns the variable of the secret key to outlen. Supports both big and little endian. | |
int | wc_curve448_init (curve448_key *key) |
This function initializes a Curve448 key. It should be called before generating a key for the structure. | |
void | wc_curve448_free (curve448_key *key) |
This function frees a Curve448 object. | |
int | wc_curve448_import_private (const byte *priv, word32 privSz, curve448_key *key) |
This function imports a curve448 private key only. (Big endian). | |
int | wc_curve448_import_private_ex (const byte *priv, word32 privSz, curve448_key *key, int endian) |
curve448 private key import only. (Big or Little endian). | |
int | wc_curve448_import_private_raw (const byte *priv, word32 privSz, const byte *pub, word32 pubSz, curve448_key *key) |
This function imports a public-private key pair into a curve448_key structure. Big endian only. | |
int | wc_curve448_import_private_raw_ex (const byte *priv, word32 privSz, const byte *pub, word32 pubSz, curve448_key *key, int endian) |
This function imports a public-private key pair into a curve448_key structure. Supports both big and little endian. | |
int | wc_curve448_export_private_raw (curve448_key *key, byte *out, word32 *outLen) |
This function exports a private key from a curve448_key structure and stores it in the given out buffer. It also sets outLen to be the size of the exported key. Big Endian only. | |
int | wc_curve448_export_private_raw_ex (curve448_key *key, byte *out, word32 *outLen, int endian) |
This function exports a private key from a curve448_key structure and stores it in the given out buffer. It also sets outLen to be the size of the exported key. Can specify whether it's big or little endian. | |
int | wc_curve448_import_public (const byte *in, word32 inLen, curve448_key *key) |
This function imports a public key from the given in buffer and stores it in the curve448_key structure. | |
int | wc_curve448_import_public_ex (const byte *in, word32 inLen, curve448_key *key, int endian) |
This function imports a public key from the given in buffer and stores it in the curve448_key structure. | |
int | wc_curve448_check_public (const byte *pub, word32 pubSz, int endian) |
This function checks that a public key buffer holds a valid Curve448 key value given the endian ordering. | |
int | wc_curve448_export_public (curve448_key *key, byte *out, word32 *outLen) |
This function exports a public key from the given key structure and stores the result in the out buffer. Big endian only. | |
int | wc_curve448_export_public_ex (curve448_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 buffer. Supports both big and little endian. | |
int | wc_curve448_export_key_raw (curve448_key *key, byte *priv, word32 *privSz, byte *pub, word32 *pubSz) |
This function exports a key pair from the given key structure and stores the result in the out buffer. Big endian only. | |
int | wc_curve448_export_key_raw_ex (curve448_key *key, byte *priv, word32 *privSz, byte *pub, word32 *pubSz, int endian) |
Export curve448 key pair. Big or little endian. | |
int | wc_curve448_size (curve448_key *key) |
This function returns the key size of the given key structure. | |
int wc_curve448_check_public | ( | const byte * | pub, |
word32 | pubSz, | ||
int | endian | ||
) |
This function checks that a public key buffer holds a valid Curve448 key value given the endian ordering.
[in] | pub | Pointer to the buffer containing the public key to check. |
[in] | pubLen | Length of the public key to check. |
[in] | endian | EC448_BIG_ENDIAN or EC448_LITTLE_ENDIAN to set which form to use. |
Example
int wc_curve448_export_key_raw | ( | curve448_key * | key, |
byte * | priv, | ||
word32 * | privSz, | ||
byte * | pub, | ||
word32 * | pubSz | ||
) |
This function exports a key pair from the given key structure and stores the result in the out buffer. Big endian only.
[in] | key | Pointer to the curve448_key structure in from which to export the key pair. |
[out] | priv | Pointer to the buffer in which to store the private key. |
[in,out] | privSz | On in, is the size of the priv buffer in bytes. On out, will store the bytes written to the priv buffer. |
[out] | pub | Pointer to the buffer in which to store the public key. |
[in,out] | pubSz | On in, is the size of the pub buffer in bytes. On out, will store the bytes written to the pub buffer. |
Example
int wc_curve448_export_key_raw_ex | ( | curve448_key * | key, |
byte * | priv, | ||
word32 * | privSz, | ||
byte * | pub, | ||
word32 * | pubSz, | ||
int | endian | ||
) |
Export curve448 key pair. Big or little endian.
This function exports a key pair from the given key structure and stores the result in the out buffer. Big or little endian.
[in] | key | Pointer to the curve448_key structure in from which to export the key pair. |
[out] | priv | Pointer to the buffer in which to store the private key. |
[in,out] | privSz | On in, is the size of the priv buffer in bytes. On out, will store the bytes written to the priv buffer. |
[out] | pub | Pointer to the buffer in which to store the public key. |
[in,out] | pubSz | On in, is the size of the pub buffer in bytes. On out, will store the bytes written to the pub buffer. |
[in] | endian | EC448_BIG_ENDIAN or EC448_LITTLE_ENDIAN to set which form to use. |
Example
int wc_curve448_export_private_raw | ( | curve448_key * | key, |
byte * | out, | ||
word32 * | outLen | ||
) |
This function exports a private key from a curve448_key structure and stores it in the given out buffer. It also sets outLen to be the size of the exported key. Big Endian only.
[in] | key | Pointer to the structure from which to export the key. |
[out] | out | Pointer to the buffer in which to store the exported key. |
[in,out] | outLen | On in, is the size of the out in bytes. On out, will store the bytes written to the output buffer. |
Example
int wc_curve448_export_private_raw_ex | ( | curve448_key * | key, |
byte * | out, | ||
word32 * | outLen, | ||
int | endian | ||
) |
This function exports a private key from a curve448_key structure and stores it in the given out buffer. It also sets outLen to be the size of the exported key. Can specify whether it's big or little endian.
[in] | key | Pointer to the structure from which to export the key. |
[out] | out | Pointer to the buffer in which to store the exported key. |
[in,out] | outLen | On in, is the size of the out in bytes. On out, will store the bytes written to the output buffer. |
[in] | endian | EC448_BIG_ENDIAN or EC448_LITTLE_ENDIAN to set which form to use. |
Example
int wc_curve448_export_public | ( | curve448_key * | key, |
byte * | out, | ||
word32 * | outLen | ||
) |
This function exports a public key from the given key structure and stores the result in the out buffer. Big endian only.
[in] | key | Pointer to the curve448_key structure in from which to export the key. |
[out] | out | Pointer to the buffer in which to store the public key. |
[in,out] | outLen | On in, is the size of the out in bytes. On out, will store the bytes written to the output buffer. |
Example
int wc_curve448_export_public_ex | ( | curve448_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 buffer. Supports both big and little endian.
[in] | key | Pointer to the curve448_key structure in from which to export the key. |
[out] | out | Pointer to the buffer in which to store the public key. |
[in,out] | outLen | On in, is the size of the out in bytes. On out, will store the bytes written to the output buffer. |
[in] | endian | EC448_BIG_ENDIAN or EC448_LITTLE_ENDIAN to set which form to use. |
Example
void wc_curve448_free | ( | curve448_key * | key | ) |
This function frees a Curve448 object.
[in,out] | key | Pointer to the key object to free. |
Example
int wc_curve448_import_private | ( | const byte * | priv, |
word32 | privSz, | ||
curve448_key * | key | ||
) |
This function imports a curve448 private key only. (Big endian).
[in] | priv | Pointer to a buffer containing the private key to import. |
[in] | privSz | Length of the private key to import. |
[in,out] | key | Pointer to the structure in which to store the imported key. |
Example
int wc_curve448_import_private_ex | ( | const byte * | priv, |
word32 | privSz, | ||
curve448_key * | key, | ||
int | endian | ||
) |
curve448 private key import only. (Big or Little endian).
[in] | priv | Pointer to a buffer containing the private key to import. |
[in] | privSz | Length of the private key to import. |
[in,out] | key | Pointer to the structure in which to store the imported key. |
[in] | endian | EC448_BIG_ENDIAN or EC448_LITTLE_ENDIAN to set which form to use. |
Example
int wc_curve448_import_private_raw | ( | const byte * | priv, |
word32 | privSz, | ||
const byte * | pub, | ||
word32 | pubSz, | ||
curve448_key * | key | ||
) |
This function imports a public-private key pair into a curve448_key structure. Big endian only.
[in] | priv | Pointer to a buffer containing the private key to import. |
[in] | privSz | Length of the private key to import. |
[in] | pub | Pointer to a buffer containing the public key to import. |
[in] | pubSz | Length of the public key to import. |
[in,out] | key | Pointer to the structure in which to store the imported keys |
Example
int wc_curve448_import_private_raw_ex | ( | const byte * | priv, |
word32 | privSz, | ||
const byte * | pub, | ||
word32 | pubSz, | ||
curve448_key * | key, | ||
int | endian | ||
) |
This function imports a public-private key pair into a curve448_key structure. Supports both big and little endian.
[in] | priv | Pointer to a buffer containing the private key to import. |
[in] | privSz | Length of the private key to import. |
[in] | pub | Pointer to a buffer containing the public key to import. |
[in] | pubSz | Length of the public key to import. |
[in,out] | key | Pointer to the structure in which to store the imported keys. |
[in] | endian | EC448_BIG_ENDIAN or EC448_LITTLE_ENDIAN to set which form to use. |
Example
int wc_curve448_import_public | ( | const byte * | in, |
word32 | inLen, | ||
curve448_key * | key | ||
) |
This function imports a public key from the given in buffer and stores it in the curve448_key structure.
[in] | in | Pointer to the buffer containing the public key to import. |
[in] | inLen | Length of the public key to import. |
[in,out] | key | Pointer to the curve448_key structure in which to store the key. |
Example
int wc_curve448_import_public_ex | ( | const byte * | in, |
word32 | inLen, | ||
curve448_key * | key, | ||
int | endian | ||
) |
This function imports a public key from the given in buffer and stores it in the curve448_key structure.
[in] | in | Pointer to the buffer containing the public key to import. |
[in] | inLen | Length of the public key to import. |
[in,out] | key | Pointer to the curve448_key structure in which to store the key. |
[in] | endian | EC448_BIG_ENDIAN or EC448_LITTLE_ENDIAN to set which form to use. |
Example
int wc_curve448_init | ( | curve448_key * | key | ) |
This function initializes a Curve448 key. It should be called before generating a key for the structure.
[in,out] | key | Pointer to the curve448_key structure to initialize. |
Example
int wc_curve448_make_key | ( | WC_RNG * | rng, |
int | keysize, | ||
curve448_key * | key | ||
) |
This function generates a Curve448 key using the given random number generator, rng, of the size given (keysize), and stores it in the given curve448_key structure. It should be called after the key structure has been initialized through wc_curve448_init().
[in] | rng | Pointer to the RNG object used to generate the ecc key. |
[in] | keysize | Size of the key to generate. Must be 56 bytes for curve448. |
[in,out] | key | Pointer to the curve448_key structure in which to store the generated key. |
Example
int wc_curve448_shared_secret | ( | curve448_key * | private_key, |
curve448_key * | public_key, | ||
byte * | out, | ||
word32 * | outlen | ||
) |
This function computes a shared secret key given a secret private key and a received public key. It stores the generated secret key in the buffer out and assigns the variable of the secret key to outlen. Only supports big endian.
[in] | private_key | Pointer to the curve448_key structure initialized with the user’s private key. |
[in] | public_key | Pointer to the curve448_key structure containing the received public key. |
[out] | out | Pointer to a buffer in which to store the 56 byte computed secret key. |
[in,out] | outlen | Pointer in which to store the length written to the output buffer. |
Example
int wc_curve448_shared_secret_ex | ( | curve448_key * | private_key, |
curve448_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. It stores the generated secret key in the buffer out and assigns the variable of the secret key to outlen. Supports both big and little endian.
[in] | private_key | Pointer to the curve448_key structure initialized with the user’s private key. |
[in] | public_key | Pointer to the curve448_key structure containing the received public key. |
[out] | out | Pointer to a buffer in which to store the 56 byte computed secret key. |
[in,out] | outlen | Pointer in which to store the length written to the output buffer. |
[in] | endian | EC448_BIG_ENDIAN or EC448_LITTLE_ENDIAN to set which form to use. |
Example
int wc_curve448_size | ( | curve448_key * | key | ) |
This function returns the key size of the given key structure.
[in] | key | Pointer to the curve448_key structure in for which to determine the key size. |
Example