suite

package
v0.0.0-...-bf1e635 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CipherSuite

type CipherSuite interface {
	Hash() hash.Hash
	Group() Group
	Mhf([]byte, []byte) ([]byte, error)
	HashDigest([]byte) []byte
	HashSize() int
	DeriveKey([]byte, []byte, []byte) []byte
	Mac([]byte, []byte) []byte
	MacEqual([]byte, []byte) bool
}

type CipherSuiteID

type CipherSuiteID int

type Element

type Element interface {
	FromBytes([]byte) error
	Bytes() []byte
	Equal(s2 Element) bool
	Identity() Element
	Add(a, b Element) Element
	Negate(a Element) Element
	ScalarMult(s Scalar, p Element) Element
}

type Group

type Group interface {
	M() Element
	N() Element
	RandomElement() (Element, error)
	RandomScalar() (Scalar, error)
	CofactorScalar() Scalar
	ClearCofactor(Element) Element
	Order() *big.Int
	String() string   // name of the group
	ScalarLen() int   // Max length of scalars in bytes
	Scalar() Scalar   // Create new scalar
	ElementLen() int  // Max length of element in bytes
	Element() Element // Create new element
}

type MHF

type MHF func(password, salt []byte, len int) ([]byte, error)

memory-hard function, you can feed either an Scrypt or Argon2i/d (RFC uses scrypt but you may not want to.)

type Scalar

type Scalar interface {
	FromBytes([]byte) error
	Bytes() []byte
	Negate(a Scalar) Scalar
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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