-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
255 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
crates/brainfuck_prover/src/components/memory/component.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
use super::table::MemoryColumn; | ||
use stwo_prover::core::{ | ||
channel::Channel, | ||
fields::{qm31::SecureField, secure_column::SECURE_EXTENSION_DEGREE}, | ||
pcs::TreeVec, | ||
}; | ||
|
||
/// The claim of the interaction phase 2 (with the logUp protocol). | ||
/// | ||
/// The total sum is the computed sum of the logUp extension column, | ||
/// including the padded rows. | ||
/// It allows proving that the Memory main trace is a permutation | ||
/// of the Processor trace (which is the execution trace provided by the `brainfuck_vm`). | ||
#[derive(Debug, Eq, PartialEq)] | ||
pub struct InteractionClaim { | ||
/// The computed sum of the logUp extension column, including padded rows. | ||
pub claimed_sum: SecureField, | ||
} | ||
|
||
impl InteractionClaim { | ||
/// Mix the sums from the logUp protocol into the Fiat-Shamir [`Channel`], | ||
/// to bound the proof to the trace. | ||
pub fn mix_into(&self, channel: &mut impl Channel) { | ||
channel.mix_felts(&[self.claimed_sum]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
pub mod component; | ||
pub mod table; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters