message

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package message provides message structures for the OPAQUE protocol.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CredentialRequest added in v0.8.2

type CredentialRequest struct {
	BlindedMessage *group.Element `json:"blindedMessage"`
}

CredentialRequest represents credential request message.

func NewCredentialRequest added in v0.9.0

func NewCredentialRequest(ciphersuite oprf.Identifier, message *group.Element) *CredentialRequest

NewCredentialRequest returns a populated CredentialRequest.

func (*CredentialRequest) Serialize added in v0.8.2

func (c *CredentialRequest) Serialize() []byte

Serialize returns the byte encoding of CredentialRequest.

type CredentialResponse added in v0.8.2

type CredentialResponse struct {
	EvaluatedMessage *group.Element `json:"evaluatedMessage"`
	MaskingNonce     []byte         `json:"maskingNonce"`
	MaskedResponse   []byte         `json:"maskedResponse"`
}

CredentialResponse represents credential response message.

func NewCredentialResponse added in v0.9.0

func NewCredentialResponse(
	message *group.Element,
	nonce, response []byte,
) *CredentialResponse

NewCredentialResponse returns a populated CredentialResponse.

func (*CredentialResponse) Serialize added in v0.8.2

func (c *CredentialResponse) Serialize() []byte

Serialize returns the byte encoding of CredentialResponse.

type KE1

type KE1 struct {
	*CredentialRequest
	EpkU   *group.Element `json:"clientEphemeralPublicKey"`
	NonceU []byte         `json:"clientNonce"`
}

KE1 is the first message of the login flow, created by the client and sent to the server.

func (*KE1) Serialize

func (m *KE1) Serialize() []byte

Serialize returns the byte encoding of KE1.

type KE2

type KE2 struct {
	*CredentialResponse
	EpkS   *group.Element `json:"serverEphemeralPublicKey"`
	NonceS []byte         `json:"serverNonce"`
	Mac    []byte         `json:"serverMac"`
}

KE2 is the second message of the login flow, created by the server and sent to the client.

func (*KE2) Serialize

func (m *KE2) Serialize() []byte

Serialize returns the byte encoding of KE2.

type KE3

type KE3 struct {
	Mac []byte `json:"clientMac"`
}

KE3 is the third and last message of the login flow, created by the client and sent to the server.

func (KE3) Serialize

func (k KE3) Serialize() []byte

Serialize returns the byte encoding of KE3.

type RegistrationRecord

type RegistrationRecord struct {
	PublicKey  *group.Element `json:"clientPublicKey"`
	MaskingKey []byte         `json:"maskingKey"`
	Envelope   []byte         `json:"envelope"`
}

RegistrationRecord represents the client record sent as the last registration message by the client to the server.

func (*RegistrationRecord) Serialize

func (r *RegistrationRecord) Serialize() []byte

Serialize returns the byte encoding of RegistrationRecord.

type RegistrationRequest

type RegistrationRequest struct {
	BlindedMessage *group.Element `json:"blindedMessage"`
}

RegistrationRequest is the first message of the registration flow, created by the client and sent to the server.

func (*RegistrationRequest) Serialize

func (r *RegistrationRequest) Serialize() []byte

Serialize returns the byte encoding of RegistrationRequest.

type RegistrationResponse

type RegistrationResponse struct {
	EvaluatedMessage *group.Element `json:"evaluatedMessage"`
	Pks              *group.Element `json:"serverPublicKey"`
}

RegistrationResponse is the second message of the registration flow, created by the server and sent to the client.

func (*RegistrationResponse) Serialize

func (r *RegistrationResponse) Serialize() []byte

Serialize returns the byte encoding of RegistrationResponse.

Jump to

Keyboard shortcuts

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