Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: remove sha256 opcode #4571

Merged
merged 193 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
193 commits
Select commit Hold shift + click to select a range
e057fc8
Remove sha256 opcode
guipublic Feb 13, 2024
5075dfa
Merge branch 'master' into gd/noir_issue_4330
guipublic Feb 13, 2024
98ec330
Merge branch 'master' into gd/noir_issue_4330
guipublic Feb 13, 2024
f81d198
fix test case
guipublic Feb 13, 2024
c7a9949
Merge branch 'master' into gd/noir_issue_4330
guipublic Feb 13, 2024
076033e
remove sha256 from acvm_js
guipublic Feb 13, 2024
d6c8d44
fix the build for acvm-js
guipublic Feb 13, 2024
4df6810
fix for ecdsa account contract
guipublic Feb 13, 2024
ed4d148
Merge branch 'master' into gd/noir_issue_4330
guipublic Feb 13, 2024
69318e5
remove sha256 test case from acvm_js
guipublic Feb 13, 2024
bdd76bb
Merge branch 'master' into gd/noir_issue_4330
guipublic Feb 13, 2024
8161122
remove sha256 from noir_js import
guipublic Feb 13, 2024
fba7258
Merge branch 'master' into gd/noir_issue_4330
guipublic Feb 15, 2024
8284f9f
fix test case
guipublic Feb 15, 2024
4996a92
Merge branch 'master' into gd/noir_issue_4330
kevaundray Feb 15, 2024
65da19e
Merge branch 'master' into gd/noir_issue_4330
guipublic Feb 28, 2024
46c9ee0
merge from master
guipublic Mar 7, 2024
6df99f9
Merge branch 'master' into gd/noir_issue_4330
guipublic Mar 15, 2024
261208b
fix the build
guipublic Mar 15, 2024
3c24cad
fix the build(2)
guipublic Mar 15, 2024
d3b162e
Fix issue with conditional_1 test case
guipublic Mar 18, 2024
5108670
Merge branch 'master' into gd/noir_issue_4330
guipublic Mar 18, 2024
7a9dd62
Merge branch 'master' into gd/noir_issue_4330
guipublic Mar 18, 2024
4b81f58
fix contract for sha256
guipublic Mar 18, 2024
36712f6
Merge branch 'master' into gd/noir_issue_4330
guipublic Mar 18, 2024
ebce27f
Merge branch 'master' into gd/noir_issue_4330
guipublic Mar 20, 2024
6b44397
fix merge from master
guipublic Mar 20, 2024
bb156a0
update test snapshots
guipublic Mar 20, 2024
f1b1bc4
fix dsl unit test
guipublic Mar 20, 2024
d16fe7d
Merge branch 'master' into gd/noir_issue_4330
guipublic Mar 20, 2024
5a05064
Merge branch 'master' into gd/noir_issue_4330
guipublic Mar 20, 2024
6519d3b
add sha_256_compression in acvm_js blackbox
guipublic Mar 21, 2024
ff011d3
Merge branch 'master' into gd/noir_issue_4330
guipublic Mar 21, 2024
ee99ec4
Merge branch 'master' into gd/noir_issue_4330
guipublic Mar 21, 2024
2d2f4bc
Merge branch 'master' into gd/noir_issue_4330
guipublic Mar 21, 2024
11c9957
update test snapshot
guipublic Mar 21, 2024
0649eb8
export sha256_compression in acvm_js
guipublic Mar 21, 2024
5e50459
fix acvm_js build
guipublic Mar 21, 2024
683496c
cargo fmt
guipublic Mar 21, 2024
c5429c6
Merge branch 'master' into gd/noir_issue_4330
guipublic Mar 22, 2024
4e19f04
update snapshot
guipublic Mar 22, 2024
35e734d
Merge branch 'master' into gd/noir_issue_4330
guipublic Mar 25, 2024
6fa3f56
update artifact hash
guipublic Mar 25, 2024
ffe5712
chore: move playwright install before building yarn packages
TomAFrench Mar 25, 2024
7447259
Merge branch 'master' into gd/noir_issue_4330
TomAFrench Mar 25, 2024
ab0a16d
chore: fix version of playwright
TomAFrench Mar 25, 2024
820eebe
Merge branch 'master' into gd/noir_issue_4330
TomAFrench Mar 25, 2024
a3d3d6b
chore: update playwright in yarn.lock
TomAFrench Mar 25, 2024
bca49ef
chore: fix formatting
TomAFrench Mar 25, 2024
713fa74
chore: more formatting
TomAFrench Mar 25, 2024
1d4a8a1
Merge branch 'master' into gd/noir_issue_4330
TomAFrench Mar 25, 2024
5c57822
chore: fix acvm_js test
TomAFrench Mar 25, 2024
e55d77c
Merge branch 'master' into gd/noir_issue_4330
guipublic Mar 26, 2024
84946ee
Merge branch 'master' into gd/noir_issue_4330
guipublic Mar 26, 2024
ec0ed1e
Merge branch 'master' into gd/noir_issue_4330
guipublic Mar 26, 2024
fa8baaf
Merge branch 'master' into gd/noir_issue_4330
guipublic Mar 26, 2024
5aefff8
chore: update serializer
TomAFrench Mar 26, 2024
627ba74
update acvm_js test serialization
guipublic Mar 26, 2024
eb74109
Merge branch 'master' into gd/noir_issue_4330
guipublic Mar 26, 2024
28625ac
Merge branch 'master' into gd/noir_issue_4330
guipublic Mar 27, 2024
ba4f917
chore: update hash
TomAFrench Mar 27, 2024
52b3b04
chore: update deployer address
TomAFrench Mar 27, 2024
f57cdc9
chore: fix deployer address
TomAFrench Mar 27, 2024
4dd3b01
Code review
guipublic Mar 27, 2024
75a3e8a
Merge branch 'master' into gd/noir_issue_4330
guipublic Mar 27, 2024
1c662c5
Merge branch 'master' into gd/noir_issue_4330
guipublic Mar 27, 2024
8092363
Merge branch 'master' into gd/noir_issue_4330
guipublic Mar 28, 2024
3701687
Merge branch 'master' into gd/noir_issue_4330
TomAFrench Apr 8, 2024
5d83f2e
Merge branch 'master' into gd/noir_issue_4330
guipublic Apr 15, 2024
0d863d5
fix merge issue
guipublic Apr 15, 2024
9c99f16
Merge branch 'master' into gd/noir_issue_4330
guipublic Apr 16, 2024
afb8ed4
Merge branch 'master' into gd/noir_issue_4330
guipublic Apr 16, 2024
9f5b13e
Merge branch 'master' into gd/noir_issue_4330
guipublic Apr 18, 2024
af4038d
Merge branch 'master' into gd/noir_issue_4330
guipublic Apr 25, 2024
a8f0db2
chore: remove sha256 from avm-transpiler
TomAFrench Apr 25, 2024
c548f5c
Apply suggestions from code review
TomAFrench Apr 25, 2024
c5f51f4
Merge branch 'master' into gd/noir_issue_4330
guipublic Apr 26, 2024
95a1a21
chore(avm-simulator): sha256 -> sha256compression
dbanks12 Apr 26, 2024
da546ac
Merge branch 'master' into gd/noir_issue_4330
guipublic Apr 30, 2024
edda0ef
Merge remote-tracking branch 'origin/db/avm-simulator-sha256compressi…
guipublic Apr 30, 2024
b4487e2
update serialization in unit tests
guipublic May 3, 2024
b22a166
test
guipublic May 3, 2024
0d8ea6f
revert test
guipublic May 3, 2024
d2c7e32
update acir serialization format
guipublic May 3, 2024
8b97acf
Merge branch 'master' into gd/noir_issue_4330
guipublic May 6, 2024
00c349a
Merge branch 'master' into gd/noir_issue_4330
guipublic May 6, 2024
ee3414d
update serialisation
guipublic May 6, 2024
1223ba6
another serialisation update
guipublic May 6, 2024
6b68029
fix merge issue
guipublic May 6, 2024
58b9b0e
Merge branch 'master' into gd/noir_issue_4330
guipublic May 6, 2024
82443bf
update acir.cpp
guipublic May 6, 2024
c815ddd
Merge branch 'master' into gd/noir_issue_4330
guipublic May 6, 2024
b083d77
Merge branch 'master' into gd/noir_issue_4330
guipublic May 6, 2024
1fe060d
Merge branch 'master' into gd/noir_issue_4330
guipublic May 6, 2024
f31112a
Merge branch 'master' into gd/noir_issue_4330
guipublic May 7, 2024
19c75fe
Merge branch 'master' into gd/noir_issue_4330
guipublic May 8, 2024
e2199b6
Merge branch 'master' into gd/noir_issue_4330
guipublic May 8, 2024
b096e2e
re-generate serialisation format
guipublic May 8, 2024
5a07595
fix merge issue
guipublic May 8, 2024
bd695ce
fix merge issue
guipublic May 8, 2024
dcb91b5
fix merge issues
guipublic May 8, 2024
7e7e73c
Merge branch 'master' into gd/noir_issue_4330
guipublic May 8, 2024
36981cc
chore: fm
TomAFrench May 10, 2024
dba1a2a
Merge branch 'master' into gd/noir_issue_4330
TomAFrench May 10, 2024
fa8b34e
chore(avm-simulator): sha256 -> sha256compression (#6067)
dbanks12 May 14, 2024
3b80a21
Merge branch 'master' into gd/noir_issue_4330
TomAFrench May 14, 2024
28a37e8
Merge branch 'master' into gd/noir_issue_4330
TomAFrench May 14, 2024
fcd3480
Merge branch 'master' into gd/noir_issue_4330
TomAFrench May 15, 2024
b1bd2cb
Merge branch 'master' into gd/noir_issue_4330
TomAFrench May 17, 2024
e3be58c
chore: remove file imports with portals
TomAFrench May 17, 2024
518994d
Merge branch 'master' into gd/noir_issue_4330
TomAFrench May 21, 2024
e82a19a
use no_predicate attribute for sha256
guipublic May 21, 2024
8165287
Merge branch 'master' into gd/noir_issue_4330
guipublic May 21, 2024
b2f2332
chore: remove references to `sha256_constraint`
TomAFrench May 21, 2024
b254960
Merge branch 'master' into gd/noir_issue_4330
TomAFrench May 21, 2024
7ca1f5a
Merge branch 'master' into gd/noir_issue_4330
TomAFrench May 21, 2024
207d3f7
Merge branch 'master' into gd/noir_issue_4330
TomAFrench May 21, 2024
95a0e94
Merge branch 'master' into gd/noir_issue_4330
TomAFrench May 21, 2024
37e48e2
Merge branch 'master' into gd/noir_issue_4330
TomAFrench May 21, 2024
6944c29
chore: fix CI issue
TomAFrench May 22, 2024
d04944d
chore: ignore slow debugger test
TomAFrench May 22, 2024
81fbaba
Merge branch 'master' into gd/noir_issue_4330
guipublic Jun 3, 2024
e5955a6
fix merge issue
guipublic Jun 3, 2024
4bb7467
Merge branch 'master' into gd/noir_issue_4330
guipublic Jun 3, 2024
9765b6d
revert yarn.lock
guipublic Jun 3, 2024
0fceecf
Merge branch 'master' into gd/noir_issue_4330
guipublic Jun 3, 2024
dffe8cd
chore: update yarn.lock
TomAFrench Jun 3, 2024
c156522
fix merge issues #2
guipublic Jun 3, 2024
678481e
Merge branch 'master' into gd/noir_issue_4330
guipublic Jun 3, 2024
81cf85c
fix merge issue #3
guipublic Jun 3, 2024
0d0e24f
Merge branch 'master' into gd/noir_issue_4330
guipublic Jun 3, 2024
a0e2d4d
format
guipublic Jun 3, 2024
65a79aa
Merge branch 'master' into gd/noir_issue_4330
guipublic Jun 3, 2024
49aa574
Merge branch 'master' into gd/noir_issue_4330
guipublic Jun 3, 2024
75fdc4b
Merge branch 'master' into gd/noir_issue_4330
TomAFrench Jun 21, 2024
2cf6869
Merge branch 'master' into gd/noir_issue_4330
TomAFrench Jul 8, 2024
191e588
Merge branch 'master' into gd/noir_issue_4330
TomAFrench Jul 8, 2024
94b48d8
chore: clippy
TomAFrench Jul 8, 2024
aeb06bf
Update noir/noir-repo/noir_stdlib/src/hash/mod.nr
TomAFrench Jul 8, 2024
80dae9b
.
TomAFrench Jul 8, 2024
84764b1
.
TomAFrench Jul 8, 2024
2f382c7
.
TomAFrench Jul 8, 2024
f0e04f7
.
TomAFrench Jul 8, 2024
f2aa38f
.
TomAFrench Jul 8, 2024
6ffa821
.
TomAFrench Jul 8, 2024
ca8cb87
.
TomAFrench Jul 8, 2024
5126751
.
TomAFrench Jul 8, 2024
c414049
Merge branch 'master' into gd/noir_issue_4330
guipublic Jul 15, 2024
2d4b1f8
Merge branch 'master' into gd/noir_issue_4330
guipublic Jul 16, 2024
1f21548
Merge branch 'master' into gd/noir_issue_4330
guipublic Jul 16, 2024
d7d877a
Merge branch 'master' into gd/noir_issue_4330
guipublic Sep 6, 2024
af199e8
fix test case
guipublic Sep 6, 2024
0e38b95
Merge branch 'master' into gd/noir_issue_4330
guipublic Sep 6, 2024
fc1cef7
fix noir build
guipublic Sep 6, 2024
791bf1a
remove sha256 blackbox tests
guipublic Sep 6, 2024
9306e62
fix merge issue
guipublic Sep 6, 2024
31c1e12
fix unit test
guipublic Sep 6, 2024
9028b78
update serialisation
guipublic Sep 6, 2024
b1428e2
fix warning
guipublic Sep 6, 2024
37fb8dc
Merge branch 'master' into gd/noir_issue_4330
guipublic Sep 6, 2024
c384eca
format fix
guipublic Sep 6, 2024
5d9a4ef
restore sha256 in stdlib
guipublic Sep 6, 2024
84a9830
fix merge issue
guipublic Sep 6, 2024
97050fa
fix merge issue
guipublic Sep 6, 2024
302217c
update yarn.lock
guipublic Sep 6, 2024
1d52674
Merge branch 'master' into gd/noir_issue_4330
guipublic Sep 6, 2024
b9d43c1
Merge branch 'master' into gd/noir_issue_4330
guipublic Sep 6, 2024
6e33aff
remove sha256 avm tests
guipublic Sep 9, 2024
ac5c328
Merge branch 'master' into gd/noir_issue_4330
guipublic Sep 9, 2024
859b61f
comment sha256compression in hashing.ts
guipublic Sep 9, 2024
a55094e
fix hashing.ts and other cpp things
fcarreiro Sep 9, 2024
4ae80ae
wip
fcarreiro Sep 6, 2024
3e57bfd
wip
fcarreiro Sep 6, 2024
635cbb5
wip
fcarreiro Sep 6, 2024
bd332a9
fix sizes in wire format
fcarreiro Sep 9, 2024
ed23fcb
fix execution test
fcarreiro Sep 9, 2024
0aafa40
Merge remote-tracking branch 'origin/fc/avm-set-variants' into gd/noi…
fcarreiro Sep 9, 2024
b4fa03f
Merge branch 'master' into gd/noir_issue_4330
guipublic Sep 10, 2024
90d4437
Merge branch 'master' into gd/noir_issue_4330
guipublic Sep 16, 2024
b683e3c
update serialization test case
guipublic Sep 16, 2024
4ba6d32
update yarn.lock
guipublic Sep 16, 2024
f1501a2
Merge branch 'master' into gd/noir_issue_4330
guipublic Sep 16, 2024
c8afcb1
fix test case serialisation
guipublic Sep 17, 2024
205c0f5
chore: fix duplicated import
TomAFrench Sep 17, 2024
e6bdd14
Merge branch 'master' into gd/noir_issue_4330
guipublic Sep 17, 2024
14eff39
Merge branch 'master' into gd/noir_issue_4330
guipublic Sep 17, 2024
6d25206
Merge branch 'master' into gd/noir_issue_4330
guipublic Sep 18, 2024
388038a
Merge branch 'master' into gd/noir_issue_4330
guipublic Sep 19, 2024
d43fe7f
Merge branch 'master' into gd/noir_issue_4330
guipublic Sep 19, 2024
5265276
Merge branch 'master' into gd/noir_issue_4330
guipublic Sep 20, 2024
41b7c2c
Merge branch 'master' into gd/noir_issue_4330
guipublic Sep 20, 2024
987de0a
Merge remote-tracking branch 'origin/master' into gd/noir_issue_4330
fcarreiro Sep 20, 2024
def3634
fix sha indirects in avm cpp
fcarreiro Sep 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions avm-transpiler/src/instructions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ pub const ALL_DIRECT: u8 = 0b00000000;
pub const ZEROTH_OPERAND_INDIRECT: u8 = 0b00000001;
pub const FIRST_OPERAND_INDIRECT: u8 = 0b00000010;
pub const SECOND_OPERAND_INDIRECT: u8 = 0b00000100;
pub const THIRD_OPERAND_INDIRECT: u8 = 0b00001000;

/// A simple representation of an AVM instruction for the purpose
/// of generating an AVM bytecode from Brillig.
Expand Down
12 changes: 4 additions & 8 deletions avm-transpiler/src/opcodes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,14 @@ pub enum AvmOpcode {
// Gadgets
KECCAK,
POSEIDON2,
SHA256, // temp - may be removed, but alot of contracts rely on it
SHA256COMPRESSION,
KECCAKF1600,
PEDERSEN, // temp - may be removed, but alot of contracts rely on it
ECADD,
MSM,
PEDERSENCOMMITMENT, // temp
// Conversions
TORADIXLE,
// Other
SHA256COMPRESSION,
KECCAKF1600,
}

impl AvmOpcode {
Expand Down Expand Up @@ -202,17 +200,15 @@ impl AvmOpcode {

// Gadgets
AvmOpcode::KECCAK => "KECCAK",
AvmOpcode::KECCAKF1600 => "KECCAKF1600",
AvmOpcode::POSEIDON2 => "POSEIDON2",
AvmOpcode::SHA256 => "SHA256 ",
AvmOpcode::SHA256COMPRESSION => "SHA256COMPRESSION",
AvmOpcode::PEDERSEN => "PEDERSEN",
AvmOpcode::ECADD => "ECADD",
AvmOpcode::MSM => "MSM",
AvmOpcode::PEDERSENCOMMITMENT => "PEDERSENCOMMITMENT",
// Conversions
AvmOpcode::TORADIXLE => "TORADIXLE",
// Other
AvmOpcode::SHA256COMPRESSION => "SHA256COMPRESSION",
AvmOpcode::KECCAKF1600 => "KECCAKF1600",
}
}
}
27 changes: 16 additions & 11 deletions avm-transpiler/src/transpile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use noirc_errors::debug_info::DebugInfo;
use crate::bit_traits::bits_needed_for;
use crate::instructions::{
AvmInstruction, AvmOperand, AvmTypeTag, ALL_DIRECT, FIRST_OPERAND_INDIRECT,
SECOND_OPERAND_INDIRECT, ZEROTH_OPERAND_INDIRECT,
SECOND_OPERAND_INDIRECT, THIRD_OPERAND_INDIRECT, ZEROTH_OPERAND_INDIRECT,
};
use crate::opcodes::AvmOpcode;
use crate::utils::{dbg_print_avm_program, dbg_print_brillig_program, make_operand};
Expand Down Expand Up @@ -865,19 +865,24 @@ fn generate_mov_instruction(indirect: Option<u8>, source: u32, dest: u32) -> Avm
/// (array goes in -> field element comes out)
fn handle_black_box_function(avm_instrs: &mut Vec<AvmInstruction>, operation: &BlackBoxOp) {
match operation {
BlackBoxOp::Sha256 { message, output } => {
let message_offset = message.pointer.0;
let message_size_offset = message.size.0;
let dest_offset = output.pointer.0;
assert_eq!(output.size, 32, "SHA256 output size must be 32!");
BlackBoxOp::Sha256Compression { input, hash_values, output } => {
let inputs_offset = input.pointer.0;
let inputs_size_offset = input.size.0;
let state_offset = hash_values.pointer.0;
let state_size_offset = hash_values.size.0;
let output_offset = output.pointer.0;

avm_instrs.push(AvmInstruction {
opcode: AvmOpcode::SHA256,
indirect: Some(ZEROTH_OPERAND_INDIRECT | FIRST_OPERAND_INDIRECT),
opcode: AvmOpcode::SHA256COMPRESSION,
indirect: Some(
ZEROTH_OPERAND_INDIRECT | FIRST_OPERAND_INDIRECT | THIRD_OPERAND_INDIRECT,
),
operands: vec![
AvmOperand::U32 { value: dest_offset as u32 },
AvmOperand::U32 { value: message_offset as u32 },
AvmOperand::U32 { value: message_size_offset as u32 },
AvmOperand::U32 { value: output_offset as u32 },
AvmOperand::U32 { value: state_offset as u32 },
AvmOperand::U32 { value: state_size_offset as u32 },
AvmOperand::U32 { value: inputs_offset as u32 },
AvmOperand::U32 { value: inputs_size_offset as u32 },
],
..Default::default()
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,6 @@ void build_constraints(Builder& builder,
}

// Add sha256 constraints
for (size_t i = 0; i < constraint_system.sha256_constraints.size(); ++i) {
const auto& constraint = constraint_system.sha256_constraints.at(i);
create_sha256_constraints(builder, constraint);
gate_counter.track_diff(constraint_system.gates_per_opcode,
constraint_system.original_opcode_indices.sha256_constraints.at(i));
}

for (size_t i = 0; i < constraint_system.sha256_compression.size(); ++i) {
const auto& constraint = constraint_system.sha256_compression[i];
create_sha256_compression_constraints(builder, constraint);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ struct AcirFormatOriginalOpcodeIndices {
std::vector<size_t> logic_constraints;
std::vector<size_t> range_constraints;
std::vector<size_t> aes128_constraints;
std::vector<size_t> sha256_constraints;
std::vector<size_t> sha256_compression;
std::vector<size_t> schnorr_constraints;
std::vector<size_t> ecdsa_k1_constraints;
Expand Down Expand Up @@ -90,7 +89,6 @@ struct AcirFormat {
std::vector<LogicConstraint> logic_constraints;
std::vector<RangeConstraint> range_constraints;
std::vector<AES128Constraint> aes128_constraints;
std::vector<Sha256Constraint> sha256_constraints;
std::vector<Sha256Compression> sha256_compression;
std::vector<SchnorrConstraint> schnorr_constraints;
std::vector<EcdsaSecp256k1Constraint> ecdsa_k1_constraints;
Expand Down Expand Up @@ -137,7 +135,6 @@ struct AcirFormat {
logic_constraints,
range_constraints,
aes128_constraints,
sha256_constraints,
sha256_compression,
schnorr_constraints,
ecdsa_k1_constraints,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ TEST_F(AcirFormatTests, TestASingleConstraintNoPubInputs)
.logic_constraints = {},
.range_constraints = {},
.aes128_constraints = {},
.sha256_constraints = {},
.sha256_compression = {},
.schnorr_constraints = {},
.ecdsa_k1_constraints = {},
Expand Down Expand Up @@ -169,7 +168,6 @@ TEST_F(AcirFormatTests, TestLogicGateFromNoirCircuit)
.logic_constraints = { logic_constraint },
.range_constraints = { range_a, range_b },
.aes128_constraints = {},
.sha256_constraints = {},
.sha256_compression = {},
.schnorr_constraints = {},
.ecdsa_k1_constraints = {},
Expand Down Expand Up @@ -243,6 +241,7 @@ TEST_F(AcirFormatTests, TestSchnorrVerifyPass)
.result = 76,
.signature = signature,
};

AcirFormat constraint_system{
.varnum = 81,
.recursive = false,
Expand All @@ -251,7 +250,6 @@ TEST_F(AcirFormatTests, TestSchnorrVerifyPass)
.logic_constraints = {},
.range_constraints = range_constraints,
.aes128_constraints = {},
.sha256_constraints = {},
.sha256_compression = {},
.schnorr_constraints = { schnorr_constraint },
.ecdsa_k1_constraints = {},
Expand Down Expand Up @@ -360,7 +358,6 @@ TEST_F(AcirFormatTests, TestSchnorrVerifySmallRange)
.logic_constraints = {},
.range_constraints = range_constraints,
.aes128_constraints = {},
.sha256_constraints = {},
.sha256_compression = {},
.schnorr_constraints = { schnorr_constraint },
.ecdsa_k1_constraints = {},
Expand Down Expand Up @@ -482,7 +479,6 @@ TEST_F(AcirFormatTests, TestVarKeccak)
.logic_constraints = {},
.range_constraints = { range_a, range_b, range_c, range_d },
.aes128_constraints = {},
.sha256_constraints = {},
.sha256_compression = {},
.schnorr_constraints = {},
.ecdsa_k1_constraints = {},
Expand Down Expand Up @@ -564,7 +560,6 @@ TEST_F(AcirFormatTests, TestKeccakPermutation)
.logic_constraints = {},
.range_constraints = {},
.aes128_constraints = {},
.sha256_constraints = {},
.sha256_compression = {},
.schnorr_constraints = {},
.ecdsa_k1_constraints = {},
Expand Down Expand Up @@ -598,11 +593,9 @@ TEST_F(AcirFormatTests, TestKeccakPermutation)
35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50 };

auto builder = create_circuit(constraint_system, /*size_hint=*/0, witness);

auto composer = Composer();
auto prover = composer.create_ultra_with_keccak_prover(builder);
auto proof = prover.construct_proof();

auto verifier = composer.create_ultra_with_keccak_verifier(builder);

EXPECT_EQ(verifier.verify_proof(proof), true);
Expand Down Expand Up @@ -643,7 +636,6 @@ TEST_F(AcirFormatTests, TestCollectsGateCounts)
.logic_constraints = {},
.range_constraints = {},
.aes128_constraints = {},
.sha256_constraints = {},
.sha256_compression = {},
.schnorr_constraints = {},
.ecdsa_k1_constraints = {},
Expand Down Expand Up @@ -676,4 +668,4 @@ TEST_F(AcirFormatTests, TestCollectsGateCounts)
create_circuit(constraint_system, /*size_hint*/ 0, witness, false, std::make_shared<bb::ECCOpQueue>(), true);

EXPECT_EQ(constraint_system.gates_per_opcode, std::vector<size_t>({ 2, 1 }));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ acir_format::AcirFormatOriginalOpcodeIndices create_empty_original_opcode_indice
.logic_constraints = {},
.range_constraints = {},
.aes128_constraints = {},
.sha256_constraints = {},
.sha256_compression = {},
.schnorr_constraints = {},
.ecdsa_k1_constraints = {},
Expand Down Expand Up @@ -46,9 +45,6 @@ void mock_opcode_indices(acir_format::AcirFormat& constraint_system)
for (size_t i = 0; i < constraint_system.aes128_constraints.size(); i++) {
constraint_system.original_opcode_indices.aes128_constraints.push_back(current_opcode++);
}
for (size_t i = 0; i < constraint_system.sha256_constraints.size(); i++) {
constraint_system.original_opcode_indices.sha256_constraints.push_back(current_opcode++);
}
for (size_t i = 0; i < constraint_system.sha256_compression.size(); i++) {
constraint_system.original_opcode_indices.sha256_compression.push_back(current_opcode++);
}
Expand Down Expand Up @@ -127,4 +123,4 @@ void mock_opcode_indices(acir_format::AcirFormat& constraint_system)
}

constraint_system.num_acir_opcodes = static_cast<uint32_t>(current_opcode);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -354,21 +354,6 @@ void handle_blackbox_func_call(Program::Opcode::BlackBoxFuncCall const& arg,
af.constrained_witness.insert(output);
}
af.original_opcode_indices.aes128_constraints.push_back(opcode_index);

} else if constexpr (std::is_same_v<T, Program::BlackBoxFuncCall::SHA256>) {
af.sha256_constraints.push_back(Sha256Constraint{
.inputs = map(arg.inputs,
[](auto& e) {
auto input_witness = get_witness_from_function_input(e);
return Sha256Input{
.witness = input_witness,
.num_bits = e.num_bits,
};
}),
.result = map(arg.outputs, [](auto& e) { return e.value; }),
});
af.original_opcode_indices.sha256_constraints.push_back(opcode_index);

} else if constexpr (std::is_same_v<T, Program::BlackBoxFuncCall::Sha256Compression>) {
af.sha256_compression.push_back(Sha256Compression{
.inputs = map(arg.inputs, [](auto& e) { return parse_input(e); }),
Expand Down Expand Up @@ -823,4 +808,4 @@ AcirProgramStack get_acir_program_stack(std::string const& bytecode_path,
return { constraint_systems, witness_stack };
}
#endif
} // namespace acir_format
} // namespace acir_format
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ TEST_F(BigIntTests, TestBigIntConstraintMultiple)
.logic_constraints = {},
.range_constraints = {},
.aes128_constraints = {},
.sha256_constraints = {},
.sha256_compression = {},
.schnorr_constraints = {},
.ecdsa_k1_constraints = {},
Expand Down Expand Up @@ -254,7 +253,6 @@ TEST_F(BigIntTests, TestBigIntConstraintSimple)
.logic_constraints = {},
.range_constraints = {},
.aes128_constraints = {},
.sha256_constraints = {},
.sha256_compression = {},
.schnorr_constraints = {},
.ecdsa_k1_constraints = {},
Expand Down Expand Up @@ -314,7 +312,6 @@ TEST_F(BigIntTests, TestBigIntConstraintReuse)
.logic_constraints = {},
.range_constraints = {},
.aes128_constraints = {},
.sha256_constraints = {},
.sha256_compression = {},
.schnorr_constraints = {},
.ecdsa_k1_constraints = {},
Expand Down Expand Up @@ -379,7 +376,6 @@ TEST_F(BigIntTests, TestBigIntConstraintReuse2)
.logic_constraints = {},
.range_constraints = {},
.aes128_constraints = {},
.sha256_constraints = {},
.sha256_compression = {},
.schnorr_constraints = {},
.ecdsa_k1_constraints = {},
Expand Down Expand Up @@ -465,7 +461,6 @@ TEST_F(BigIntTests, TestBigIntDIV)
.logic_constraints = {},
.range_constraints = {},
.aes128_constraints = {},
.sha256_constraints = {},
.sha256_compression = {},
.schnorr_constraints = {},
.ecdsa_k1_constraints = {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ TEST_F(UltraPlonkRAM, TestBlockConstraint)
.logic_constraints = {},
.range_constraints = {},
.aes128_constraints = {},
.sha256_constraints = {},
.sha256_compression = {},
.schnorr_constraints = {},
.ecdsa_k1_constraints = {},
Expand Down Expand Up @@ -200,7 +199,6 @@ TEST_F(MegaHonk, Databus)
.logic_constraints = {},
.range_constraints = {},
.aes128_constraints = {},
.sha256_constraints = {},
.sha256_compression = {},
.schnorr_constraints = {},
.ecdsa_k1_constraints = {},
Expand Down Expand Up @@ -309,7 +307,6 @@ TEST_F(MegaHonk, DatabusReturn)
.logic_constraints = {},
.range_constraints = {},
.aes128_constraints = {},
.sha256_constraints = {},
.sha256_compression = {},
.schnorr_constraints = {},
.ecdsa_k1_constraints = {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ TEST_F(EcOperations, TestECOperations)
.logic_constraints = {},
.range_constraints = {},
.aes128_constraints = {},
.sha256_constraints = {},
.sha256_compression = {},
.schnorr_constraints = {},
.ecdsa_k1_constraints = {},
Expand Down Expand Up @@ -207,7 +206,6 @@ TEST_F(EcOperations, TestECMultiScalarMul)
.logic_constraints = {},
.range_constraints = {},
.aes128_constraints = {},
.sha256_constraints = {},
.sha256_compression = {},
.schnorr_constraints = {},
.ecdsa_k1_constraints = {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ TEST_F(ECDSASecp256k1, TestECDSAConstraintSucceed)
.logic_constraints = {},
.range_constraints = {},
.aes128_constraints = {},
.sha256_constraints = {},
.sha256_compression = {},
.schnorr_constraints = {},
.ecdsa_k1_constraints = { ecdsa_k1_constraint },
Expand Down Expand Up @@ -157,7 +156,6 @@ TEST_F(ECDSASecp256k1, TestECDSACompilesForVerifier)
.logic_constraints = {},
.range_constraints = {},
.aes128_constraints = {},
.sha256_constraints = {},
.sha256_compression = {},
.schnorr_constraints = {},
.ecdsa_k1_constraints = { ecdsa_k1_constraint },
Expand Down Expand Up @@ -209,7 +207,6 @@ TEST_F(ECDSASecp256k1, TestECDSAConstraintFail)
.logic_constraints = {},
.range_constraints = {},
.aes128_constraints = {},
.sha256_constraints = {},
.sha256_compression = {},
.schnorr_constraints = {},
.ecdsa_k1_constraints = { ecdsa_k1_constraint },
Expand Down
Loading
Loading