...

Package ecutil

import "github.com/lestrrat-go/jwx/internal/ecutil"
Overview
Index

Overview ▾

Package ecutil defines tools that help with elliptic curve related computation

func AlgorithmForCurve

func AlgorithmForCurve(crv elliptic.Curve) (jwa.EllipticCurveAlgorithm, bool)

func AllocECPointBuffer

func AllocECPointBuffer(v *big.Int, crv elliptic.Curve) []byte

AllocECPointBuffer allocates a buffer for the given point in the given curve. This buffer should be released using the ReleaseECPointBuffer function.

func AvailableAlgorithms

func AvailableAlgorithms() []jwa.EllipticCurveAlgorithm

func AvailableCurves

func AvailableCurves() []elliptic.Curve

func CurveForAlgorithm

func CurveForAlgorithm(alg jwa.EllipticCurveAlgorithm) (elliptic.Curve, bool)

func IsAvailable

func IsAvailable(alg jwa.EllipticCurveAlgorithm) bool

func RegisterCurve

func RegisterCurve(crv elliptic.Curve, alg jwa.EllipticCurveAlgorithm)

func ReleaseECPointBuffer

func ReleaseECPointBuffer(buf []byte)

ReleaseECPointBuffer releases the []byte buffer allocated.