elliptic

package
v2.2.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2023 License: MIT Imports: 5 Imported by: 17

Documentation

Overview

Package elliptic provides elliptic curve cryptography for DTLS

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CurveTypes

func CurveTypes() map[CurveType]struct{}

CurveTypes returns all known curves

func Curves

func Curves() map[Curve]bool

Curves returns all curves we implement

Types

type Curve

type Curve uint16

Curve is used to represent the IANA registered curves for TLS

https://www.iana.org/assignments/tls-parameters/tls-parameters.xml#tls-parameters-8

const (
	P256   Curve = 0x0017
	P384   Curve = 0x0018
	X25519 Curve = 0x001d
)

Curve enums

func (Curve) String added in v2.2.0

func (c Curve) String() string

type CurvePointFormat

type CurvePointFormat byte

CurvePointFormat is used to represent the IANA registered curve points

https://www.iana.org/assignments/tls-parameters/tls-parameters.xml#tls-parameters-9

const (
	CurvePointFormatUncompressed CurvePointFormat = 0
)

CurvePointFormat enums

type CurveType

type CurveType byte

CurveType is used to represent the IANA registered curve types for TLS

https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-parameters-10

const (
	CurveTypeNamedCurve CurveType = 0x03
)

CurveType enums

type Keypair

type Keypair struct {
	Curve      Curve
	PublicKey  []byte
	PrivateKey []byte
}

Keypair is a Curve with a Private/Public Keypair

func GenerateKeypair

func GenerateKeypair(c Curve) (*Keypair, error)

GenerateKeypair generates a keypair for the given Curve

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL