Documentation ¶
Overview ¶
Package ecdh provide an implementation of the Nike interface using X25519.
Index ¶
- Variables
- func EcdhNike2EdwardsPublicKey(publicKey nike.PublicKey) ed25519.PublicKey
- func Edwards2EcdhNikePrivateKey(privateEdwardsKey ed25519.PrivateKey) nike.PrivateKey
- func Edwards2EcdhNikePublicKey(publicEdwardsKey ed25519.PublicKey) nike.PublicKey
- type PrivateKey
- func (p *PrivateKey) Bytes() []byte
- func (p *PrivateKey) DerivePublicKey() nike.PublicKey
- func (p *PrivateKey) DeriveSecret(pubKey nike.PublicKey) []byte
- func (p *PrivateKey) FromBytes(data []byte) error
- func (p *PrivateKey) FromEdwards(privateKey ed25519.PrivateKey)
- func (p *PrivateKey) MontgomeryBytes() []byte
- func (p *PrivateKey) Reset()
- func (p *PrivateKey) Scheme() nike.Nike
- type PublicKey
Constants ¶
This section is empty.
Variables ¶
var ECDHNIKE = &ecdhNIKE{}
ECDHNIKE is an implementation of the nike.Nike interface using X25519.
Functions ¶
func EcdhNike2EdwardsPublicKey ¶
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.
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) FromEdwards ¶
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)