The point of explcit_bzero is that it doesn't get optimized out by the compilers dead store optimization. In cryptographer applications dead store is counterproductive because it leaves key material in memory. OpenBSD implemented explict_bzero to stop this happening but just using the file from src/libc, will not do the job because they also implemented a compiler hook. Without the compiler hook this results in a stright call to memset, which dead store may optimize away. This patch implements it in a way that is portable.
The point of explcit_bzero is that it doesn't get optimized out by the compilers dead store optimization. In cryptographer applications dead store is counterproductive because it leaves key material in memory. OpenBSD implemented explict_bzero to stop this happening but just using the file from src/libc, will not do the job because they also implemented a compiler hook. Without the compiler hook this results in a stright call to memset, which dead store may optimize away. This patch implements it in a way that is portable.