Skip to content

Commit

Permalink
Merge pull request #256 from getamis/addpointType
Browse files Browse the repository at this point in the history
crypto/ecpointgrouplaw/point.go: add types of elliptic curve P256
  • Loading branch information
cychuang0924 authored May 2, 2023
2 parents 430ab12 + 1e8e2a1 commit 299c459
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crypto/ecpointgrouplaw/point.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,8 @@ func (c EcPointMessage_Curve) GetEllipticCurve() (elliptic.Curve, error) {
return elliptic.Secp256k1(), nil
case EcPointMessage_EDWARD25519:
return elliptic.Ed25519(), nil
case EcPointMessage_P256:
return elliptic.P256(), nil
}
return nil, ErrInvalidCurve
}
Expand All @@ -271,6 +273,8 @@ func ToCurve(c elliptic.Curve) (EcPointMessage_Curve, error) {
return EcPointMessage_S256, nil
case elliptic.Ed25519():
return EcPointMessage_EDWARD25519, nil
case elliptic.P256():
return EcPointMessage_P256, nil
}
return 0, ErrInvalidCurve
}

0 comments on commit 299c459

Please sign in to comment.