Skip to main content

Module synthetic

Module synthetic 

Source
Expand description

Synthetic linear combinations of free generators and concrete points.

A Synthetic stores a linear combination where some terms reference abstract generators (identified by u32 indices) and others carry concrete points. Generators are supplied later via Synthetic::eval to produce a concrete group element.

Scaling multiplies all weights. Addition merges the free terms (adding weights at matching indices) and concatenates the concrete terms.

§Usage

// Symbolic generators G_0, G_1.
let [g0, g1] = Synthetic::<F, G>::generators_array();

// Build 2*G_0 + 3*G_1.
let expr = (g0 * &F::from(2u64)) + &(g1 * &F::from(3u64));

// Evaluate with concrete points.
// In practice, use independent generators (e.g. from hash_to_group)
// rather than scaling a single one.
let a = G::generator();
let b = a * &F::from(5u64);
let result = expr.eval(&[a, b], &Sequential);
assert_eq!(result, (a * &F::from(2u64)) + &(b * &F::from(3u64)));

Structs§

Synthetic
A linear combination of free generators and concrete points.