Versions in this module Expand all Collapse all v1 v1.2.2 Jan 4, 2022 Changes in this version + const SubAddrPrefix + const SubAddressLen + var ErrInvalidAddr = fmt.Errorf("invalid sub address") + func GenerateAesKey(peerAddr SubAddr, key ed25519.PrivateKey) ([]byte, error) + func PrivateKeyToCurve25519(curve25519Private *[32]byte, privateKey *[64]byte) + func PublicKeyToCurve25519(curve25519Public *[32]byte, publicKey *[32]byte) bool + func SubAddrToPub(a SubAddr) (ed25519.PublicKey, error) + func VerifyBySub(msg, sig []byte, addr SubAddr) bool + type SubAddr [SubAddressLen]byte + func HexToSubAddr(s string) (addr SubAddr, err error) + func PubKeyToSubAddr(p ed25519.PublicKey) (addr SubAddr) + func (a *SubAddr) Hex() string + func (a *SubAddr) MarshalText() ([]byte, error) + func (a *SubAddr) String() string + func (a *SubAddr) UnmarshalJSON(data []byte) error + type SubKey struct + Address SubAddr + ID uuid.UUID + Light bool + func DecryptSubKey(keyJson []byte, auth string) (*SubKey, error) + func LoadSubKeyFromJsonStr(str, auth string) (*SubKey, error) + func NewLightSubKey(light bool) (*SubKey, error) + func NewSubKey() (*SubKey, error) + func (k *SubKey) Addr() string + func (k *SubKey) Encrypt(auth string) ([]byte, error) + func (k *SubKey) GetPrivate() []byte + func (k *SubKey) IDStr() string + func (k *SubKey) IsOpen() bool + func (k *SubKey) PriLen() int + func (k *SubKey) SharedKey(peer string) ([]byte, error) + func (k *SubKey) SignData(v []byte) []byte + func (k *SubKey) StoreString(auth string) string