hpkehelper

package
Version: v0.0.0-...-94b69c0 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSenderPublicKey

func GetSenderPublicKey(data []byte) (shared.HpkePublicKey, error)

Types

type HpkeStandard

type HpkeStandard struct {
	PrivateKey     kem.PrivateKey
	PublicKey      kem.PublicKey
	PrivateKeyData []byte
	PublicKeyData  []byte
}

func NewHpkeStandard

func NewHpkeStandard(privateKey shared.HpkePrivateKey) (*HpkeStandard, error)

func (HpkeStandard) Decrypt

func (c HpkeStandard) Decrypt(msg []byte) (plain []byte, err error)

func (HpkeStandard) Encrypt

func (c HpkeStandard) Encrypt(pub shared.HpkePublicKey, msg []byte) (ct []byte, err error)

func (HpkeStandard) GenerateKeyPair

func (c HpkeStandard) GenerateKeyPair() (KeyPair, error)

type KeyPair

type KeyPair struct {
	PublicKeys  PublicKeys
	PrivateKeys PrivateKeys
}

type PostQuantum

type PostQuantum struct{}

PostQuantum is for later milestone, where we use cSIDH und PSK.

type PrivateKeys

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

type PublicKeys

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

type WireData

type WireData struct {
	// Version is the version of the wire format. TODO Version should be part of AssociatedData or Info.
	Version string
	// Info is a application-supplied information
	Info string
	// PskId is an identifier for the PSK
	PskId             string
	EncapsulatedKey   []byte
	CipherText        []byte
	AssociatedData    []byte
	SendersPublicKeys PublicKeys
}

Source Files

Jump to

Keyboard shortcuts

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