lattice

package
v0.0.0-...-1f23a7b Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2023 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindShortVector

func FindShortVector(k *scalar.Scalar) (Int128, Int128)

FindShortVector finds a "short" non-zero vector `(d_0, d_1)` such that `d_0 = d_1 k mod ell`. `d_0` and `d_1` may be negative.

Implements Algorithm 4 from [Pornin 2020](https://eprint.iacr.org/2020/454).

Types

type Int128

type Int128 struct {
	// contains filtered or unexported fields
}

Int128 is a representation of a signed 128-bit integer.

func (Int128) Abs

func (x Int128) Abs() Int128

Abs returns the absolute value of an Int128.

func (Int128) IsNegative

func (x Int128) IsNegative() bool

IsNegative returns whether or not the Int128 is negative.

func (Int128) ToScalar

func (x Int128) ToScalar(s *scalar.Scalar) *scalar.Scalar

ToScalar sets the scalar to the Int128, honoring the sign.

Jump to

Keyboard shortcuts

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