From 1a96cd707b33e40c354d13863ed953720dc71aa1 Mon Sep 17 00:00:00 2001 From: Bartosz Nowak Date: Wed, 10 Jan 2024 14:46:37 +0100 Subject: [PATCH] stark-verify skaffold function --- src/stark/stark_verify.cairo | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/stark/stark_verify.cairo b/src/stark/stark_verify.cairo index 8b1378917..e561bd460 100644 --- a/src/stark/stark_verify.cairo +++ b/src/stark/stark_verify.cairo @@ -1 +1,32 @@ +use cairo_verifier::queries::queries::queries_to_points; +use cairo_verifier::domains::StarkDomains; +use cairo_verifier::fri::fri::{FriDecommitment, fri_verify}; +use cairo_verifier::stark::{StarkUnsentCommitment, StarkWitness, StarkCommitment}; +// STARK decommitment phase. +fn stark_verify( + queries: Span, + commitment: StarkCommitment, + witness: StarkWitness, + stark_domains: StarkDomains, +) { + // First layer decommit. + + // Compute query points. + let points = queries_to_points(queries, @stark_domains); + + // Evaluate the FRI input layer at query points. + let eval_info = 0; + let oods_poly_evals = ArrayTrait::::new(); + + // Decommit FRI. + let fri_decommitment = FriDecommitment { + values: oods_poly_evals.span(), points: points.span(), + }; + fri_verify( + queries: queries, + commitment: commitment.fri, + decommitment: fri_decommitment, + witness: witness.fri_witness, + ) +}