
|
My Project
|
Functions | |
| WOLFSSL_API int | wc_ed25519_make_key (WC_RNG *rng, int keysize, ed25519_key *key) |
| This function generates a new ed25519_key and stores it in key. | |
| WOLFSSL_API int | wc_ed25519_sign_msg (const byte *in, word32 inlen, byte *out, word32 *outlen, ed25519_key *key) |
| This function signs a message digest using an ed25519_key object to guarantee authenticity. | |
| WOLFSSL_API int | wc_ed25519_verify_msg (const byte *sig, word32 siglen, const byte *msg, word32 msglen, int *stat, ed25519_key *key) |
| This function verifies the ed25519 signature of a message to ensure authenticity. It returns the answer through stat, with 1 corresponding to a valid signature, and 0 corresponding to an invalid signature. | |
| WOLFSSL_API int | wc_ed25519_init (ed25519_key *key) |
| This function initializes an ed25519_key object for future use with message verification. | |
| WOLFSSL_API void | wc_ed25519_free (ed25519_key *key) |
| This function frees an ed25519 object after it has been used. | |
| WOLFSSL_API int | wc_ed25519_import_public (const byte *in, word32 inLen, ed25519_key *key) |
| This function imports a public ed25519_key pair from a buffer containing the public key. This function will handle both compressed and uncompressed keys. | |
| WOLFSSL_API int | wc_ed25519_import_private_key (const byte *priv, word32 privSz, const byte *pub, word32 pubSz, ed25519_key *key) |
| This function imports a public/private ed25519 key pair from a pair of buffers. This function will handle both compressed and uncompressed keys. | |
| WOLFSSL_API int | wc_ed25519_export_public (ed25519_key *, byte *out, word32 *outLen) |
| This function exports the private key from an ed25519_key structure. It stores the public key in the buffer out, and sets the bytes written to this buffer in outLen. | |
| WOLFSSL_API int | wc_ed25519_export_private_only (ed25519_key *key, byte *out, word32 *outLen) |
| This function exports only the private key from an ed25519_key structure. It stores the private key in the buffer out, and sets the bytes written to this buffer in outLen. | |
| WOLFSSL_API int | wc_ed25519_export_private (ed25519_key *key, byte *out, word32 *outLen) |
| Export the private key, including public part. | |
| WOLFSSL_API int | wc_ed25519_export_key (ed25519_key *key, byte *priv, word32 *privSz, byte *pub, word32 *pubSz) |
| Export full private key and public key. | |
| WOLFSSL_API int | wc_ed25519_size (ed25519_key *key) |
| This function returns the key size of an ed25519_key structure, or 32 bytes. | |
| WOLFSSL_API int | wc_ed25519_priv_size (ed25519_key *key) |
| Returns the private key size (secret + public) in bytes. | |
| WOLFSSL_API int | wc_ed25519_pub_size (ed25519_key *key) |
| Returns the compressed key size in bytes (public key). | |
| WOLFSSL_API int | wc_ed25519_sig_size (ed25519_key *key) |
| This function returns the size of an ed25519 signature (64 in bytes). | |
| WOLFSSL_API int wc_ed25519_export_key | ( | ed25519_key * | key, |
| byte * | priv, | ||
| word32 * | privSz, | ||
| byte * | pub, | ||
| word32 * | pubSz ) |
Export full private key and public key.
| key | The ed25519_key structure to export to. |
| priv | Byte array to store private key. |
| privSz | Size of priv buffer. |
| pub | Byte array to store public key. |
| pubSz | Size of pub buffer. |
Example
| WOLFSSL_API int wc_ed25519_export_private | ( | ed25519_key * | key, |
| byte * | out, | ||
| word32 * | outLen ) |
Export the private key, including public part.
| key | ed25519_key struct to export from. |
| out | Destination for private key. |
| outLen | Max length of output, set to the length of the exported private key. |
Example
| WOLFSSL_API int wc_ed25519_export_private_only | ( | ed25519_key * | key, |
| byte * | out, | ||
| word32 * | outLen ) |
This function exports only the private key from an ed25519_key structure. It stores the private key in the buffer out, and sets the bytes written to this buffer in outLen.
| key | pointer to an ed25519_key structure from which to export the private key |
| out | pointer to the buffer in which to store the private key |
| outLen | pointer to a word32 object with the size available in out. Set with the number of bytes written to out after successfully exporting the private key |
Example
| WOLFSSL_API int wc_ed25519_export_public | ( | ed25519_key * | key, |
| byte * | out, | ||
| word32 * | outLen ) |
This function exports the private key from an ed25519_key structure. It stores the public key in the buffer out, and sets the bytes written to this buffer in outLen.
| key | pointer to an ed25519_key structure from which to export the public key |
| out | pointer to the buffer in which to store the public key |
| outLen | pointer to a word32 object with the size available in out. Set with the number of bytes written to out after successfully exporting the private key |
Example
| WOLFSSL_API void wc_ed25519_free | ( | ed25519_key * | key | ) |
This function frees an ed25519 object after it has been used.
| key | pointer to the ed25519_key object to free |
Example
| WOLFSSL_API int wc_ed25519_import_private_key | ( | const byte * | priv, |
| word32 | privSz, | ||
| const byte * | pub, | ||
| word32 | pubSz, | ||
| ed25519_key * | key ) |
This function imports a public/private ed25519 key pair from a pair of buffers. This function will handle both compressed and uncompressed keys.
| priv | pointer to the buffer containing the private key |
| privSz | size of the private key |
| pub | pointer to the buffer containing the public key |
| pubSz | length of the public key |
| key | pointer to the ed25519_key object in which to store the imported private/public key pair |
Example
| WOLFSSL_API int wc_ed25519_import_public | ( | const byte * | in, |
| word32 | inLen, | ||
| ed25519_key * | key ) |
This function imports a public ed25519_key pair from a buffer containing the public key. This function will handle both compressed and uncompressed keys.
| in | pointer to the buffer containing the public key |
| inLen | length of the buffer containing the public key |
| key | pointer to the ed25519_key object in which to store the public key |
Example
| WOLFSSL_API int wc_ed25519_init | ( | ed25519_key * | key | ) |
This function initializes an ed25519_key object for future use with message verification.
| key | pointer to the ed25519_key object to initialize |
Example
| WOLFSSL_API int wc_ed25519_make_key | ( | WC_RNG * | rng, |
| int | keysize, | ||
| ed25519_key * | key ) |
This function generates a new ed25519_key and stores it in key.
| rng | pointer to an initialized RNG object with which to generate the key |
| keysize | length of key to generate. Should always be 32 for ed25519 |
| key | pointer to the ed25519_key for which to generate a key |
Example
| WOLFSSL_API int wc_ed25519_priv_size | ( | ed25519_key * | key | ) |
Returns the private key size (secret + public) in bytes.
| key | The ed25119_key struct |
Example
| WOLFSSL_API int wc_ed25519_pub_size | ( | ed25519_key * | key | ) |
Returns the compressed key size in bytes (public key).
| key | Pointer to the ed25519_key struct. |
Example
| WOLFSSL_API int wc_ed25519_sig_size | ( | ed25519_key * | key | ) |
This function returns the size of an ed25519 signature (64 in bytes).
| key | pointer to an ed25519_key structure for which to get the signature size |
Example
| WOLFSSL_API int wc_ed25519_sign_msg | ( | const byte * | in, |
| word32 | inlen, | ||
| byte * | out, | ||
| word32 * | outlen, | ||
| ed25519_key * | key ) |
This function signs a message digest using an ed25519_key object to guarantee authenticity.
| in | pointer to the buffer containing the message to sign |
| inlen | length of the message to sign |
| out | buffer in which to store the generated signature |
| outlen | max length of the output buffer. Will store the bytes written to out upon successfully generating a message signature |
| key | pointer to a private ed25519_key with which to generate the signature |
Example
| WOLFSSL_API int wc_ed25519_size | ( | ed25519_key * | key | ) |
This function returns the key size of an ed25519_key structure, or 32 bytes.
| key | pointer to an ed25519_key structure for which to get the key size |
Example
| WOLFSSL_API int wc_ed25519_verify_msg | ( | const byte * | sig, |
| word32 | siglen, | ||
| const byte * | msg, | ||
| word32 | msglen, | ||
| int * | stat, | ||
| ed25519_key * | key ) |
This function verifies the ed25519 signature of a message to ensure authenticity. It returns the answer through stat, with 1 corresponding to a valid signature, and 0 corresponding to an invalid signature.
| sig | pointer to the buffer containing the signature to verify |
| siglen | length of the signature to verify |
| msg | pointer to the buffer containing the message to verify |
| msglen | length of the message to verify |
| stat | pointer to the result of the verification. 1 indicates the message was successfully verified |
| key | pointer to a public ed25519 key with which to verify the signature |
Example