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

Diverge link methods #346

Merged
merged 5 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
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
4 changes: 3 additions & 1 deletion sunscreen/src/linked.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,6 @@
//! encryption](crate::FheRuntime::encrypt), while also opting to _share_ a message with a linked
//! ZKP program. Under the hood, we'll handle the complicated bits of generating a linear relation
//! for SDLP and sharing the secrets with the [`zkp_program`](crate::zkp_program).
pub use sunscreen_runtime::{LinkedProof, LogProofBuilder, Sdlp};
pub use sunscreen_runtime::{
ExistingMessage, LinkWithZkp, LinkedMessage, LinkedProof, LogProofBuilder, Message, Sdlp,
};
2 changes: 1 addition & 1 deletion sunscreen/tests/linked.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ mod linked_tests {
.encrypt_and_link(&Signed::from(val), &public_key)
.unwrap();
// proves same plaintext within SDLP
let _ct_x1 = proof_builder.encrypt_linked(&x_msg, &public_key).unwrap();
let _ct_x1 = proof_builder.encrypt_again(&x_msg, &public_key).unwrap();
// proves same value within ZKP
let (_ct_y, y_msg) = proof_builder
.encrypt_symmetric_and_link(&Signed::from(val), &private_key)
Expand Down
8 changes: 4 additions & 4 deletions sunscreen/tests/sdlp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
mod sdlp_tests {
use lazy_static::lazy_static;
use logproof::rings::SealQ128_1024;
use sunscreen::types::bfv::{Signed, Unsigned64};
use sunscreen::types::bfv::{Fractional, Signed, Unsigned64};
use sunscreen_fhe_program::SchemeType;

use sunscreen_runtime::{FheRuntime, LogProofBuilder, Params};
Expand Down Expand Up @@ -52,13 +52,13 @@ mod sdlp_tests {
let mut logproof_builder = LogProofBuilder::new(&rt);

let (_a1, linked_a) = logproof_builder
.encrypt_and_link(&Signed::from(2), &public_key)
.encrypt_and_share(&Fractional::<64>::from(3.23), &public_key)
.unwrap();
let _a2 = logproof_builder
.encrypt_symmetric_linked(&linked_a, &private_key)
.encrypt_symmetric_again(&linked_a, &private_key)
.unwrap();
let _other = logproof_builder
.encrypt(&Signed::from(3), &public_key)
.encrypt(&Signed::from(2), &public_key)
.unwrap();
let sdlp = logproof_builder.build_logproof().unwrap();
sdlp.verify().unwrap();
Expand Down
Loading
Loading