INNER CODE UNIT · Go

initCurveWithOptions

schollz/pake · pake.go:248

func initCurveWithOptions(pw []byte, role int, curve string, idA, idB []byte, withIDs bool) (p *Pake, err error) {
	p = new(Pake)
	p.curve, p.P, p.Uᵤ, p.Uᵥ, p.Vᵤ, p.Vᵥ, err = initCurve(curve)
	if err != nil {
		return
	}
	p.Pw = pw
	if withIDs {
		p.Pw = append([]byte(nil), pw...)
		p.idA = append([]byte(nil), idA...)
		p.idB = append([]byte(nil), idB...)
		p.curveName = curve
		p.withIDs = true
	}
	if role == 1 {
		p.Role = 1
	} else {
		p.Role = 0

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…