Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions doc/dox_comments/header_files/curve25519.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ int wc_curve25519_make_key(WC_RNG* rng, int keysize, curve25519_key* key);

\brief 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
buffer out and assigns the length of the secret key to outlen. Only
supports big endian.

\return 0 Returned on successfully computing a shared secret key.
Expand Down Expand Up @@ -93,7 +93,7 @@ int wc_curve25519_shared_secret(curve25519_key* private_key,

\brief 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
buffer out and assigns the length of the secret key to outlen. Supports
both big and little endian.

\return 0 Returned on successfully computing a shared secret key.
Expand Down Expand Up @@ -361,7 +361,7 @@ int wc_curve25519_import_private_raw_ex(const byte* priv, word32 privSz,
\return 0 Returned on successfully exporting the private key from the
curve25519_key structure.
\return BAD_FUNC_ARG Returned if any input parameters are NULL.
\return ECC_BAD_ARG_E Returned if wc_curve25519_size() is not equal to key.
\return ECC_BAD_ARG_E Returned if *outLen is less than wc_curve25519_size().

\param [in] key Pointer to the structure from which to export the key.
\param [out] out Pointer to the buffer in which to store the exported key.
Expand All @@ -372,7 +372,7 @@ int wc_curve25519_import_private_raw_ex(const byte* priv, word32 privSz,
\code
int ret;
byte priv[32];
int privSz;
word32 privSz;

curve25519_key key;
// initialize and make key
Expand Down Expand Up @@ -402,7 +402,7 @@ int wc_curve25519_export_private_raw(curve25519_key* key, byte* out,
\return 0 Returned on successfully exporting the private key from the
curve25519_key structure.
\return BAD_FUNC_ARG Returned if any input parameters are NULL.
\return ECC_BAD_ARG_E Returned if wc_curve25519_size() is not equal to key.
\return ECC_BAD_ARG_E Returned if *outLen is less than wc_curve25519_size().

\param [in] key Pointer to the structure from which to export the key.
\param [out] out Pointer to the buffer in which to store the exported key.
Expand All @@ -416,7 +416,7 @@ int wc_curve25519_export_private_raw(curve25519_key* key, byte* out,
int ret;

byte priv[32];
int privSz;
word32 privSz;
curve25519_key key;
// initialize and make key
ret = wc_curve25519_export_private_raw_ex(&key, priv, &privSz,
Expand Down Expand Up @@ -656,7 +656,7 @@ int wc_curve25519_export_public_ex(curve25519_key* key, byte* out,
\return ECC_BAD_ARG_E Returned if privSz is less than CURVE25519_KEY_SIZE or
pubSz is less than CURVE25519_PUB_KEY_SIZE.

\param [in] key Pointer to the curve448_key structure in from which to
\param [in] key Pointer to the curve25519_key structure in from which to
export the key pair.
\param [out] priv Pointer to the buffer in which to store the private key.
\param [in,out] privSz On in, is the size of the priv buffer in bytes.
Expand Down Expand Up @@ -702,7 +702,7 @@ int wc_curve25519_export_key_raw(curve25519_key* key,
\return ECC_BAD_ARG_E Returned if privSz is less than CURVE25519_KEY_SIZE or
pubSz is less than CURVE25519_PUB_KEY_SIZE.

\param [in] key Pointer to the curve448_key structure in from which to
\param [in] key Pointer to the curve25519_key structure in from which to
export the key pair.
\param [out] priv Pointer to the buffer in which to store the private key.
\param [in,out] privSz On in, is the size of the priv buffer in bytes.
Expand All @@ -725,7 +725,7 @@ int wc_curve25519_export_key_raw(curve25519_key* key,
curve25519_key key;
// initialize and make key

ret = wc_curve25519_export_key_raw_ex(&key,priv, &privSz, pub, &pubSz,
ret = wc_curve25519_export_key_raw_ex(&key, priv, &privSz, pub, &pubSz,
EC25519_BIG_ENDIAN);
if (ret != 0) {
// error exporting key
Expand Down
2 changes: 2 additions & 0 deletions wrapper/rust/include.am
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ EXTRA_DIST += wrapper/rust/wolfssl-wolfcrypt/headers.h
EXTRA_DIST += wrapper/rust/wolfssl-wolfcrypt/src/aes.rs
EXTRA_DIST += wrapper/rust/wolfssl-wolfcrypt/src/blake2.rs
EXTRA_DIST += wrapper/rust/wolfssl-wolfcrypt/src/cmac.rs
EXTRA_DIST += wrapper/rust/wolfssl-wolfcrypt/src/curve25519.rs
EXTRA_DIST += wrapper/rust/wolfssl-wolfcrypt/src/dh.rs
EXTRA_DIST += wrapper/rust/wolfssl-wolfcrypt/src/ecc.rs
EXTRA_DIST += wrapper/rust/wolfssl-wolfcrypt/src/ed25519.rs
Expand All @@ -30,6 +31,7 @@ EXTRA_DIST += wrapper/rust/wolfssl-wolfcrypt/src/sys.rs
EXTRA_DIST += wrapper/rust/wolfssl-wolfcrypt/tests/test_aes.rs
EXTRA_DIST += wrapper/rust/wolfssl-wolfcrypt/tests/test_blake2.rs
EXTRA_DIST += wrapper/rust/wolfssl-wolfcrypt/tests/test_cmac.rs
EXTRA_DIST += wrapper/rust/wolfssl-wolfcrypt/tests/test_curve25519.rs
EXTRA_DIST += wrapper/rust/wolfssl-wolfcrypt/tests/test_dh.rs
EXTRA_DIST += wrapper/rust/wolfssl-wolfcrypt/tests/test_ecc.rs
EXTRA_DIST += wrapper/rust/wolfssl-wolfcrypt/tests/test_ed25519.rs
Expand Down
4 changes: 4 additions & 0 deletions wrapper/rust/wolfssl-wolfcrypt/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ fn scan_cfg() -> Result<()> {
/* cmac */
check_cfg(&binding, "wc_InitCmac", "cmac");

/* curve25519 */
check_cfg(&binding, "wc_curve25519_make_pub", "curve25519");
check_cfg(&binding, "wc_curve25519_make_pub_blind", "curve25519_blinding");

/* dh */
check_cfg(&binding, "wc_InitDhKey", "dh");
check_cfg(&binding, "wc_DhGenerateParams", "dh_keygen");
Expand Down
2 changes: 2 additions & 0 deletions wrapper/rust/wolfssl-wolfcrypt/src/blake2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ This module provides a Rust wrapper for the wolfCrypt library's BLAKE2
functionality.
*/

#![cfg(any(blake2b, blake2s))]

use crate::sys;
use std::mem::MaybeUninit;

Expand Down
Loading