Skip to content

Conversation

armfazh
Copy link
Contributor

@armfazh armfazh commented Sep 23, 2025

Use of faster polynomial evaluation in the Lagrange basis from the rhizomes paper.

Reference:
link Rhizomes and the Roots of Efficiency, Latincrypt 2025.

Running Benchmarks

git checkout main
cargo bench --features experimental --bench speed_tests -- "prio3.*prepare_init" --quiet --save-baseline baseline

git checkout pr
cargo bench --features experimental --bench speed_tests -- "prio3.*prepare_init" --quiet --save-baseline rhizomes
critcmp baseline rhizomes

Timings

Plot of the timings for PrepInit step.

comparison

Faster polynomial evaluation on flp.Query.
Polynomials are directly evaluated in the Lagrange basis.
Uses the batched algorithm from the rhizomes paper (https://ia.cr/2025/1727).
Copy link
Contributor

@jcjones jcjones left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only weighing in on the Rust, not the cryptographic implementation

) -> Vec<F> {
let mut l = F::one();
let mut u = Vec::with_capacity(polynomials.len());
u.extend(polynomials.iter().map(|poly| poly[0]));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we should avoid this potential access panic the way it's done on line 99. Something like:

Suggested change
u.extend(polynomials.iter().map(|poly| poly[0]));
u.extend(polynomials.iter().map(|poly| poly.get(0).copied().unwrap_or_else(F::zero)));

Comment on lines +121 to +122
let log2_n = usize::try_from(log2(n as u128)).unwrap();
assert_eq!(n, 1 << log2_n);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no prior art in this file, but perhaps this should be a method that is fallible with a Result<Vec<F>> return type instead of the panics here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants