Skip to content

Commit ab5d9ad

Browse files
Rust wrapper: add wolfssl::wolfcrypt::rsa module
1 parent d4242fa commit ab5d9ad

7 files changed

Lines changed: 1171 additions & 6 deletions

File tree

doc/dox_comments/header_files/rsa.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,7 @@ int wc_RsaDirect(const byte* in, word32 inLen, byte* out, word32* outSz,
185185
to out in outLen.
186186
187187
\return Success Upon successfully encrypting the input message, returns
188-
0 for success and less than zero for failure. Also returns the number
189-
bytes written to out by storing the value in outLen
188+
the number of bytes written on success and less than zero for failure.
190189
\return BAD_FUNC_ARG Returned if any of the input parameters are invalid
191190
\return RSA_BUFFER_E Returned if the output buffer is too small to store
192191
the ciphertext
@@ -1514,7 +1513,7 @@ int wc_RsaKeyToPublicDer_ex(RsaKey* key, byte* output, word32 inLen,
15141513
\param e exponent parameter to use for generating the key. A secure
15151514
choice is 65537
15161515
\param rng pointer to an RNG structure to use for random number generation
1517-
while making the ke
1516+
while making the key
15181517
15191518
_Example_
15201519
\code

wrapper/rust/include.am

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,7 @@ EXTRA_DIST += wrapper/rust/wolfssl/src/lib.rs
1818
EXTRA_DIST += wrapper/rust/wolfssl/src/wolfcrypt.rs
1919
EXTRA_DIST += wrapper/rust/wolfssl/src/wolfcrypt/aes.rs
2020
EXTRA_DIST += wrapper/rust/wolfssl/src/wolfcrypt/random.rs
21+
EXTRA_DIST += wrapper/rust/wolfssl/src/wolfcrypt/rsa.rs
2122
EXTRA_DIST += wrapper/rust/wolfssl/tests/test_aes.rs
2223
EXTRA_DIST += wrapper/rust/wolfssl/tests/test_random.rs
24+
EXTRA_DIST += wrapper/rust/wolfssl/tests/test_rsa.rs
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
pub mod aes;
22
pub mod random;
3+
pub mod rsa;

wrapper/rust/wolfssl/src/wolfcrypt/aes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
This crate provides a Rust wrapper for the wolfCrypt library's Advanced
2+
This module provides a Rust wrapper for the wolfCrypt library's Advanced
33
Encryption Standard (AES) functionality.
44
55
It leverages the `wolfssl-sys` crate for low-level FFI bindings, encapsulating

wrapper/rust/wolfssl/src/wolfcrypt/random.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
This crate provides a Rust wrapper for the wolfCrypt library's random number
2+
This module provides a Rust wrapper for the wolfCrypt library's random number
33
generator (RNG).
44
55
It leverages the `wolfssl-sys` crate for low-level FFI bindings, encapsulating
@@ -38,7 +38,7 @@ use std::mem::{size_of, MaybeUninit};
3838
/// ensures that the underlying wolfSSL RNG context is correctly freed when the
3939
/// `RNG` struct goes out of scope, preventing memory leaks.
4040
pub struct RNG {
41-
wc_rng: ws::WC_RNG,
41+
pub(crate) wc_rng: ws::WC_RNG,
4242
}
4343

4444
impl RNG {

0 commit comments

Comments
 (0)