spake2plus

package
v0.0.0-...-b67530a Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2026 License: Apache-2.0, BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Overview

Package spake2plus implements RFC 9383 for testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(
	pw []byte,
	idProver []byte,
	idVerifier []byte,
) (pwVerifierW0 []byte, pwVerifierW1 []byte, registrationRecord []byte, err error)

Types

type Context

type Context struct {
	IDProver   []byte
	IDVerifier []byte
	Role       Role

	Lx, Ly *big.Int // L point
	Mx, My *big.Int // M point
	Nx, Ny *big.Int // N point
	Xx, Xy *big.Int // X point
	Yx, Yy *big.Int // Y point
	Zx, Zy *big.Int // Z point
	Vx, Vy *big.Int // V point
	// contains filtered or unexported fields
}

func NewProver

func NewProver(
	context []byte, idProver []byte, idVerifier []byte,
	pwVerifierW0 []byte, pwVerifierW1 []byte,
) (*Context, error)

func NewVerifier

func NewVerifier(
	context []byte, idProver []byte, idVerifier []byte,
	pwVerifierW0 []byte, registrationRecord []byte,
) (*Context, error)

func (*Context) ComputeProverConfirmation

func (ctx *Context) ComputeProverConfirmation(
	verifierShare []byte,
	claimedVerifierConfirm []byte,
) (proverConfirm []byte, sharedSecret []byte, err error)

computeProverConfirmation (Prover side)

func (*Context) GenerateProverShare

func (ctx *Context) GenerateProverShare() (share []byte, err error)

func (*Context) ProcessProverShare

func (ctx *Context) ProcessProverShare(
	proverShare []byte,
) (verifierShare []byte, verifierConfirm []byte, sharedSecret []byte, err error)

func (*Context) VerifyProverConfirmation

func (ctx *Context) VerifyProverConfirmation(proverConfirm []byte) error

VerifyProverConfirmation (Verifier side)

type Role

type Role int
const (
	RoleProver Role = iota
	RoleVerifier
)

Jump to

Keyboard shortcuts

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