subtle

package
v0.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 15, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BEUint64

func BEUint64(b []byte) uint64

BEUint64 interprets b as an 8-byte big-endian value and returns it as a uint64. It requires len(b) >= 8.

func ConstantTimeCompare

func ConstantTimeCompare(x, y []byte) int

ConstantTimeCompare returns 1 if x and y are equal and 0 otherwise.

func ConstantTimeLessOrEqBytes

func ConstantTimeLessOrEqBytes(x, y []byte) int

ConstantTimeLessOrEqBytes returns 1 if x <= y and 0 otherwise. The comparison is lexicographical, or big-endian. The time taken is a function of the length of the slices and is independent of the contents. If the lengths of x and y do not match it returns 0 immediately.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL