nike

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: 1 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Key

type Key interface {

	// Reset resets the key material to all zeros.
	Reset()

	// Bytes serializes key material into a byte slice.
	Bytes() []byte

	// FromBytes copys key material from the given byte slice and
	// initializes the Key
	FromBytes(data []byte) error

	Scheme() Nike
}

Key is an interface for types encapsulating key material.

type Nike

type Nike interface {

	// PublicKeySize returns the size in bytes of the public key.
	PublicKeySize() int

	// PrivateKeySize returns the size in bytes of the private key.
	PrivateKeySize() int

	// NewKeypair returns a newly generated key pair.
	NewKeypair(rng io.Reader) (PrivateKey, PublicKey)

	// UnmarshalBinaryPublicKey unmarshals the public key bytes.
	UnmarshalBinaryPublicKey(b []byte) (PublicKey, error)

	// UnmarshalBinaryPrivateKey unmarshals the public key bytes.
	UnmarshalBinaryPrivateKey(b []byte) (PrivateKey, error)

	// NewEmptyPrivateKey is helper method used to help
	// implement UnmarshalBinaryPrivateKey.
	NewEmptyPrivateKey() PrivateKey

	// NewEmptyPublicKey is a helper method used to help
	// implement UnmarshalBinaryPublicKey.
	NewEmptyPublicKey() PublicKey

	// DerivePublicKey derives a public key given a private key.
	DerivePublicKey(PrivateKey) PublicKey
}

Nike is an interface encapsulating a non-interactive key exchange.

type PrivateKey

type PrivateKey interface {
	Key

	DeriveSecret(PublicKey) []byte
}

PrivateKey is an interface for types encapsulating private key material.

type PublicKey

type PublicKey interface {
	Key
}

PublicKey is an interface for types encapsulating public key material.

Directories

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

Jump to

Keyboard shortcuts

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