sas

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

sas provides the means to do SAS between keys

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SAS

type SAS struct {
	KeyPair crypto.Curve25519KeyPair
	Secret  []byte
}

SAS contains the key pair and secret for SAS.

func New

func New() (*SAS, error)

New creates a new SAS with a new key pair.

func (SAS) CalculateMAC added in v0.2.0

func (s SAS) CalculateMAC(input, info []byte) ([]byte, error)

CalculateMACFixes returns a base64 encoded, 32 byte long MAC of input.

func (SAS) CalculateMACLongKDF

func (s SAS) CalculateMACLongKDF(input, info []byte) ([]byte, error)

CalculateMACLongKDF returns a base64 encoded, 256 byte long MAC of input.

func (SAS) GenerateBytes

func (s SAS) GenerateBytes(info []byte, length uint) ([]byte, error)

GenerateBytes creates length bytes from the shared secret and info.

func (SAS) GetPubkey added in v0.2.0

func (s SAS) GetPubkey() []byte

GetPubkey returns the public key of the key pair base64 encoded

func (*SAS) SetTheirKey

func (s *SAS) SetTheirKey(key []byte) error

SetTheirKey sets the key of the other party and computes the shared secret.

Jump to

Keyboard shortcuts

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