Documentation ¶
Index ¶
- Variables
- type Config
- type Curve
- type Curve25519Curve
- func (c Curve25519Curve) Infinity(p *Curve25519Point) bool
- func (c Curve25519Curve) MultiplyScalar(a, b []byte) ([]byte, error)
- func (c Curve25519Curve) NewGeneratorPoint() *Curve25519Point
- func (c Curve25519Curve) NewPoint() *Curve25519Point
- func (c Curve25519Curve) NewRandomScalar(l int) (*Curve25519Scalar, error)
- func (c Curve25519Curve) NewScalar() *Curve25519Scalar
- func (c Curve25519Curve) NewScalarFromSecret(l int, b []byte) (*Curve25519Scalar, error)
- func (c Curve25519Curve) Params() *CurveParams
- type Curve25519Point
- func (p *Curve25519Point) Add(r1, r2 *Curve25519Point) *Curve25519Point
- func (p *Curve25519Point) Bytes() []byte
- func (p *Curve25519Point) Equal(q *Curve25519Point) int
- func (p *Curve25519Point) ScalarBaseMult(s *Curve25519Scalar) (*Curve25519Point, error)
- func (p *Curve25519Point) ScalarMult(q *Curve25519Point, s *Curve25519Scalar) (*Curve25519Point, error)
- func (p *Curve25519Point) SetBytes(b []byte) (*Curve25519Point, error)
- func (p *Curve25519Point) Subtract(r1, r2 *Curve25519Point) *Curve25519Point
- type Curve25519Scalar
- func (s *Curve25519Scalar) BigInt() *big.Int
- func (s *Curve25519Scalar) Bytes() []byte
- func (s *Curve25519Scalar) Multiply(t *Curve25519Scalar, u *Curve25519Scalar) (*Curve25519Scalar, error)
- func (s *Curve25519Scalar) SetBigInt(i *big.Int) (*Curve25519Scalar, error)
- func (s *Curve25519Scalar) SetBytes(b []byte) (*Curve25519Scalar, error)
- func (s *Curve25519Scalar) Zero() bool
- type CurveParams
- type CurvePoint
- type CurveScalar
- type HashFnType
- type MacFnType
- type ThreePassJpake
- func InitThreePassJpake(initiator bool, userID, pw []byte) (*ThreePassJpake[*Curve25519Point, *Curve25519Scalar], error)
- func InitThreePassJpakeWithConfig(initiator bool, userID, pw []byte, config *Config) (*ThreePassJpake[*Curve25519Point, *Curve25519Scalar], error)
- func InitThreePassJpakeWithConfigAndCurve[P CurvePoint[P, S], S CurveScalar[S]](initiator bool, userID, pw []byte, curve Curve[P, S], config *Config) (*ThreePassJpake[P, S], error)
- func RestoreThreePassJpake(stage int, userID, otherUserID, sessionKey []byte, x1, x2, s *Curve25519Scalar, ...) (*ThreePassJpake[*Curve25519Point, *Curve25519Scalar], error)
- func RestoreThreePassJpakeWithConfig(stage int, userID, otherUserID, sessionKey []byte, x1, x2, s *Curve25519Scalar, ...) (*ThreePassJpake[*Curve25519Point, *Curve25519Scalar], error)
- func RestoreThreePassJpakeWithCurveAndConfig[P CurvePoint[P, S], S CurveScalar[S]](stage int, userID, otherUserID, sessionKey []byte, x1, x2, s S, ...) (*ThreePassJpake[P, S], error)
- func (jp *ThreePassJpake[P, S]) GetPass2Message(msg ThreePassVariant1[P, S]) (*ThreePassVariant2[P, S], error)
- func (jp *ThreePassJpake[P, S]) GetPass3Message(msg ThreePassVariant2[P, S]) (*ThreePassVariant3[P, S], error)
- func (jp *ThreePassJpake[P, S]) Pass1Message() (*ThreePassVariant1[P, S], error)
- func (jp *ThreePassJpake[P, S]) ProcessPass3Message(msg ThreePassVariant3[P, S]) ([]byte, error)
- func (jp *ThreePassJpake[P, S]) ProcessSessionConfirmation1(confirm1 []byte) ([]byte, error)
- func (jp *ThreePassJpake[P, S]) ProcessSessionConfirmation2(confirm2 []byte) error
- type ThreePassVariant1
- type ThreePassVariant2
- type ThreePassVariant3
- type ZKPMsg
Constants ¶
This section is empty.
Variables ¶
View Source
var Curve25519Params = &CurveParams{
N: bigFromHex("1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),
}
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
func (*Config) SetHashFn ¶
func (c *Config) SetHashFn(h HashFnType) *Config
func (*Config) SetSecretGenerationBytes ¶
func (*Config) SetSessionConfirmationBytes ¶
func (*Config) SetSessionGenerationBytes ¶
type Curve ¶
type Curve[P CurvePoint[P, S], S CurveScalar[S]] interface { Params() *CurveParams NewGeneratorPoint() P NewRandomScalar(int) (S, error) NewScalarFromSecret(int, []byte) (S, error) NewPoint() P NewScalar() S Infinity(P) bool }
type Curve25519Curve ¶
type Curve25519Curve struct { Curve[*Curve25519Point, *Curve25519Scalar] }
func (Curve25519Curve) Infinity ¶
func (c Curve25519Curve) Infinity(p *Curve25519Point) bool
func (Curve25519Curve) MultiplyScalar ¶
func (c Curve25519Curve) MultiplyScalar(a, b []byte) ([]byte, error)
func (Curve25519Curve) NewGeneratorPoint ¶
func (c Curve25519Curve) NewGeneratorPoint() *Curve25519Point
func (Curve25519Curve) NewPoint ¶
func (c Curve25519Curve) NewPoint() *Curve25519Point
func (Curve25519Curve) NewRandomScalar ¶
func (c Curve25519Curve) NewRandomScalar(l int) (*Curve25519Scalar, error)
func (Curve25519Curve) NewScalar ¶
func (c Curve25519Curve) NewScalar() *Curve25519Scalar
func (Curve25519Curve) NewScalarFromSecret ¶
func (c Curve25519Curve) NewScalarFromSecret(l int, b []byte) (*Curve25519Scalar, error)
func (Curve25519Curve) Params ¶
func (c Curve25519Curve) Params() *CurveParams
type Curve25519Point ¶
type Curve25519Point edwards25519.Point
func (*Curve25519Point) Add ¶
func (p *Curve25519Point) Add(r1, r2 *Curve25519Point) *Curve25519Point
func (*Curve25519Point) Bytes ¶
func (p *Curve25519Point) Bytes() []byte
func (*Curve25519Point) Equal ¶
func (p *Curve25519Point) Equal(q *Curve25519Point) int
func (*Curve25519Point) ScalarBaseMult ¶
func (p *Curve25519Point) ScalarBaseMult(s *Curve25519Scalar) (*Curve25519Point, error)
func (*Curve25519Point) ScalarMult ¶
func (p *Curve25519Point) ScalarMult(q *Curve25519Point, s *Curve25519Scalar) (*Curve25519Point, error)
func (*Curve25519Point) SetBytes ¶
func (p *Curve25519Point) SetBytes(b []byte) (*Curve25519Point, error)
func (*Curve25519Point) Subtract ¶
func (p *Curve25519Point) Subtract(r1, r2 *Curve25519Point) *Curve25519Point
type Curve25519Scalar ¶
type Curve25519Scalar edwards25519.Scalar
func (*Curve25519Scalar) BigInt ¶
func (s *Curve25519Scalar) BigInt() *big.Int
func (*Curve25519Scalar) Bytes ¶
func (s *Curve25519Scalar) Bytes() []byte
func (*Curve25519Scalar) Multiply ¶
func (s *Curve25519Scalar) Multiply(t *Curve25519Scalar, u *Curve25519Scalar) (*Curve25519Scalar, error)
func (*Curve25519Scalar) SetBigInt ¶
func (s *Curve25519Scalar) SetBigInt(i *big.Int) (*Curve25519Scalar, error)
func (*Curve25519Scalar) SetBytes ¶
func (s *Curve25519Scalar) SetBytes(b []byte) (*Curve25519Scalar, error)
func (*Curve25519Scalar) Zero ¶
func (s *Curve25519Scalar) Zero() bool
type CurveParams ¶
type CurvePoint ¶
type CurveScalar ¶
type HashFnType ¶
type ThreePassJpake ¶
type ThreePassJpake[P CurvePoint[P, S], S CurveScalar[S]] struct { // Received Variables OtherX1G P OtherX2G P OtherUserID []byte SessionKey []byte // Private Variables X1 S X2 S S S // configuration Stage int // contains filtered or unexported fields }
Three pass variant jpake https://tools.ietf.org/html/rfc8236#section-4 If serializing/deserializing, get/set all exported members
func InitThreePassJpake ¶
func InitThreePassJpake(initiator bool, userID, pw []byte) (*ThreePassJpake[*Curve25519Point, *Curve25519Scalar], error)
func InitThreePassJpakeWithConfig ¶
func InitThreePassJpakeWithConfig(initiator bool, userID, pw []byte, config *Config) (*ThreePassJpake[*Curve25519Point, *Curve25519Scalar], error)
func InitThreePassJpakeWithConfigAndCurve ¶
func InitThreePassJpakeWithConfigAndCurve[P CurvePoint[P, S], S CurveScalar[S]](initiator bool, userID, pw []byte, curve Curve[P, S], config *Config) (*ThreePassJpake[P, S], error)
func RestoreThreePassJpake ¶
func RestoreThreePassJpake(stage int, userID, otherUserID, sessionKey []byte, x1, x2, s *Curve25519Scalar, otherX1G, otherX2G *Curve25519Point) (*ThreePassJpake[*Curve25519Point, *Curve25519Scalar], error)
func RestoreThreePassJpakeWithConfig ¶
func RestoreThreePassJpakeWithConfig(stage int, userID, otherUserID, sessionKey []byte, x1, x2, s *Curve25519Scalar, otherX1G, otherX2G *Curve25519Point, config *Config) (*ThreePassJpake[*Curve25519Point, *Curve25519Scalar], error)
func RestoreThreePassJpakeWithCurveAndConfig ¶
func RestoreThreePassJpakeWithCurveAndConfig[P CurvePoint[P, S], S CurveScalar[S]](stage int, userID, otherUserID, sessionKey []byte, x1, x2, s S, otherX1G, otherX2G P, curve Curve[P, S], config *Config) (*ThreePassJpake[P, S], error)
func (*ThreePassJpake[P, S]) GetPass2Message ¶
func (jp *ThreePassJpake[P, S]) GetPass2Message(msg ThreePassVariant1[P, S]) (*ThreePassVariant2[P, S], error)
func (*ThreePassJpake[P, S]) GetPass3Message ¶
func (jp *ThreePassJpake[P, S]) GetPass3Message(msg ThreePassVariant2[P, S]) (*ThreePassVariant3[P, S], error)
func (*ThreePassJpake[P, S]) Pass1Message ¶
func (jp *ThreePassJpake[P, S]) Pass1Message() (*ThreePassVariant1[P, S], error)
func (*ThreePassJpake[P, S]) ProcessPass3Message ¶
func (jp *ThreePassJpake[P, S]) ProcessPass3Message(msg ThreePassVariant3[P, S]) ([]byte, error)
func (*ThreePassJpake[P, S]) ProcessSessionConfirmation1 ¶
func (jp *ThreePassJpake[P, S]) ProcessSessionConfirmation1(confirm1 []byte) ([]byte, error)
func (*ThreePassJpake[P, S]) ProcessSessionConfirmation2 ¶
func (jp *ThreePassJpake[P, S]) ProcessSessionConfirmation2(confirm2 []byte) error
type ThreePassVariant1 ¶
type ThreePassVariant1[P CurvePoint[P, S], S CurveScalar[S]] struct { UserID []byte X1G P X2G P X1ZKP ZKPMsg[P, S] X2ZKP ZKPMsg[P, S] }
type ThreePassVariant2 ¶
type ThreePassVariant2[P CurvePoint[P, S], S CurveScalar[S]] struct { UserID []byte X3G P X4G P B P XsZKP ZKPMsg[P, S] X3ZKP ZKPMsg[P, S] X4ZKP ZKPMsg[P, S] }
type ThreePassVariant3 ¶
type ThreePassVariant3[P CurvePoint[P, S], S CurveScalar[S]] struct { A P XsZKP ZKPMsg[P, S] }
type ZKPMsg ¶
type ZKPMsg[P CurvePoint[P, S], S CurveScalar[S]] struct { T P R S }
Click to show internal directories.
Click to hide internal directories.