Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EllipticCurve ¶
type EllipticCurve interface { Add(x1, y1, x2, y2 *big.Int) (*big.Int, *big.Int) ScalarBaseMult(k []byte) (*big.Int, *big.Int) ScalarMult(Bx, By *big.Int, k []byte) (*big.Int, *big.Int) IsOnCurve(x, y *big.Int) bool }
EllipticCurve is a general curve which allows other elliptic curves to be used with PAKE.
type Pake ¶
type Pake struct { // Public variables Role int Uᵤ, Uᵥ *big.Int Vᵤ, Vᵥ *big.Int Xᵤ, Xᵥ *big.Int Yᵤ, Yᵥ *big.Int HkA, HkB []byte // contains filtered or unexported fields }
Pake keeps public and private variables by only transmitting between parties after marshaling.
This method follows https://crypto.stanford.edu/~dabo/cryptobook/BonehShoup_0_4.pdf Figure 21/15 http://www.lothar.com/~warner/MagicWormhole-PyCon2016.pdf Slide 11
func Init ¶
func Init(pw []byte, role int, curve EllipticCurve, timeToHash ...time.Duration) (p *Pake, err error)
Init will take the secret weak passphrase (pw) to initialize the points on the elliptic curve. The role is set to either 0 for the sender or 1 for the recipient. The curve can be any elliptic curve.
func InitCurve ¶ added in v1.1.0
InitCurve will take the secret weak passphrase (pw) to initialize the points on the elliptic curve. The role is set to either 0 for the sender or 1 for the recipient. The curve can be siec, p521, p256, p384
func (*Pake) IsVerified ¶
IsVerified returns whether or not the k has been generated AND it confirmed to be the same as partner
func (*Pake) SessionKey ¶
SessionKey is returned, unless it is not generated in which is returns an error. This function does not check if it is verifies.