utils

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputePowers

func ComputePowers(x fr.Element, n uint) []fr.Element

ComputePowers computes x^0 to x^n-1.

More precisely, given x and n, returns a slice containing [x^0, ..., x^n-1] In particular, for n==0, an empty slice is returned

func IsPowerOfTwo

func IsPowerOfTwo(value uint64) bool

IsPowerOfTwo returns true if `value` is a power of two.

`0` will return false

func ReduceCanonicalLittleEndian

func ReduceCanonicalLittleEndian(serScalar []byte) (fr.Element, error)

Tries to convert a byte slice to a field element. Returns an error if the byte slice was not a canonical representation of the field element. Canonical meaning that the big integer interpretation was less than the field's prime. ie it lies within the range [0, p-1] (inclusive)

func Reverse

func Reverse[K interface{}](list []K)

Reverse reverses the list in-place

Types

This section is empty.

Jump to

Keyboard shortcuts

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