cryptohelper

package
v0.0.0-...-67e897e Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateEncryptedMessage

func CreateEncryptedMessage(senderHpke EphemeralKeyPair, senderEd25519 StaticSigningKeyPair, recipientHpke []byte, msg []byte) ([]byte, error)

func Decrypt

func Decrypt(content protos.Content, privateHpkeKey []byte) ([]byte, error)

func GenerateHpkeEphemeralKeyPairsWorker

func GenerateHpkeEphemeralKeyPairsWorker(hpkes chan<- EphemeralKeyPair)

func VerifyAndDecrypt

func VerifyAndDecrypt(transportData []byte, privateHpke []byte) (hpke []byte, plain []byte)

Types

type EncryptionKeyPair

type EncryptionKeyPair struct {
	PublicKeys  PublicKeys
	PrivateKeys PrivateKeys
}

func GenerateKeyPair

func GenerateKeyPair() (EncryptionKeyPair, error)

type EphemeralKeyPair

type EphemeralKeyPair struct {
	EncryptionKeyPair EncryptionKeyPair
}

type Node

type Node struct {
	StaticSigningKeyPair  StaticSigningKeyPair
	StaticHpkeKeyPair     EncryptionKeyPair
	EphemeralHpkeKeyPairs chan EphemeralKeyPair
}

func (*Node) GenerateStaticKeyPairs

func (s *Node) GenerateStaticKeyPairs()

type PrivateKeys

type PrivateKeys struct {
	// kem.PrivateKey
	Hpke []byte
}

type PublicKeys

type PublicKeys struct {
	// kem.PublicKey
	Hpke []byte
}

type StaticSigningKeyPair

type StaticSigningKeyPair struct {
	PublicKey  ed25519.PublicKey
	PrivateKey ed25519.PrivateKey
}

func GeneratedStaticKey

func GeneratedStaticKey() (StaticSigningKeyPair, error)

Jump to

Keyboard shortcuts

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