Home | History | Annotate | Download | only in x509

Lines Matching full:curve

18 // ecPrivateKey reflects an ASN.1 Elliptic Curve Private Key Structure.
31 // ParseECPrivateKey parses an ASN.1 Elliptic Curve Private Key Structure.
38 oid, ok := oidFromNamedCurve(key.Curve)
40 return nil, errors.New("x509: unknown elliptic curve")
47 // sets the curve ID to the given OID, or omits it if OID is nil.
50 paddedPrivateKey := make([]byte, (key.Curve.Params().N.BitLen()+7)/8)
57 PublicKey: asn1.BitString{Bytes: elliptic.Marshal(key.Curve, key.X, key.Y)},
61 // parseECPrivateKey parses an ASN.1 Elliptic Curve Private Key Structure.
62 // The OID for the named curve may be provided from another source (such as
74 var curve elliptic.Curve
76 curve = namedCurveFromOID(*namedCurveOID)
78 curve = namedCurveFromOID(privKey.NamedCurveOID)
80 if curve == nil {
81 return nil, errors.New("x509: unknown elliptic curve")
85 curveOrder := curve.Params().N
87 return nil, errors.New("x509: invalid elliptic curve private key value")
90 priv.Curve = curve
108 priv.X, priv.Y = curve.ScalarBaseMult(privateKey)