diff --git a/common/bitutil/bitutil.go b/common/bitutil/bitutil.go index 59b9562329..c68733cb0b 100644 --- a/common/bitutil/bitutil.go +++ b/common/bitutil/bitutil.go @@ -18,6 +18,12 @@ const supportsUnaligned = runtime.GOARCH == "386" || runtime.GOARCH == "amd64" | // XORBytes xors the bytes in a and b. The destination is assumed to have enough // space. Returns the number of bytes xor'd. +// +// If dst does not have length at least n, +// XORBytes panics without writing anything to dst. +// +// dst and x or y may overlap exactly or not at all, +// otherwise XORBytes may panic. func XORBytes(dst, a, b []byte) int { return subtle.XORBytes(dst, a, b) }