jwa.go 362 B

1234567891011121314151617
  1. //go:generate go run internal/cmd/gentypes/main.go
  2. // Package jwa defines the various algorithm described in https://tools.ietf.org/html/rfc7518
  3. package jwa
  4. // Size returns the size of the EllipticCurveAlgorithm
  5. func (crv EllipticCurveAlgorithm) Size() int {
  6. switch crv {
  7. case P256:
  8. return 32
  9. case P384:
  10. return 48
  11. case P521:
  12. return 66
  13. }
  14. return 0
  15. }