crypto

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2025 License: GPL-2.0 Imports: 13 Imported by: 0

Documentation

Overview

pkg/crypto/aead.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodePoint added in v0.1.4

func EncodePoint(p *edwards25519.Point) string

EncodePoint returns the hex string of the compressed point

func EncodeScalar added in v0.1.4

func EncodeScalar(s *edwards25519.Scalar) string

EncodeScalar returns the hex string of the scalar

func RecoverPublicKey added in v0.1.4

func RecoverPublicKey(keyHex string) (*edwards25519.Point, error)

RecoverPublicKey takes a split private key (r, k) or a master private key (x) and returns the public key P. Input can be: - 32 bytes hex (Master Scalar x) - 64 bytes hex (Split Key r || k)

func SplitPrivateKey added in v0.1.4

func SplitPrivateKey(x *edwards25519.Scalar) (string, error)

SplitPrivateKey takes a master private key x and returns a new random split key (r, k) such that x = r + k (mod L). Returns hex encoded string of r || k (64 bytes)

Types

type AEADConn

type AEADConn struct {
	net.Conn
	// contains filtered or unexported fields
}

func NewAEADConn

func NewAEADConn(c net.Conn, key string, method string) (*AEADConn, error)

func (*AEADConn) Read

func (cc *AEADConn) Read(p []byte) (int, error)

func (*AEADConn) Write

func (cc *AEADConn) Write(p []byte) (int, error)

type KeyPair added in v0.1.4

type KeyPair struct {
	Private *edwards25519.Scalar
	Public  *edwards25519.Point
}

KeyPair holds the scalar private key and point public key

func GenerateMasterKey added in v0.1.4

func GenerateMasterKey() (*KeyPair, error)

GenerateMasterKey generates a random master private key (scalar) and its public key (point)

Jump to

Keyboard shortcuts

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