mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-04 06:43:07 +00:00
Apply suggestions from code review
Co-authored-by: Linda Guiga <101227802+LindaGuiga@users.noreply.github.com>
This commit is contained in:
parent
99a1eb5c85
commit
6ef0a3c738
@ -154,7 +154,7 @@ global write_table_if_jumpdest:
|
||||
// - (0xFF|X⁷)³² for the first 15 bytes
|
||||
// - (has_prefix => is_0_at_4 |X⁷)³² for the next 15 bytes
|
||||
// - (~has_prefix|X⁷)³² for the last byte
|
||||
// Compute also ~has_prefix = ~has_prefix OR is_0_at_4 for all bytes. We don't need to update ~hash_prefix
|
||||
// Compute also ~has_prefix = ~has_prefix OR is_0_at_4 for all bytes. We don't need to update ~has_prefix
|
||||
// for the second half but it takes less cycles if we do it.
|
||||
DUP2 %shl_const(3)
|
||||
NOT
|
||||
@ -283,7 +283,7 @@ return:
|
||||
// addresses used during program execution within the current context.
|
||||
// For each jumpdest address we also non-deterministically guess
|
||||
// a proof, which is another address in the code such that
|
||||
// is_jumpdest don't abort, when the proof is at the top of the stack
|
||||
// is_jumpdest doesn't abort, when the proof is at the top of the stack
|
||||
// an the jumpdest address below. If that's the case we set the
|
||||
// corresponding bit in @SEGMENT_JUMPDEST_BITS to 1.
|
||||
//
|
||||
@ -297,7 +297,7 @@ global jumpdest_analysis:
|
||||
// If proof == 0 there are no more jump destinations to check
|
||||
POP
|
||||
// This is just a hook used for avoiding verification of the jumpdest
|
||||
// table in another contexts. It is useful during proof generation,
|
||||
// table in another context. It is useful during proof generation,
|
||||
// allowing the avoidance of table verification when simulating user code.
|
||||
global jumpdest_analysis_end:
|
||||
%pop2
|
||||
|
||||
@ -240,7 +240,7 @@ impl<F: Field> GenerationState<F> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Generate the either the next used jump address or the the proof for the last jump address.
|
||||
/// Generate either the next used jump address or the proof for the last jump address.
|
||||
fn run_jumpdest_table(&mut self, input_fn: &ProverInputFn) -> Result<U256, ProgramError> {
|
||||
match input_fn.0[1].as_str() {
|
||||
"next_address" => self.run_next_jumpdest_table_address(),
|
||||
@ -385,7 +385,7 @@ impl<F: Field> GenerationState<F> {
|
||||
/// For all address in `jumpdest_table`, each bounded by `largest_address`,
|
||||
/// this function searches for a proof. A proof is the closest address
|
||||
/// for which none of the previous 32 bytes in the code (including opcodes
|
||||
/// and pushed bytes are PUSHXX and the address is in its range. It returns
|
||||
/// and pushed bytes) are PUSHXX and the address is in its range. It returns
|
||||
/// a vector of even size containing proofs followed by their addresses.
|
||||
fn get_proofs_and_jumpdests(
|
||||
code: &[u8],
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user