Skip to content

Commit

Permalink
feat: constrain sha256
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyasRidhuan committed Jan 23, 2025
1 parent dd0684a commit 6f9fbd0
Show file tree
Hide file tree
Showing 20 changed files with 2,227 additions and 58 deletions.
9 changes: 9 additions & 0 deletions barretenberg/cpp/.clangd
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,12 @@ Diagnostics:
Remove:
- cppcoreguidelines-avoid-non-const-global-variables
- cppcoreguidelines-special-member-functions

--- # this divider is necessary
# Suppressing some noisy AVM warnings
If:
PathMatch: [src/barretenberg/vm.*\.cpp]
Diagnostics:
Suppress:
- -Wmissing-designated-field-initializers

3 changes: 2 additions & 1 deletion barretenberg/cpp/pil/vm2/execution.pil
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
include "alu.pil";
include "addressing.pil";
include "precomputed.pil";
include "sha256.pil";

namespace execution;

Expand Down Expand Up @@ -53,4 +54,4 @@ precomputed.sel_bitwise {precomputed.bitwise_op_id, precomputed.bitwise_input_a,
#[LOOKUP_DUMMY_DYNAMIC] // Just a self-lookup for now, for testing.
sel {op1, op2, op3, op4} in sel {op1, op2, op3, op4};
#[PERM_DUMMY_DYNAMIC] // Just a self-permutation for now, for testing.
sel {op1, op2, op3, op4} is sel {op1, op2, op3, op4};
sel {op1, op2, op3, op4} is sel {op1, op2, op3, op4};
6 changes: 5 additions & 1 deletion barretenberg/cpp/pil/vm2/precomputed.pil
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,8 @@ pol constant sel_bitwise; // 1 in the first 3 * 256 rows.
pol constant bitwise_op_id; // identifies if operation is AND/OR/XOR.
pol constant bitwise_input_a; // column of all 8-bit numbers.
pol constant bitwise_input_b; // column of all 8-bit numbers.
pol constant bitwise_output; // output = a AND/OR/XOR b.
pol constant bitwise_output; // output = a AND/OR/XOR b.

// SHA256 Round Params Lookup
pol constant sel_sha256_compression;
pol constant sha256_compression_round_constant;
Loading

0 comments on commit 6f9fbd0

Please sign in to comment.