-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add secret and evaluation key serialization #23
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 1 commit
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
6d334b4
feat: add secret and evaluation key serialization
cedoor 9a1a7ae
feat: add Params::test aligned with Poulpy bdd_arithmetic test_suite
cedoor 228259a
test: adjust integration tests and add serialize_keys example
cedoor 8df0ba4
docs: drop test-fixture framing from serialize_keys example
cedoor 0079527
style: format code with rustfmt
cedoor 073e1ff
feat(keys): seeds, lattice-only SK, and EvaluationKey blob API
cedoor 12eee75
feat: add versioned ciphertext serialize/deserialize
cedoor a315de7
style: format code with rustfmt
cedoor ca4d552
chore(deps): bump poulpy and adapt to prepare-path regression
cedoor f1ceace
style: format code with rustfmt
cedoor b4e8486
fix: wire Poulpy AVX feature for x86_64 CI and portable all-features
cedoor 06082fb
fix(ciphertext): embed GLWE layout in serialized blobs
cedoor 35a53a3
fix(security): redact KeygenSeeds in Debug output
cedoor 8d71cc2
style: format code with rustfmt
cedoor 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
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| use squid::{Context, Params}; | ||
|
|
||
| #[test] | ||
| fn secret_and_evaluation_keys_roundtrip_through_blob_format() { | ||
| let params = Params::unsecure(); | ||
| let mut ctx = Context::new(params); | ||
| let (sk, ek) = ctx.keygen(); | ||
|
|
||
| let sk_blob = ctx.serialize_secret_key(&sk).expect("serialize sk"); | ||
| let ek_blob = ctx.serialize_evaluation_key(&ek).expect("serialize ek"); | ||
|
|
||
| let sk2 = ctx | ||
| .deserialize_secret_key(&sk_blob) | ||
| .expect("deserialize sk"); | ||
| let ek2 = ctx | ||
| .deserialize_evaluation_key(&ek_blob) | ||
| .expect("deserialize ek"); | ||
|
|
||
| let a = ctx.encrypt::<u32>(11, &sk2); | ||
| let b = ctx.encrypt::<u32>(22, &sk2); | ||
| let c = ctx.add(&a, &b, &ek2); | ||
| assert_eq!(ctx.decrypt(&c, &sk2), 33); | ||
| } |
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.