Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
benesjan committed Mar 8, 2024
1 parent 7b620e5 commit 6e6cae7
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 5 deletions.
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,
}
}
}
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,
}
}
}

0 comments on commit 6e6cae7

Please sign in to comment.