nist

package
v0.0.0-...-579f5cf Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: MIT, MPL-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package nist implements cryptographic groups and ciphersuites based on the NIST standards, using Go's built-in crypto library.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type P256

type P256 struct {
	// contains filtered or unexported fields
}

P256 implements the group.Group interface for the NIST P-256 elliptic curve.

func NewP256

func NewP256() *P256

NewP256 returns a new instance of P256.

func (*P256) Order

func (c *P256) Order() *big.Int

Return the order of this curve: the prime N in the curve parameters.

func (*P256) Point

func (c *P256) Point() group.Point

Create a Point associated with this curve.

func (*P256) PointLen

func (c *P256) PointLen() int

Return the number of bytes in the encoding of a Point for this curve. Currently uses uncompressed ANSI X9.62 format with both X and Y coordinates; this could change.

func (*P256) Scalar

func (c *P256) Scalar() group.Scalar

Create a Scalar associated with this curve. The scalars created by this package implement group.Scalar's SetBytes method, interpreting the bytes as a big-endian integer, so as to be compatible with the Go standard library's big.Int type.

func (*P256) ScalarLen

func (c *P256) ScalarLen() int

Return the number of bytes in the encoding of a Scalar for this curve.

func (*P256) String

func (curve *P256) String() string

type P384

type P384 struct {
	// contains filtered or unexported fields
}

P384 implements the group.Group interface for the NIST P-384 elliptic curve.

func NewP384

func NewP384() *P384

NewP384 returns a new instance of P384.

func (*P384) Order

func (c *P384) Order() *big.Int

Return the order of this curve: the prime N in the curve parameters.

func (*P384) Point

func (c *P384) Point() group.Point

Create a Point associated with this curve.

func (*P384) PointLen

func (c *P384) PointLen() int

Return the number of bytes in the encoding of a Point for this curve. Currently uses uncompressed ANSI X9.62 format with both X and Y coordinates; this could change.

func (*P384) Scalar

func (c *P384) Scalar() group.Scalar

Create a Scalar associated with this curve. The scalars created by this package implement group.Scalar's SetBytes method, interpreting the bytes as a big-endian integer, so as to be compatible with the Go standard library's big.Int type.

func (*P384) ScalarLen

func (c *P384) ScalarLen() int

Return the number of bytes in the encoding of a Scalar for this curve.

func (*P384) String

func (curve *P384) String() string

type P521

type P521 struct {
	// contains filtered or unexported fields
}

P521 implements the group.Group interface for the NIST P-521 elliptic curve.

func NewP521

func NewP521() *P521

NewP521 returns a new instance of P521.

func (*P521) Order

func (c *P521) Order() *big.Int

Return the order of this curve: the prime N in the curve parameters.

func (*P521) Point

func (c *P521) Point() group.Point

Create a Point associated with this curve.

func (*P521) PointLen

func (c *P521) PointLen() int

Return the number of bytes in the encoding of a Point for this curve. Currently uses uncompressed ANSI X9.62 format with both X and Y coordinates; this could change.

func (*P521) Scalar

func (c *P521) Scalar() group.Scalar

Create a Scalar associated with this curve. The scalars created by this package implement group.Scalar's SetBytes method, interpreting the bytes as a big-endian integer, so as to be compatible with the Go standard library's big.Int type.

func (*P521) ScalarLen

func (c *P521) ScalarLen() int

Return the number of bytes in the encoding of a Scalar for this curve.

func (*P521) String

func (curve *P521) String() string

Jump to

Keyboard shortcuts

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