We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c18f398 commit 07b0c57Copy full SHA for 07b0c57
src/crypto/subtle/constant_time.go
@@ -8,7 +8,8 @@ package subtle
8
9
// ConstantTimeCompare returns 1 if the two slices, x and y, have equal contents
10
// and 0 otherwise. The time taken is a function of the length of the slices and
11
-// is independent of the contents.
+// is independent of the contents. If the lengths of x and y do not match it
12
+// returns 0 immediately.
13
func ConstantTimeCompare(x, y []byte) int {
14
if len(x) != len(y) {
15
return 0
0 commit comments