Wrap a 32-byte key, attempting to mlock it. If mlock fails, logs a warning and continues — startup is not aborted.
(bytes: [u8; 32])
| 26 | /// |
| 27 | /// If mlock fails, logs a warning and continues — startup is not aborted. |
| 28 | pub fn new(bytes: [u8; 32]) -> Self { |
| 29 | let mut boxed = Box::new(bytes); |
| 30 | #[cfg(all(unix, not(target_arch = "wasm32")))] |
| 31 | mlock_best_effort(boxed.as_mut_ptr() as *mut libc::c_void, 32); |
| 32 | Self { bytes: boxed } |
| 33 | } |
| 34 | |
| 35 | /// Access the key bytes. |
| 36 | pub fn as_bytes(&self) -> &[u8; 32] { |
nothing calls this directly
no test coverage detected