logup

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2025 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Poly = iota
	FullRandom
)

Variables

View Source
var (
	Table           [][]frontend.Variable
	QueryID         []frontend.Variable
	QueryResult     [][]frontend.Variable
	LookupTableBits int
)

Functions

func BatchQuery

func BatchQuery(keys []frontend.Variable, values [][]frontend.Variable)

func CombineColumn

func CombineColumn(api ecgo.API, vec_2d [][]frontend.Variable, randomness []frontend.Variable) []frontend.Variable

func FinalCheck

func FinalCheck(api frontend.Variable, column_combine_option ColumnCombineOptions)

func GetColumnRandomness

func GetColumnRandomness(api ecgo.API, n_columns uint, column_combine_options ColumnCombineOptions) []frontend.Variable

func IsPowerOf2

func IsPowerOf2(n int) bool

0 is considered a power of 2 in this case

func NewRangeProof

func NewRangeProof(bits int)

this interface write to a single (default) rangeProof table

func NewTable

func NewTable(key []frontend.Variable, value [][]frontend.Variable)

this interface write to a single (default) table, the table size must be a power of 2

func Query

func Query(key frontend.Variable, value []frontend.Variable)

this interface write a query to the default table, Table a query is a pair of key and values

func QueryCountBaseKeysHintFn

func QueryCountBaseKeysHintFn(field *big.Int, inputs []*big.Int, outputs []*big.Int) error

func QueryCountHintFn

func QueryCountHintFn(field *big.Int, inputs []*big.Int, outputs []*big.Int) error

TODO: Do we need bits check for the count?

func QueryRange

func QueryRange(key frontend.Variable)

this interface write a query to the default table, Table For a range query that checks if a key is in a table while ignoring the value (RangeProof)

func RangeProof

func RangeProof(api frontend.API, a frontend.Variable, n int)

func Reset

func Reset()

func SimpleMin

func SimpleMin(a uint, b uint) uint

Types

type ColumnCombineOptions

type ColumnCombineOptions int
const ColumnCombineOption ColumnCombineOptions = FullRandom

type LogUpCircuit

type LogUpCircuit struct {
	Table       [][]frontend.Variable
	QueryID     []frontend.Variable
	QueryResult [][]frontend.Variable
}

func NewRandomCircuit

func NewRandomCircuit(
	n_table_rows uint,
	n_queries uint,
	n_columns uint,
	fill_values bool,
) *LogUpCircuit

func (*LogUpCircuit) Check

func (c *LogUpCircuit) Check(api ecgo.API, column_combine_option ColumnCombineOptions) error

func (*LogUpCircuit) Define

func (c *LogUpCircuit) Define(api frontend.API) error

Define declares the circuit's constraints

type RationalNumber

type RationalNumber struct {
	Numerator   frontend.Variable
	Denominator frontend.Variable
}

func SumRationalNumbers

func SumRationalNumbers(api frontend.API, rs []RationalNumber) RationalNumber

Construct a binary summation tree to sum all the values

func (*RationalNumber) Add

Jump to

Keyboard shortcuts

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