vector

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(a, b []ristretto.Scalar) ([]ristretto.Scalar, error)

Add adds two scalar slices a and b, returning the resulting slice and an error if a and b were different sizes

func AddScalar

func AddScalar(a []ristretto.Scalar, b ristretto.Scalar) []ristretto.Scalar

AddScalar takes a scalar slice a and a scalar, b then adds b to every element in a

func Exp

func Exp(a []ristretto.Scalar, b []ristretto.Point, N, M int) (ristretto.Point, error)

Exp exponentiates and sums a vector a to b, creating a commitment

func FromScalar

func FromScalar(a ristretto.Scalar, n uint32) []ristretto.Scalar

FromScalar takes a scalar,a, scaToVec will return a slice of size n, with all elements equal to a

func Hadamard

func Hadamard(a, b []ristretto.Scalar) ([]ristretto.Scalar, error)

Hadamard takes two scalar arrays and construct the Hadamard product

func InnerProduct

func InnerProduct(a, b []ristretto.Scalar) (ristretto.Scalar, error)

InnerProduct takes two scalar arrays and constructs the inner product

func MulScalar

func MulScalar(a []ristretto.Scalar, b ristretto.Scalar) []ristretto.Scalar

MulScalar take a scalar b, and a vector a then multiplies every element in the scalar vector by b

func Neg

func Neg(a []ristretto.Scalar) []ristretto.Scalar

Neg Negates a vector a

func ScalarPowers

func ScalarPowers(a ristretto.Scalar, n uint32) []ristretto.Scalar

ScalarPowers constructs a vector of powers vecPowers(5, 3) = <5^0, 5^1, 5^2>

func ScalarPowersSum

func ScalarPowersSum(a ristretto.Scalar, n uint64) ristretto.Scalar

ScalarPowersSum constructs the Scalar power and then sums up each value

func SplitPoints

func SplitPoints(x []ristretto.Point, n uint32) ([]ristretto.Point, []ristretto.Point, error)

SplitPoints will split a slice x using n Result will be two slices a and b where a = [0,n) and b = [n, len(x))

func SplitScalars

func SplitScalars(x []ristretto.Scalar, n uint32) ([]ristretto.Scalar, []ristretto.Scalar, error)

SplitScalars will split a slice x using n Result will be two slices a and b where a = [0,n) and b = [n, len(x)) Method same as above XXX: use unit test to make sure they output same sizes

func Sub

func Sub(a, b []ristretto.Scalar) ([]ristretto.Scalar, error)

Sub subtracts a vector a from a vector b

func SubScalar

func SubScalar(a []ristretto.Scalar, b ristretto.Scalar) []ristretto.Scalar

SubScalar Subtracts a scalars value b, from every element in the slice a

Types

This section is empty.

Jump to

Keyboard shortcuts

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