Documentation ¶
Index ¶
- Constants
- func Btoi(i []byte) (r int)
- func Equal(x, y []byte) bool
- func GenerateSigningKeyPair() (sk, vk []byte, err error)
- func Hash(data ...[]byte) []byte
- func Itob(i int) (r []byte)
- func Pow(a, b int) int
- func Sign(sk, message []byte) (signature []byte, err error)
- func ToByteArray32(s []byte) (*[32]byte, error)
- func ToByteArray64(s []byte) (*[64]byte, error)
- func Verify(vk, message []byte, signature []byte) bool
Constants ¶
const HashOutputLen = 32
HashOutputLen is the number of bytes of output from SHA-512 to use.
const SigningKeyLen = 64
SigningKeyLen is the length in bytes of the signing key.
const VerificationKeyLen = 32
VerificationKeyLen is the length in bytes of the verification key.
Variables ¶
This section is empty.
Functions ¶
func Btoi ¶
Btoi converts a byte slice into an integer. WARNING, only use on known valid input (produced by Itob).
func GenerateSigningKeyPair ¶
GenerateSigningKeyPair attempts to generate a signature key-pair.
func Hash ¶
Hash hashes the provided data with SHA-512 (first HashOutputLen-byte output size). We use SHA-512 with the first 256 bits as output instead of SHA512/256 due to better compatability with NaCl.
func ToByteArray32 ¶
ToByteArray32 attempts to convert a slice into a 32-byte arrray.
func ToByteArray64 ¶
ToByteArray64 attempts to convert a slice into a 64-byte arrray.
Types ¶
This section is empty.