From 10fbc952416ccd15251c6e6a3d3f9eb8416ebe98 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Fri, 27 Mar 2026 15:27:46 -0400 Subject: [PATCH] Rust wrapper: add comment to MlKem about not implementing Send/Sync Fixes F-1072. --- wrapper/rust/wolfssl-wolfcrypt/src/mlkem.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wrapper/rust/wolfssl-wolfcrypt/src/mlkem.rs b/wrapper/rust/wolfssl-wolfcrypt/src/mlkem.rs index a7d903be33..0e2080c3b7 100644 --- a/wrapper/rust/wolfssl-wolfcrypt/src/mlkem.rs +++ b/wrapper/rust/wolfssl-wolfcrypt/src/mlkem.rs @@ -73,6 +73,10 @@ use zeroize::Zeroize; /// /// An instance is created with [`MlKem::generate()`], /// [`MlKem::generate_with_random()`], or [`MlKem::new()`]. +/// +/// This struct does not implement Send or Sync because it is not safe in the +/// general case to access the underlying C API from multiple threads +/// concurrently. pub struct MlKem { ws_key: *mut sys::MlKemKey, }