logderivprecomp

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: Apache-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package logderivprecomp allows computing functions using precomputation.

Instead of computing binary functions and checking that the result is correctly constrained, we instead can precompute all valid values of a function and then perform lookup to obtain the result. For example, for the XOR function we would naively otherwise have to split the inputs into bits, XOR one-by-one and recombine.

With this package, we can instead compute all results for two inputs of length 8 bit and then just perform a lookup on the inputs.

We use the logderivarg package for the actual log-derivative argument.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Precomputed

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

Precomputed holds all precomputed function values and queries.

func New

func New(api frontend.API, fn solver.Hint, rets []uint) (*Precomputed, error)

New returns a new Precomputed. It defers the log-derivative argument.

func (*Precomputed) Query

func (t *Precomputed) Query(x, y frontend.Variable) []frontend.Variable

Query

Jump to

Keyboard shortcuts

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