spake2

package module
v0.0.0-...-52ff330 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2020 License: MIT Imports: 9 Imported by: 0

README

spake2

RFC

Dependencies:

  1. Cloudflare's CIRCL - For P384 (amd64) and Ed448

  2. Scrypt and Argon2id are given as MHF options. (see spake2.go)

!!NOT FOR PROD!!

This is for benchmarking purposes only.

It doesn't have the Per-user M & N from the RFC.

goarch: amd64
pkg: github.com/jtejido/spake2
BenchmarkSPAKE2Ed25519Scrypt-4              1411            724337 ns/op
BenchmarkSPAKE2Ed448Scrypt-4                 573           1842925 ns/op
BenchmarkSPAKE2P256Sha256Scrypt-4           1332            887259 ns/op
BenchmarkSPAKE2P384Sha256Scrypt-4            282           4471907 ns/op
BenchmarkSPAKE2P256Sha512Scrypt-4           1275            962927 ns/op
BenchmarkSPAKE2P384Sha512Scrypt-4            276           4286376 ns/op
PASS

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Argon2

func Argon2(time, memory uint32, threads uint8) suite.MHF

func Ed25519Sha256HkdfHmac

func Ed25519Sha256HkdfHmac(mhf suite.MHF) suite.CipherSuite

func Ed448Sha512HkdfHmac

func Ed448Sha512HkdfHmac(mhf suite.MHF) suite.CipherSuite

func P256Sha256HkdfHmac

func P256Sha256HkdfHmac(mhf suite.MHF) suite.CipherSuite

func P256Sha512HkdfHmac

func P256Sha512HkdfHmac(mhf suite.MHF) suite.CipherSuite

func P384Sha256HkdfHmac

func P384Sha256HkdfHmac(mhf suite.MHF) suite.CipherSuite

func P384Sha512HkdfHmac

func P384Sha512HkdfHmac(mhf suite.MHF) suite.CipherSuite

func Scrypt

func Scrypt(N, r, p int) suite.MHF

MHFs

Types

type A

type A struct {
	// contains filtered or unexported fields
}

func (A) Finish

func (a A) Finish(S []byte) (*SharedSecret, error)

type B

type B struct {
	// contains filtered or unexported fields
}

func (B) Finish

func (b B) Finish(T []byte) (*SharedSecret, error)

type Confirmations

type Confirmations struct {
	// contains filtered or unexported fields
}

func NewConfirmations

func NewConfirmations(confirmation, remoteConfirmation []byte, suite suite.CipherSuite) *Confirmations

func (Confirmations) Bytes

func (c Confirmations) Bytes() []byte

func (Confirmations) Verify

func (c Confirmations) Verify(incomingConfirmation []byte) error

type SharedSecret

type SharedSecret struct {
	// contains filtered or unexported fields
}

func (SharedSecret) Bytes

func (s SharedSecret) Bytes() []byte

func (*SharedSecret) Confirmation

func (s *SharedSecret) Confirmation() []byte

func (*SharedSecret) Verify

func (s *SharedSecret) Verify(incomingConfirmation []byte) error

type Spake2

type Spake2 struct {
	// contains filtered or unexported fields
}

func New

func New(s suite.CipherSuite) *Spake2

func (Spake2) ComputeVerifier

func (s Spake2) ComputeVerifier(password, salt []byte) ([]byte, error)

func (Spake2) StartA

func (s Spake2) StartA(idA, idB, password, salt, aad []byte) (State, []byte, error)

func (Spake2) StartB

func (s Spake2) StartB(idA, idB, verifier, aad []byte) (State, []byte, error)

type State

type State interface {
	Finish([]byte) (*SharedSecret, error)
}

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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