DaGenix / rust-crypto

A (mostly) pure-Rust implementation of various cryptographic algorithms.
Apache License 2.0
1.39k stars 295 forks source link

make secure_memset function unsafe #482

Open kitcatier opened 1 year ago

kitcatier commented 1 year ago

https://github.com/DaGenix/rust-crypto/blob/cc1a5fde1ce957bd1a8a2e30169443cdb4780111/src/util.rs#L32-L39 Hello, if a function's entire body is unsafe, the function is itself unsafe and should be marked appropriately, which will make the caller ignore the safety requirements that the function parameters must guarantee, the developer who calls the secure_memset function may not notice this safety requirement.

Marking them unsafe also means that callers must make sure they know what they're doing.