Skip to content

fix!: sha256.pil missing input propagation constraints#19590

Merged
dbanks12 merged 2 commits into
merge-train/avmfrom
db/sha-prop-fix
Jan 14, 2026
Merged

fix!: sha256.pil missing input propagation constraints#19590
dbanks12 merged 2 commits into
merge-train/avmfrom
db/sha-prop-fix

Conversation

@dbanks12

@dbanks12 dbanks12 commented Jan 14, 2026

Copy link
Copy Markdown
Contributor

This allowed you to tamper with sha256 inputs on rows after start

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@dbanks12 dbanks12 force-pushed the db/sha-prop-fix branch 2 times, most recently from f2903a0 to 8dd5e6e Compare January 14, 2026 15:10
Comment on lines +799 to +807
// Tamper with init_a on row 1 (making it different from row 0)
FF original_init_a = trace.get(C::sha256_init_a, TAMPER_ROW);
FF tampered_init_a = original_init_a + FF(0x12345678);
trace.set(C::sha256_init_a, TAMPER_ROW, tampered_init_a);

// The PROPAGATE_INIT_A constraint should catch this:
// perform_round * (init_a' - init_a) = 0
// On row 0: perform_round=1, init_a'=tampered, init_a=original -> constraint violated
EXPECT_THROW_WITH_MESSAGE(check_relation<sha256>(trace, sha256::SR_PROPAGATE_INIT_A), "PROPAGATE_INIT_A");

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before fix, this tampering did not fail constraints

@dbanks12 dbanks12 marked this pull request as ready for review January 14, 2026 15:11
Comment thread barretenberg/cpp/pil/vm2/sha256.pil
@AztecBot

AztecBot commented Jan 14, 2026

Copy link
Copy Markdown
Collaborator

Flakey Tests

🤖 says: This CI run detected 3 tests that failed, but were tolerated due to a .test_patterns.yml entry.

\033FLAKED\033 (8;;http://ci.aztec-labs.com/a266430add6d0048�a266430add6d00488;;�):  yarn-project/end-to-end/scripts/run_test.sh simple src/e2e_epochs/epochs_invalidate_block.parallel.test.ts "committee member invalidates a block if proposer does not come through" (94s) (code: 1) group:e2e-p2p-epoch-flakes (\033David Banks\033: comment)
\033FLAKED\033 (8;;http://ci.aztec-labs.com/c29b69ddb3d07c09�c29b69ddb3d07c098;;�): yarn-project/end-to-end/scripts/run_test.sh web3signer src/composed/web3signer/e2e_multi_validator_node_key_store.test.ts (35s) (code: 1) (\033David Banks\033: comment)
\033FLAKED\033 (8;;http://ci.aztec-labs.com/054672c3f8b3a622�054672c3f8b3a6228;;�):  yarn-project/end-to-end/scripts/run_test.sh simple src/e2e_epochs/epochs_invalidate_block.parallel.test.ts "proposer invalidates multiple blocks" (603s) (code: 124) group:e2e-p2p-epoch-flakes (\033David Banks\033: comment)

@dbanks12 dbanks12 merged commit 0b8078e into merge-train/avm Jan 14, 2026
9 checks passed
@dbanks12 dbanks12 deleted the db/sha-prop-fix branch January 14, 2026 17:34
@AztecBot AztecBot mentioned this pull request Jan 14, 2026
github-merge-queue Bot pushed a commit that referenced this pull request Jan 14, 2026
BEGIN_COMMIT_OVERRIDE
fix(avm): Fix relative addressing in fuzzer (#19550)
feat(avm): avm fuzzer bytecode mutation (#19378)
chore(avm): there is automatic conversion from uint128_t to FF
chore(avm): ECC pre-audit - normalise infinity points (#19462)
feat(bb-pilcom): single-component graph check (#19578)
feat(avm): contract class mutation (#19498)
chore: support uint128_t in uint256_t construction (#19581)
fix!: remove unused column in update_check.pil (#19557)
fix(avm)!: pre-audit review of context.pil (#19549)
fix(avm): Relax fuzzer memory manager asserts (#19591)
fix!: sha256.pil missing input propagation constraints (#19590)
END_COMMIT_OVERRIDE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants