pakekey

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: MIT Imports: 7 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package pakekey binds croc's peer PAKE exchanges to their participants, session, purpose, and exact wire transcript.

Index

Constants

View Source
const (
	// ProtocolVersion is the fail-closed croc peer PAKE protocol version.
	ProtocolVersion = 2
	// SaltSize is the required peer key-schedule salt size.
	SaltSize = 32

	PurposeTransfer   = "peer-transfer"
	PurposeLocalProbe = "local-ip-probe"
	PurposeSSH        = "peer-ssh"
)

Variables

This section is empty.

Functions

func Confirm

func Confirm(expected, received []byte) bool

Confirm verifies a role-specific confirmation tag in constant time.

func Identities

func Identities(purpose, room string) (idA, idB []byte, err error)

Identities returns the ordered, implicit participant identities for a croc PAKE exchange. Party A is always the receiver and party B is the sender.

func Init

func Init(password []byte, role int, curve, purpose, room string) (*pake.Pake, error)

Init initializes the identity-bound PAKE instance for the supplied croc session context.

Types

type Context

type Context struct {
	Purpose   string
	Room      string
	Curve     string
	Initiator []byte
	Responder []byte
	Salt      []byte
}

Context contains the public session values authenticated by the channel key schedule. Initiator is party A's initial PAKE value and Responder is party B's response.

type Keys

type Keys struct {
	EncryptionKey []byte
	ConfirmationA []byte
	ConfirmationB []byte
}

Keys contains the traffic key and the role-specific confirmation tags.

func Derive

func Derive(sharedKey []byte, context Context) (Keys, error)

Derive expands a PAKE session key into a traffic key and mutual key- confirmation tags bound to the exact croc transcript.

Jump to

Keyboard shortcuts

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