I was encounter the following function crypto/subtle package which caused me a lot curiosity, wish someone can explain the purpose behind it. Thanks,
// ConstantTimeByteEq returns 1 if x == y and 0 otherwise.
27 func ConstantTimeByteEq(x, y uint8) int {
28 z := ^(x ^ y)
29 z &= z >> 4
30 z &= z >> 2
31 z &= z >> 1
32
33 return int(z)
34 }