key

package
v0.0.0-...-c6538f3 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2021 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewKeyPair

func NewKeyPair(keyLength, threshold int) (*PublicKey, *PrivateKey, error)

NewKeyPair generates a new public and private key. The key length must be large enough to encrypt the message. The threshold should be greater than the maximum integer that will be encrypted.

func RequirePublicKeysEqual

func RequirePublicKeysEqual(x, y *PublicKey)

Types

type PrivateKey

type PrivateKey struct {
	Length    int
	PublicKey *PublicKey
	L         *big.Int
	U         *big.Int
	Threshold *big.Int
}

PrivateKey must be kept secret

type PrivateKeyInfo

type PrivateKeyInfo struct {
	Length    int
	L         *big.Int
	N         *big.Int
	Threshold *big.Int
}

PrivateKeyInfo is used to serialize

type PublicKey

type PublicKey struct {
	Length int
	N      *big.Int
	NSq    *big.Int
	G      *big.Int
}

PublicKey is the key that may be shared

type PublicKeyInfo

type PublicKeyInfo struct {
	Length int
	N      *big.Int
}

PublicKeyInfo is used to serialize

Jump to

Keyboard shortcuts

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