From da98e126979aac12897acf6f63083fd9c18aa067 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Mon, 8 Dec 2025 15:23:06 +0100 Subject: [PATCH] common/bitutil: add comment from crypto/subtle --- common/bitutil/bitutil.go | 6 ++++++ 1 file changed, 6 insertions(+) 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) }