Skip to content

Commit

Permalink
address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Al-Kindi-0 committed Mar 9, 2025
1 parent 17c5c49 commit 5a81c5f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
3 changes: 2 additions & 1 deletion stdlib/asm/crypto/stark/constants.masm
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ const.PUBLIC_INPUTS_PTR=4294800000
# OOD Frames
# (71 + 7) * 2 * 2 Felt for current and next trace rows and 8 * 2 Felt for constraint composition
# polynomials. Memory slots:
# OOD_TRACE_CURRENT_PTR: (71 + 7) * 2 * 2 = 312
# OOD_TRACE_CURRENT_PTR: (71 + 7) * 2 = 156
# OOD_TRACE_NEXT_PTR: (71 + 7) * 2 = 156
# OOD_CONSTRAINT_EVALS_PTR: 8 * 2 = 16
const.OOD_TRACE_CURRENT_PTR=4294900000
const.OOD_TRACE_NEXT_PTR=4294900156
Expand Down
11 changes: 3 additions & 8 deletions stdlib/asm/crypto/stark/random_coin.masm
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@ export.init_seed
# Since memory beyond 3 * 2^30 does not have any special meaning, we can use the memory region
# starting from address 2^32 - 1 in decreasing order to hold constants that are used throughout
# the `verify` procedure.
#
# Cycles: 22
padw
exec.constants::zero_word mem_storew
exec.constants::c_ptr mem_storew
Expand All @@ -106,7 +104,6 @@ export.init_seed
# Create the initial seed for randomness generation from proof context

## Compute trace_length
## Cycles: 20
dup
pow2
u32split assertz
Expand All @@ -116,7 +113,6 @@ export.init_seed
dup.0 exec.constants::trace_length_ptr mem_store

## Assert blowup is equal to 8
## Cycles: 6
swap
dup.3
dup
Expand Down Expand Up @@ -185,18 +181,17 @@ export.init_seed
## field extension and FRI parameters
## field extension degree || FRI folding factor || FRI remainder polynomial max degree || blowup factor
push.0x02040708
# => [PROOF_OPTIONS, MODULUS1, MODULUS0, TRACE_INFO, trace_length, num_queries, blowup, grinding, ...]
# => [proof_options, modulus1, modulus0, trace_info, trace_length, num_queries, blowup, grinding, ...]

# Hash proof context
# Cycles: 15
swapw
movup.2 drop
movdn.5
# => [num_queries, grinding, PROOF_OPTIONS, MODULUS1, MODULUS0, trace_length, TRACE_INFO, ...]
# => [num_queries, grinding, proof_options, modulus1, modulus0, trace_length, trace_info, ...]

exec.constants::get_num_constraints
movdn.3
# => [num_queries, grinding, PROOF_OPTIONS, NUM_CONSTRAINTS, MODULUS1, MODULUS0, trace_length, TRACE_INFO, ...]
# => [num_queries, grinding, proof_options, NUM_CONSTRAINTS, modulus1, modulus0, trace_length, trace_info, ...]

push.4.0.0.0
movdnw.2
Expand Down
2 changes: 1 addition & 1 deletion stdlib/asm/crypto/stark/verifier.masm
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export.verify
# VI) Evaluate the constraints over the OOD frame and assert equality with H(z)
#==============================================================================================

# Compare with the evaluation of the constraints on the trace columns OOD evaluation frame.
# TODO: compare with the evaluation of the constraints on the trace columns OOD evaluation frame.
drop drop
# => [...]

Expand Down

0 comments on commit 5a81c5f

Please sign in to comment.