INNER CODE UNIT · Go
AvailableCurves
schollz/pake · pake.go:163
func AvailableCurves() []string {
return []string{"p521", "p256", "p384", "siec", "ed25519"}
}
// 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 initCurve(curve string) (ellipticCurve EllipticCurve, P *big.Int, Ux *big.Int, Uy *big.Int, Vx *big.Int, Vy *big.Int, err error) {
switch curve {
case "p521":
ellipticCurve = elliptic.P521()
Ux, _ = new(big.Int).SetString("793136080485469241208656611513609866400481671852", 10)
Uy, _ = new(big.Int).SetString("4032821203812196944795502391345776760852202059010382256134592838722123385325802540879231526503456158741518531456199762365161310489884151533417829496019094620", 10)
Vx, _ = new(big.Int).SetString("1086685267857089638167386722555472967068468061489", 10)
Vy, _ = new(big.Int).SetString("5010916268086655347194655708160715195931018676225831839835602465999566066450501167246678404591906342753230577187831311039273858772817427392089150297708931207", 10)
P = elliptic.P521().Params().P
case "p256":