Documentation
¶
Index ¶
- Constants
- func GetHash(name string) (crypto.Hash, error)
- func ListCurves() []string
- func ListHashes() []string
- func MustRegisterCurve(name string, curve ecdh.Curve)
- func MustRegisterHash(name string, hash crypto.Hash)
- func RegisterCurve(name string, curve ecdh.Curve) error
- func RegisterHash(name string, hash crypto.Hash) error
- type Curve
Constants ¶
const ( CURVE_X25519 = "X25519" CURVE_25519 = "25519" // alias used in noise protocol names CURVE_P256 = "P256" CURVE_P384 = "P384" CURVE_P521 = "P521" )
const ( HASH_SHA256 = "SHA256" HASH_SHA512 = "SHA512" HASH_SHA512_256 = "SHA512/256" HASH_SHA3_256 = "SHA3/256" HASH_SHA3_512 = "SHA3/512" HASH_BLAKE2B = "BLAKE2b" HASH_BLAKE2S = "BLAKE2s" )
const (
// All package errors are wrapping Error
Error = errorFlag("algos: error")
)
Variables ¶
This section is empty.
Functions ¶
func GetHash ¶
GetHash loads Hash implementation from the registry. It errors if no hash was registered with name.
func ListCurves ¶
func ListCurves() []string
ListCurves returns a slice containing the names of the registered elliptic curves.
func ListHashes ¶
func ListHashes() []string
ListHashes returns a slice containing the names of the registered Hash algorithms.
func MustRegisterCurve ¶
MustRegisterCurve adds curve to the Curve registry. It panics if name is already in use or curve is invalid.
func MustRegisterHash ¶
MustRegisterHash adds hash to the Hash registry. It panics if name is already in use or hash is invalid.
func RegisterCurve ¶
RegisterCurve adds curve to the Curve registry. It errors if name is already in use or curve is invalid.
Types ¶
type Curve ¶
Curve embeds ecdh.Curve and adds methods that simplify usage.
func GetCurve ¶
GetCurve loads Curve implementation from the registry. It errors if no curve was registered with name.
func (Curve) PrivateKeyLen ¶
PrivateKeyLen returns byte length of Curve PrivateKey
func (Curve) PublicKeyLen ¶
PublicKeyLen returns byte length of uncompressed form of Curve PublicKey