💾 Archived View for code.pfad.fr › gohmekit › pairing › crypto captured on 2023-04-26 at 13:16:03. Gemini links have been rewritten to link to archived content

View Raw

More Information

➡️ Next capture (2024-07-09)

-=-=-=-=-=-=-

crypto package

import "code.pfad.fr/gohmekit/pairing/crypto"

Functions

func PairVerifyAEAD

func PairVerifyAEAD(sharedSecret []byte) (cipher.AEAD, error)

Types

type KeyOnCurve25519

type KeyOnCurve25519 struct {
	// contains filtered or unexported fields
}

func NewKeyOnCurve25519

func NewKeyOnCurve25519() (KeyOnCurve25519, error)

func (KeyOnCurve25519) PairVerifySharedSecret

func (k KeyOnCurve25519) PairVerifySharedSecret(otherPublicKey []byte) ([]byte, error)

func (KeyOnCurve25519) PublicKey

func (k KeyOnCurve25519) PublicKey() []byte

type SRPSession

type SRPSession struct {
	// contains filtered or unexported fields
}

func NewSRPSession

func NewSRPSession(pin []byte) (*SRPSession, []byte, error)

func (SRPSession) ExchangeProof

func (s SRPSession) ExchangeProof(clientProof []byte) ([]byte, bool)

func (SRPSession) PairSetupSharedSecret

func (s SRPSession) PairSetupSharedSecret(otherPublicKey []byte) ([]byte, error)

func (SRPSession) PublicKey

func (s SRPSession) PublicKey() []byte

type SRPSharedSecret

type SRPSharedSecret []byte

func (SRPSharedSecret) AEAD

func (s SRPSharedSecret) AEAD() (cipher.AEAD, error)

func (SRPSharedSecret) AccessorySign

func (s SRPSharedSecret) AccessorySign() ([]byte, error)

func (SRPSharedSecret) ControllerSign

func (s SRPSharedSecret) ControllerSign() ([]byte, error)

type Session

type Session struct {
	// contains filtered or unexported fields
}

func NewSession

func NewSession(sharedKey [32]byte, isAccessory bool) (*Session, error)

func (*Session) Open

func (s *Session) Open(p []byte) ([]byte, error)

Open will decrypt and authenticate an incoming message. If not enough bytes are present, it will return (nil,nil), but keep the provided bytes in memory, to use them on the next call.

func (*Session) Seal

func (s *Session) Seal(plaintext []byte) []byte

Files

curve25519.go

hkdf.go

session.go

setup.go

srp.go

verify.go

Forge

https://codeberg.org/pfad.fr/gohmekit

git clone

https://codeberg.org/pfad.fr/gohmekit
git@codeberg.org:pfad.fr/gohmekit