subtle
packagestandard libraryThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Index¶
- func ConstantTimeByteEq(x, y uint8) int
- func ConstantTimeCompare(x, y []byte) int
- func ConstantTimeCopy(v int, x, y []byte)
- func ConstantTimeEq(x, y int32) int
- func ConstantTimeLessOrEq(x, y int) int
- func ConstantTimeLessOrEqBytes(x, y []byte) int
- func ConstantTimeSelect(v, x, y int) int
- func XORBytes(dst, x, y []byte) int
Constants¶
This section is empty.
Variables¶
This section is empty.
Functions¶
funcConstantTimeByteEq¶
ConstantTimeByteEq returns 1 if x == y and 0 otherwise.
funcConstantTimeCompare¶
ConstantTimeCompare returns 1 if the two slices, x and y, have equal contentsand 0 otherwise. The time taken is a function of the length of the slices andis independent of the contents. If the lengths of x and y do not match itreturns 0 immediately.
funcConstantTimeCopy¶
ConstantTimeCopy copies the contents of y into x (a slice of equal length)if v == 1. If v == 0, x is left unchanged. Its behavior is undefined if vtakes any other value.
funcConstantTimeEq¶
ConstantTimeEq returns 1 if x == y and 0 otherwise.
funcConstantTimeLessOrEq¶
ConstantTimeLessOrEq returns 1 if x <= y and 0 otherwise.Its behavior is undefined if x or y are negative or > 2**31 - 1.
funcConstantTimeLessOrEqBytes¶added ingo1.25.0
ConstantTimeLessOrEqBytes returns 1 if x <= y and 0 otherwise. The comparisonis lexigraphical, or big-endian. The time taken is a function of the length ofthe slices and is independent of the contents. If the lengths of x and y do notmatch it returns 0 immediately.
funcConstantTimeSelect¶
ConstantTimeSelect returns x if v == 1 and y if v == 0.Its behavior is undefined if v takes any other value.
Types¶
This section is empty.