keys

package
v1.18.1 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildSharedCipher

func BuildSharedCipher(key []byte, checksum []byte) (cipher.Stream, error)

func Ed25519PrivateToX25519

func Ed25519PrivateToX25519(edPrivate ed25519.PrivateKey) []byte

func Ed25519PubToX25519

func Ed25519PubToX25519(edPub ed25519.PublicKey) ([]byte, error)

func NewCipherCtr

func NewCipherCtr(key, iv []byte) (cipher.Stream, error)

func SharedKey

func SharedKey(ourKey ed25519.PrivateKey, serverKey ed25519.PublicKey) ([]byte, error)

SharedKey - Generate encryption key based on our and server key, ECDH algorithm

func SharedKeyWithPeerX25519

func SharedKeyWithPeerX25519(ourKey ed25519.PrivateKey, serverKeyX25519 []byte) ([]byte, error)

Types

type PrivateKeyAES

type PrivateKeyAES struct {
	Key []byte `tl:"int256"`
}

type PublicKeyAES

type PublicKeyAES struct {
	Key []byte // `tl:"int256"`
}

func (*PublicKeyAES) Parse

func (p *PublicKeyAES) Parse(data []byte) ([]byte, error)

func (*PublicKeyAES) Serialize

func (p *PublicKeyAES) Serialize(buf *bytes.Buffer) error

type PublicKeyED25519

type PublicKeyED25519 struct {
	Key ed25519.PublicKey // `tl:"int256"`
}

func (*PublicKeyED25519) Parse

func (p *PublicKeyED25519) Parse(data []byte) ([]byte, error)

func (*PublicKeyED25519) Serialize

func (p *PublicKeyED25519) Serialize(buf *bytes.Buffer) error

type PublicKeyOverlay

type PublicKeyOverlay struct {
	Key []byte `tl:"bytes"`
}

type PublicKeyUnEnc

type PublicKeyUnEnc struct {
	Key []byte `tl:"bytes"`
}

Jump to

Keyboard shortcuts

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