ecdh

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: BSD-2-Clause Imports: 10 Imported by: 3

Documentation

Overview

Package ecdh provide an implementation of the Nike interface using X25519.

Index

Constants

This section is empty.

Variables

View Source
var ECDHNIKE = &ecdhNIKE{}

ECDHNIKE is an implementation of the nike.Nike interface using X25519.

Functions

func EcdhNike2EdwardsPublicKey

func EcdhNike2EdwardsPublicKey(publicKey nike.PublicKey) ed25519.PublicKey

EcdhNike2EdwardsPublicKey converts a public key from a signing key to a NIKE (key exchange compatible) version of the public key.

func Edwards2EcdhNikePrivateKey

func Edwards2EcdhNikePrivateKey(
	privateEdwardsKey ed25519.PrivateKey) nike.PrivateKey

Edwards2EcdhNikePrivateKey converts a private key from a signing key to a NIKE (key exchange compatible) version of the private key.

func Edwards2EcdhNikePublicKey

func Edwards2EcdhNikePublicKey(
	publicEdwardsKey ed25519.PublicKey) nike.PublicKey

Edwards2EcdhNikePublicKey converts a public key from a signing key to a NIKE (key exchange compatible) version of the public key.

Types

type PrivateKey

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

PrivateKey is an implementation of the nike.PrivateKey interface.

func (*PrivateKey) Bytes

func (p *PrivateKey) Bytes() []byte

func (*PrivateKey) DerivePublicKey

func (p *PrivateKey) DerivePublicKey() nike.PublicKey

func (*PrivateKey) DeriveSecret

func (p *PrivateKey) DeriveSecret(pubKey nike.PublicKey) []byte

func (*PrivateKey) FromBytes

func (p *PrivateKey) FromBytes(data []byte) error

func (*PrivateKey) FromEdwards

func (p *PrivateKey) FromEdwards(privateKey ed25519.PrivateKey)

FromEdwards implements the edwards to montgomery conversion as specified in https://www.rfc-editor.org/rfc/rfc8032#section-5.1.5

func (*PrivateKey) MontgomeryBytes

func (p *PrivateKey) MontgomeryBytes() []byte

func (*PrivateKey) Reset

func (p *PrivateKey) Reset()

func (*PrivateKey) Scheme

func (p *PrivateKey) Scheme() nike.Nike

type PublicKey

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

PublicKey is an implementation of the nike.PublicKey interface.

func (*PublicKey) Bytes

func (p *PublicKey) Bytes() []byte

func (*PublicKey) FromBytes

func (p *PublicKey) FromBytes(data []byte) error

func (*PublicKey) FromEdwards

func (p *PublicKey) FromEdwards(publicKey ed25519.PublicKey) (err error)

FromEdwards implements the edwards to montgomery Per RFC 7748, EDDSA Public keys can be trivially converted (https://www.rfc-editor.org/rfc/rfc7748.html#page-14)

func (*PublicKey) MontgomeryBytes

func (p *PublicKey) MontgomeryBytes() []byte

func (*PublicKey) Reset

func (p *PublicKey) Reset()

func (*PublicKey) Scheme

func (p *PublicKey) Scheme() nike.Nike

Jump to

Keyboard shortcuts

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