envelope

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package envelope provides utility functions and structures allowing credential management.

Package envelope provides utility functions and structures allowing credential management.

Package envelope provides utility functions and structures allowing credential management.

Package envelope provides utility functions and structures allowing credential management.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildPRK

func BuildPRK(p *internal.Parameters, unblinded []byte) []byte

BuildPRK derives the randomized password from the OPRF output.

func IsValidMode

func IsValidMode(m Mode) bool

IsValidMode returns whether m is a valid envelope mode.

func RecoverEnvelope

func RecoverEnvelope(p *internal.Parameters, mode Mode, randomizedPwd, serverPublicKey, idc, ids []byte,
	envelope *Envelope) (clientSecretKey *group.Scalar, clientPublicKey *group.Point, exportKey []byte, err error)

RecoverEnvelope assumes that the envelope's inner envelope has been previously checked to be of correct size.

Types

type Core

type Core struct {
	Oprf *oprf.Client
}

Core holds the Client state between the key derivation steps, and exposes envelope creation and key recovery functions.

func New

func New(id oprf.Ciphersuite) *Core

New returns a pointer to an instantiated Core structure.

func (*Core) BuildEnvelope

func (c *Core) BuildEnvelope(p *internal.Parameters, mode Mode, evaluation, serverPublicKey, clientSecretKey []byte,
	creds *Credentials) (env *Envelope, clientPublicKey, maskingKey, exportKey []byte, err error)

BuildEnvelope returns the client's Envelope, the masking key for the registration, and the additional export key.

func (*Core) OprfFinalize

func (c *Core) OprfFinalize(data []byte) ([]byte, error)

OprfFinalize terminates the OPRF by unblinding the evaluated data.

func (*Core) OprfStart

func (c *Core) OprfStart(password []byte) []byte

OprfStart initiates the OPRF by blinding the password.

type Credentials

type Credentials struct {
	Idc, Ids                    []byte
	EnvelopeNonce, MaskingNonce []byte // testing: integrated to support testing
}

Credentials is currently used for testing purposes.

type Envelope

type Envelope struct {
	Nonce         []byte
	InnerEnvelope []byte
	AuthTag       []byte
}

Envelope represents the OPAQUE envelope.

func (*Envelope) Serialize

func (e *Envelope) Serialize() []byte

Serialize returns the byte serialization of the envelope.

type Mode

type Mode byte

Mode determines the envelope mode to operate in.

const (
	Internal Mode = iota + 1
	External
)

Internal and External define the Envelope modes.

Jump to

Keyboard shortcuts

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