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
5 changes: 2 additions & 3 deletions doc/dox_comments/header_files/rsa.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,7 @@ int wc_RsaDirect(const byte* in, word32 inLen, byte* out, word32* outSz,
to out in outLen.

\return Success Upon successfully encrypting the input message, returns
0 for success and less than zero for failure. Also returns the number
bytes written to out by storing the value in outLen
the number of bytes written on success and less than zero for failure.
\return BAD_FUNC_ARG Returned if any of the input parameters are invalid
\return RSA_BUFFER_E Returned if the output buffer is too small to store
the ciphertext
Expand Down Expand Up @@ -1514,7 +1513,7 @@ int wc_RsaKeyToPublicDer_ex(RsaKey* key, byte* output, word32 inLen,
\param e exponent parameter to use for generating the key. A secure
choice is 65537
\param rng pointer to an RNG structure to use for random number generation
while making the ke
while making the key

_Example_
\code
Expand Down
2 changes: 2 additions & 0 deletions wrapper/rust/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ Run tests with:
| --- | --- |
| `/wrapper/rust` | Top level container for all Rust wrapper functionality. |
| `/wrapper/rust/wolfssl` | Top level for the `wolfssl` library crate. This crate contains high-level Rust sources that use the bindings from the `wolfssl-sys` crate. |
| `/wrapper/rust/wolfssl/src` | Source directory for `wolfssl` crate top-level modules. |
| `/wrapper/rust/wolfssl/src/wolfcrypt` | Source directory for submodules of `wolfssl::wolfcrypt` module. |
| `/wrapper/rust/wolfssl-sys` | Top level for the `wolfssl-sys` library crate. This crate contains only automatically generated bindings to the `wolfssl` C library. |
2 changes: 2 additions & 0 deletions wrapper/rust/include.am
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,7 @@ EXTRA_DIST += wrapper/rust/wolfssl/src/lib.rs
EXTRA_DIST += wrapper/rust/wolfssl/src/wolfcrypt.rs
EXTRA_DIST += wrapper/rust/wolfssl/src/wolfcrypt/aes.rs
EXTRA_DIST += wrapper/rust/wolfssl/src/wolfcrypt/random.rs
EXTRA_DIST += wrapper/rust/wolfssl/src/wolfcrypt/rsa.rs
EXTRA_DIST += wrapper/rust/wolfssl/tests/test_aes.rs
EXTRA_DIST += wrapper/rust/wolfssl/tests/test_random.rs
EXTRA_DIST += wrapper/rust/wolfssl/tests/test_rsa.rs
20 changes: 20 additions & 0 deletions wrapper/rust/wolfssl/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
/*
* Copyright (C) 2025 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/

pub mod wolfcrypt;
21 changes: 21 additions & 0 deletions wrapper/rust/wolfssl/src/wolfcrypt.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,23 @@
/*
* Copyright (C) 2025 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/

pub mod aes;
pub mod random;
pub mod rsa;
22 changes: 21 additions & 1 deletion wrapper/rust/wolfssl/src/wolfcrypt/aes.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
/*
* Copyright (C) 2025 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/

/*!
This crate provides a Rust wrapper for the wolfCrypt library's Advanced
This module provides a Rust wrapper for the wolfCrypt library's Advanced
Comment thread
holtrop marked this conversation as resolved.
Encryption Standard (AES) functionality.

It leverages the `wolfssl-sys` crate for low-level FFI bindings, encapsulating
Expand Down
24 changes: 22 additions & 2 deletions wrapper/rust/wolfssl/src/wolfcrypt/random.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
/*
* Copyright (C) 2025 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/

/*!
This crate provides a Rust wrapper for the wolfCrypt library's random number
This module provides a Rust wrapper for the wolfCrypt library's random number
generator (RNG).

It leverages the `wolfssl-sys` crate for low-level FFI bindings, encapsulating
Expand Down Expand Up @@ -38,7 +58,7 @@ use std::mem::{size_of, MaybeUninit};
/// ensures that the underlying wolfSSL RNG context is correctly freed when the
/// `RNG` struct goes out of scope, preventing memory leaks.
pub struct RNG {
wc_rng: ws::WC_RNG,
pub(crate) wc_rng: ws::WC_RNG,
}

impl RNG {
Expand Down
Loading