mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-03 14:23:07 +00:00
* Update prover logic * Add helper method for CTL data * Some cleanup * Update some methods * Fix * Some more fixes * More tweaks * Final * Leverage starky crate * Additional tweaks * Cleanup * More cleanup * Fix * Cleanup imports * Fix * Final tweaks * Cleanup and hide behind debug_assertions attribute * Clippy * Fix no-std * Make wasm compatible * Doc and remove todo * API cleanup and remove TODO * Add Debug impls * Add documentation for public items * Feature-gate alloc imports * Import method from starky instead * Add simple crate and module documentation * Apply comments * Add lib level documentation * Add test without lookups * Fix starks without logup * Cleanup * Some more cleanup * Fix get_challenges for non-lookup STARKs * Add additional config methods and tests * Apply comments * More comments
22 lines
744 B
Rust
22 lines
744 B
Rust
//! Utility module providing some helper functions.
|
|
|
|
#[cfg(not(feature = "std"))]
|
|
use alloc::vec::Vec;
|
|
|
|
use itertools::Itertools;
|
|
use plonky2::field::polynomial::PolynomialValues;
|
|
use plonky2::field::types::Field;
|
|
use plonky2::util::transpose;
|
|
|
|
/// A helper function to transpose a row-wise trace and put it in the format that `prove` expects.
|
|
pub fn trace_rows_to_poly_values<F: Field, const COLUMNS: usize>(
|
|
trace_rows: Vec<[F; COLUMNS]>,
|
|
) -> Vec<PolynomialValues<F>> {
|
|
let trace_row_vecs = trace_rows.into_iter().map(|row| row.to_vec()).collect_vec();
|
|
let trace_col_vecs: Vec<Vec<F>> = transpose(&trace_row_vecs);
|
|
trace_col_vecs
|
|
.into_iter()
|
|
.map(|column| PolynomialValues::new(column))
|
|
.collect()
|
|
}
|