crypto

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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

Jump to

Keyboard shortcuts

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