verifier

package
v0.0.0-...-419a316 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2020 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package verifier implements an AuCPace Password Verifier Record as per the AuCPace draft

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PVRType

type PVRType string

PVRType indicates what kind of AuCPace password verifier record we are working with

const (
	// DefaultPrefix would be a possible prefix for unknown pvr. todo : clear that situation
	DefaultPrefix = "(strong)-AuCPace-Database"

	// LPVD : Legacy password verifier database
	LPVD PVRType = "LPVD"
	// APVD : AuCPace password verifier database
	APVD PVRType = "APVD"
	// SAPVD : (strong) AuCPace password verifier database
	SAPVD PVRType = "sAPVD"
)

type PasswordVerifierRecord

type PasswordVerifierRecord struct {
	PvrType  PVRType // will determine if q is salt or a salt derivation parameter
	Sigma    phf.PasswordHashingFunction
	Username []byte
	// contains filtered or unexported fields
}

PasswordVerifierRecord groups the data relative to a username in the database

func PvrInit

func PvrInit(pvrType PVRType, s phf.PasswordHashingFunction, username []byte) *PasswordVerifierRecord

PvrInit initialises a new PasswordVerifierRecord without the verifier W and salt q

func (*PasswordVerifierRecord) Buildq

func (pvr *PasswordVerifierRecord) Buildq() error

Buildq builds the parameter q with a random scalar

func (*PasswordVerifierRecord) Finish

func (pvr *PasswordVerifierRecord) Finish(w []byte)

Finish inserts the given verifier into the PasswordVerifierRecord, and therefore finishes its setup

func (*PasswordVerifierRecord) QFromNonExistentUser

func (pvr *PasswordVerifierRecord) QFromNonExistentUser(prefix, username, databaseSeed []byte) error

QFromNonExistentUser builds q following the draft for a failed database lookup TODO : how should the case be handled in which the database entry does not exist ? hash out q here or require it from database ?

func (*PasswordVerifierRecord) SaltDerivationQ

func (pvr *PasswordVerifierRecord) SaltDerivationQ() []byte

SaltDerivationQ returns the parameter q

func (*PasswordVerifierRecord) Verifier

func (pvr *PasswordVerifierRecord) Verifier() []byte

Verifier returns the verifier W

Jump to

Keyboard shortcuts

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