elgamal

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Encrypt

func Encrypt(public PublicKey, message curve.Scalar) (*Ciphertext, Nonce)

Encrypt returns the encryption of `message` as (L=nonce⋅G, M=message⋅G + nonce⋅public), as well as the `nonce`.

Types

type Ciphertext

type Ciphertext struct {
	// L = nonce⋅G
	L curve.Point
	// M = message⋅G + nonce⋅public
	M curve.Point
}

func Empty

func Empty(group curve.Curve) *Ciphertext

func (Ciphertext) Domain

func (Ciphertext) Domain() string

func (*Ciphertext) Valid

func (c *Ciphertext) Valid() bool

Valid returns true if the ciphertext passes basic validation.

func (*Ciphertext) WriteTo

func (c *Ciphertext) WriteTo(w io.Writer) (int64, error)

type Nonce

type Nonce = curve.Scalar

type PublicKey

type PublicKey = curve.Point

Jump to

Keyboard shortcuts

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