From ac441a662b315235fa3fc27ab151282f01063b62 Mon Sep 17 00:00:00 2001 From: "irvingouj @ Devolutions" Date: Wed, 4 Dec 2024 07:42:40 -0500 Subject: [PATCH] fix:remove unused memcpy function (#406) Co-authored-by: Eugene --- cryptovec/src/platform/wasm.rs | 10 ---------- cryptovec/src/platform/windows.rs | 6 ------ russh-keys/src/lib.rs | 3 +-- 3 files changed, 1 insertion(+), 18 deletions(-) diff --git a/cryptovec/src/platform/wasm.rs b/cryptovec/src/platform/wasm.rs index 77f1cc8e..ce4c096d 100644 --- a/cryptovec/src/platform/wasm.rs +++ b/cryptovec/src/platform/wasm.rs @@ -13,13 +13,3 @@ pub fn memset(ptr: *mut u8, value: i32, size: usize) { std::ptr::write_bytes(ptr, byte_value, size); } } - -pub fn memcpy(dest: *mut u32, src: *const u8, size: usize) { - unsafe { - // Convert dest to *mut u8 for byte-wise copying - let dest_bytes = dest as *mut u8; - - // Use std::ptr::copy_nonoverlapping to copy the data - std::ptr::copy_nonoverlapping(src, dest_bytes, size); - } -} diff --git a/cryptovec/src/platform/windows.rs b/cryptovec/src/platform/windows.rs index 72e0b8f2..ba880dda 100644 --- a/cryptovec/src/platform/windows.rs +++ b/cryptovec/src/platform/windows.rs @@ -21,9 +21,3 @@ pub fn memset(ptr: *mut u8, value: i32, size: usize) { libc::memset(ptr as *mut c_void, value, size); } } - -pub fn memcpy(dest: *mut u32, src: *const u8, size: usize) { - unsafe { - libc::memcpy(dest as *mut c_void, src as *const c_void, size); - } -} diff --git a/russh-keys/src/lib.rs b/russh-keys/src/lib.rs index df038a2d..b48b4596 100644 --- a/russh-keys/src/lib.rs +++ b/russh-keys/src/lib.rs @@ -80,11 +80,10 @@ mod format; #[doc(hidden)] pub mod helpers; pub use format::*; -pub use ssh_key::{self, Algorithm, Certificate, EcdsaCurve, HashAlg, PrivateKey, PublicKey}; - // Reexports pub use signature; pub use ssh_encoding; +pub use ssh_key::{self, Algorithm, Certificate, EcdsaCurve, HashAlg, PrivateKey, PublicKey}; /// OpenSSH agent protocol implementation pub mod agent;