elgamal

package
v0.0.2-0...-bbf5716 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2025 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const NumCiphertexts = 8

Variables

This section is empty.

Functions

This section is empty.

Types

type Ciphertext

type Ciphertext struct {
	C1, C2 twistededwards.Point
}

func NewCiphertext

func NewCiphertext() *Ciphertext

func (*Ciphertext) Add

func (z *Ciphertext) Add(api frontend.API, x, y *Ciphertext) *Ciphertext

Add sets z to the sum x+y and returns z.

Panics if twistededwards curve init fails.

func (*Ciphertext) AssertIsEqual

func (z *Ciphertext) AssertIsEqual(api frontend.API, x *Ciphertext)

AssertIsEqual fails if any of the fields differ between z and x

func (*Ciphertext) Select

func (z *Ciphertext) Select(api frontend.API, b frontend.Variable, i1 *Ciphertext, i2 *Ciphertext) *Ciphertext

Select if b is true, sets z = i1, else z = i2, and returns z

func (*Ciphertext) Serialize

func (z *Ciphertext) Serialize() []frontend.Variable

Serialize returns a slice with the C1.X, C1.Y, C2.X, C2.Y in order

type Ciphertexts

type Ciphertexts [NumCiphertexts]Ciphertext

func NewCiphertexts

func NewCiphertexts() *Ciphertexts

func (*Ciphertexts) Add

func (cs *Ciphertexts) Add(api frontend.API, x, y *Ciphertexts) *Ciphertexts

Add sets z to the sum x+y and returns z.

Panics if twistededwards curve init fails.

func (*Ciphertexts) AssertIsEqual

func (cs *Ciphertexts) AssertIsEqual(api frontend.API, x *Ciphertexts)

AssertIsEqual fails if any of the fields differ between z and x

func (*Ciphertexts) Select

Select if b is true, sets z = i1, else z = i2, and returns z

func (*Ciphertexts) Serialize

func (cs *Ciphertexts) Serialize() []frontend.Variable

Serialize returns a slice with the C1.X, C1.Y, C2.X, C2.Y in order

Jump to

Keyboard shortcuts

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