package seal import ( "bytes" "testing" ) // TestZeroKey verifies that ZeroKey overwrites every byte of the slice // with zeros (P05 T6, REQ-147). func TestZeroKey(t *testing.T) { key := []byte{255, 255, 255, 255, 0, 1, 2, 3, 4, 5} ZeroKey(key) want := make([]byte, len(key)) if !bytes.Equal(key, want) { t.Errorf("ZeroKey did not zero: got %v, want %v", key, want) } } // TestZeroKey_NilAndEmpty verifies ZeroKey is safe on nil/empty slices. func TestZeroKey_NilAndEmpty(t *testing.T) { ZeroKey(nil) ZeroKey([]byte{}) }