-
Notifications
You must be signed in to change notification settings - Fork 236
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
41 additions
and
5 deletions.
There are no files selected for viewing
19 changes: 15 additions & 4 deletions
19
noir-projects/noir-protocol-circuits/crates/parity-lib/src/base/base_parity_inputs.nr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,24 @@ | ||
use dep::parity_lib::ParityPublicInputs; | ||
use crate::parity_public_inputs::ParityPublicInputs; | ||
use dep::types::{ | ||
constants::NUM_FIELDS_PER_SHA256, | ||
mocked::AggregationObject, | ||
}; | ||
|
||
global NUM_MSGS_PER_BASE_PARITY: Field = 2; | ||
global NUM_MSGS_PER_BASE_PARITY: Field = 4; | ||
|
||
struct BaseParityInputs { | ||
msgs: [Field; NUM_MSGS_PER_BASE_PARITY], | ||
msgs: [[Field; NUM_FIELDS_PER_SHA256]; NUM_MSGS_PER_BASE_PARITY], | ||
} | ||
|
||
impl BaseParityInputs { | ||
pub fn base_parity_circuit(self) -> ParityPublicInputs { | ||
|
||
// sha_root = MERKLE_TREE(inputs.msgs, SHA256); | ||
// converted_root = MERKLE_TREE(inputs.msgs, SNARK_FRIENDLY_HASH_FUNCTION); | ||
// return ParityPublicInputs(sha_root, converted_root) | ||
ParityPublicInputs { | ||
aggregation_object: AggregationObject {}, | ||
sha_root: [0, 0], | ||
converted_root: 0, | ||
} | ||
} | ||
} |
27 changes: 26 additions & 1 deletion
27
noir-projects/noir-protocol-circuits/crates/parity-lib/src/root/root_parity_inputs.nr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,30 @@ | ||
use crate::root::root_parity_input::RootParityInput; | ||
use dep::types::mocked::AggregationObject; | ||
use crate::{ | ||
parity_public_inputs::ParityPublicInputs, | ||
root::root_parity_input::RootParityInput, | ||
}; | ||
|
||
struct RootParityInputs { | ||
children: [RootParityInput; 2], | ||
} | ||
|
||
impl RootParityInputs { | ||
pub fn root_parity_circuit(self) -> ParityPublicInputs { | ||
// for msg in inputs.children: | ||
// assert msg.proof.verify(msg.public_inputs); | ||
|
||
// sha_root = MERKLE_TREE( | ||
// [msg.public_inputs.sha_root for msg in inputs.children], | ||
// SHA256 | ||
// ); | ||
// converted_root = MERKLE_TREE( | ||
// [msg.public_inputs.converted_root for msg in inputs.children], | ||
// SNARK_FRIENDLY_HASH_FUNCTION | ||
// ); | ||
ParityPublicInputs { | ||
aggregation_object: AggregationObject {}, | ||
sha_root: [0, 0], | ||
converted_root: 0, | ||
} | ||
} | ||
} |