Avoid compiler optimizations breaking ZeroizeBytes

This commit is contained in:
2026-02-10 22:16:48 -05:00
parent 29315c4b76
commit 26686374bd
+2
View File
@@ -2,6 +2,8 @@ package security
// ZeroizeBytes overwrites all // ZeroizeBytes overwrites all
// bytes in a slice with zeros. // bytes in a slice with zeros.
//
//go:noinline
func ZeroizeBytes(input []byte) { func ZeroizeBytes(input []byte) {
for i := range input { for i := range input {
input[i] = 0 input[i] = 0