-
Notifications
You must be signed in to change notification settings - Fork 22
feat: add sk_share and e_sm_share #1290
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
4302400
feat: add sk_share and e_sm_share
ctrlc03 7024443
chore: update unit struct to have dkg_input_type
ctrlc03 0935e6d
chore: cleanup and tests
ctrlc03 985486b
chore: simplify
ctrlc03 f4aafca
chore: remove comment
ctrlc03 44ae82f
chore: typo
ctrlc03 dcf38fb
feat: add share encryption circuits
ctrlc03 8a23d8c
chore: ensure tests run
ctrlc03 d2570cd
chore: resolve conflicts
ctrlc03 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -107,6 +107,7 @@ impl ShareEncryptionCircuitData { | |
| u_rns, | ||
| e0_rns, | ||
| e1_rns, | ||
| dkg_input_type, | ||
| }) | ||
| } | ||
| } | ||
|
|
||
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -5,3 +5,5 @@ | |
| // or FITNESS FOR A PARTICULAR PURPOSE | ||
|
|
||
| mod pk; | ||
| mod share_computation; | ||
| mod share_encryption; | ||
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| // SPDX-License-Identifier: LGPL-3.0-only | ||
| // | ||
| // This file is provided WITHOUT ANY WARRANTY; | ||
| // without even the implied warranty of MERCHANTABILITY | ||
| // or FITNESS FOR A PARTICULAR PURPOSE | ||
|
|
||
| use crate::traits::Provable; | ||
| use e3_events::CircuitName; | ||
| use e3_fhe_params::BfvPreset; | ||
| use e3_zk_helpers::computation::DkgInputType; | ||
| use e3_zk_helpers::dkg::share_computation::{ | ||
| Inputs, ShareComputationCircuit, ShareComputationCircuitData, | ||
| }; | ||
| use noirc_abi::InputMap; | ||
|
|
||
| impl Provable for ShareComputationCircuit { | ||
| type Params = BfvPreset; | ||
| type Input = ShareComputationCircuitData; | ||
| type Inputs = Inputs; | ||
|
|
||
| fn resolve_circuit_name(&self, _input: &Self::Input) -> CircuitName { | ||
| match _input.dkg_input_type { | ||
| DkgInputType::SecretKey => CircuitName::SkShareComputation, | ||
| DkgInputType::SmudgingNoise => CircuitName::ESmShareComputation, | ||
| } | ||
| } | ||
|
|
||
| fn valid_circuits(&self) -> Vec<CircuitName> { | ||
| vec![ | ||
| CircuitName::SkShareComputation, | ||
| CircuitName::ESmShareComputation, | ||
| ] | ||
| } | ||
|
|
||
| fn circuit(&self) -> CircuitName { | ||
| CircuitName::SkShareComputation | ||
| } | ||
| } |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| // SPDX-License-Identifier: LGPL-3.0-only | ||
| // | ||
| // This file is provided WITHOUT ANY WARRANTY; | ||
| // without even the implied warranty of MERCHANTABILITY | ||
| // or FITNESS FOR A PARTICULAR PURPOSE | ||
|
|
||
| use crate::traits::Provable; | ||
| use e3_events::CircuitName; | ||
| use e3_fhe_params::BfvPreset; | ||
| use e3_zk_helpers::computation::DkgInputType; | ||
| use e3_zk_helpers::dkg::share_encryption::{ | ||
| Inputs, ShareEncryptionCircuit, ShareEncryptionCircuitData, | ||
| }; | ||
|
|
||
| impl Provable for ShareEncryptionCircuit { | ||
| type Params = BfvPreset; | ||
| type Input = ShareEncryptionCircuitData; | ||
| type Inputs = Inputs; | ||
|
|
||
| fn resolve_circuit_name(&self, _input: &Self::Input) -> CircuitName { | ||
| match _input.dkg_input_type { | ||
| DkgInputType::SecretKey => CircuitName::SkShareEncryption, | ||
| DkgInputType::SmudgingNoise => CircuitName::ESmShareEncryption, | ||
| } | ||
| } | ||
|
|
||
| fn valid_circuits(&self) -> Vec<CircuitName> { | ||
| vec![ | ||
| CircuitName::SkShareEncryption, | ||
| CircuitName::ESmShareEncryption, | ||
| ] | ||
| } | ||
|
|
||
| fn circuit(&self) -> CircuitName { | ||
| CircuitName::SkShareEncryption | ||
| } | ||
| } |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.