message

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2024 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

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

TODO: CredentialRequest CredentialRequest represents credential request message.

func NewCredentialRequest

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

NewCredentialRequest returns a populated CredentialRequest.

func (*CredentialRequest) Serialize

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

Serialize returns the byte encoding of CredentialRequest.

type CredentialResponse

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

TODO: CredentialResponse CredentialResponse represents credential response message.

func NewCredentialResponse

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

NewCredentialResponse returns a populated CredentialResponse.

func (*CredentialResponse) Serialize

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"`
	UserName []byte         `json:"clientUserName"`
}

TODO: KE1 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"`
}

TODO: KE2 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"`
}

TODO: KE3 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"`
}

TODO: RegistrationRecord 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"`
	UserName       []byte         `json:"username"`
}

TODO: RegistrationRequest is the first message of the registration flow 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"`
}

TODO: RegistrationResponse 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