nums

package module
v0.0.0-...-adf4ad6 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: ISC Imports: 6 Imported by: 1

README

NUMS

ISC License GoDoc Go Report Card

Microsoft Nothing Up My Sleeve Elliptic curves

NUMS (Nothing Up My Sleeve) curves, which are supported in the MSRElliptic Curve Cryptography Library (a.k.a. MSR ECCLib).

These curves are elliptic curves over a prime field, just like the NIST or Brainpool curves. However, the domain-parameters are choosen using a VERY TIGHT DESIGN SPACE to ensure, that the introduction of a backdoor is infeasable. For a desired size of s bits the prime p is choosen as p = 2^s - c with the smallest c where c>0 and p mod 4 = 3 and p being prime.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ECDH

func ECDH(privateKey *ecdsa.PrivateKey, publicKey *ecdsa.PublicKey) ([]byte, error)

func P256d1

func P256d1() elliptic.Curve

func P256t1

func P256t1() elliptic.Curve

func P384d1

func P384d1() elliptic.Curve

func P384t1

func P384t1() elliptic.Curve

func P512d1

func P512d1() elliptic.Curve

func P512t1

func P512t1() elliptic.Curve

Types

type PrivateKey

type PrivateKey struct {
	PublicKey PublicKey
	D         *big.Int
}

func NewPrivateKey

func NewPrivateKey(privateKey *ecdsa.PrivateKey) *PrivateKey

func ParsePrivateKey

func ParsePrivateKey(der []byte) (*PrivateKey, error)

func (*PrivateKey) MarshalPKCS8PrivateKey

func (pk *PrivateKey) MarshalPKCS8PrivateKey(curve elliptic.Curve) ([]byte, error)

func (*PrivateKey) ToECDSAPrivateKey

func (pk *PrivateKey) ToECDSAPrivateKey() *ecdsa.PrivateKey

type PublicKey

type PublicKey struct {
	X, Y  *big.Int
	Curve elliptic.Curve
}

func ParsePublicKey

func ParsePublicKey(der []byte) (*PublicKey, error)

func (*PublicKey) MarshalPKCS8PublicKey

func (pk *PublicKey) MarshalPKCS8PublicKey(curve elliptic.Curve) ([]byte, error)

func (*PublicKey) ToECDSA

func (pk *PublicKey) ToECDSA() *ecdsa.PublicKey

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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