utils icon indicating copy to clipboard operation
utils copied to clipboard

zeroize: `libc` feature?

Open tarcieri opened this issue 3 weeks ago • 1 comments

It looks like on several operating systems, the libc crate has wrappers for secure memset/bzero primitives:

https://github.com/rust-lang/libc/pull/2156

We could potentially have an optional dependency on libc which calls into these primitives from e.g. volatile_set, while defaulting to a portable implementation. Many programs are already linking with libc anyway.

We would somewhat annoyingly have to build an abstraction across them.

tarcieri avatar Dec 15 '25 21:12 tarcieri

IMO unless there is a practical demonstration of the asm! approach not working, I don't think we should bother with it.

newpavlov avatar Dec 15 '25 22:12 newpavlov