-
Notifications
You must be signed in to change notification settings - Fork 48
Added SEAL library and FHE mode #41
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
Open
Northrim
wants to merge
27
commits into
master
Choose a base branch
from
fhe
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
8f15540
Added SEAL library and FHE mode
Northrim 83f34b2
Made changes suggested by Alex
Northrim e7cc59d
Made new fhe folder in src/target
Northrim f644be0
Implemented the generation of the code for initializing SEAL paramete…
Northrim cfc2235
fhe and, or, xor test cases
Northrim ea4b7ed
Added Map operation to IR
Northrim 3c59444
Map Operation changed indices to bitvectors
Northrim 1cb736f
Merged with main
Northrim 0404c6e
Implemented typechecking for Map IR
Northrim 248d746
Updated backend to support SEAL interpreter
Northrim a66a508
Fixed Merge Conflicts
Northrim eb79606
Removed extraneous code
Northrim 3c3f203
Fixed linting issue
Northrim 2159c20
Added building/testing for FHE backend
Northrim cb53d1a
Deleted extraneous content. Fixed a bug
Northrim d30b3d4
Changed build script and ci.yml
Northrim f127d5d
changed ci.yml
Northrim 308bcbc
changed ci.yml again
Northrim 5b1ac71
changed ci.yml again again
Northrim d55e5a5
fixed bug in driver
Northrim fdb91e7
fixed test inputs
Northrim 277c2c0
Merge branch 'master' into fhe
edwjchen afd8bf2
Added support for addition, multiplication, and simple vectorized ope…
Northrim cdc2ea8
Merge branch 'fhe' of wys.github.com:circify/circ into fhe
Northrim 6c590db
Fixed linting issue
Northrim 94b65fd
Cleaned up directory, changed test names
Northrim 18b4112
Added test case generation for testing batched vs naive
Northrim 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
Northrim marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "cmake.configureOnOpen": false | ||
| } | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| int main(__attribute__((private(0))) int a, __attribute__((private(1))) int b) { | ||
| return a + b; | ||
| } |
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,3 @@ | ||
| int main(__attribute__((private(0))) int a, __attribute__((private(1))) int b) { | ||
| return a * b; | ||
| } |
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,3 @@ | ||
| int main(__attribute__((private(0))) int a, __attribute__((private(1))) int b, __attribute__((public)) int v) { | ||
| return a * b + v; | ||
| } |
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,5 @@ | ||
| #include <stdbool.h> | ||
|
|
||
| bool main(__attribute__((private(0))) bool a, __attribute__((private(1))) bool b) { | ||
| return a && b; | ||
| } |
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,5 @@ | ||
| #include <stdbool.h> | ||
|
|
||
| bool main(__attribute__((private(0))) bool a, __attribute__((private(1))) bool b) { | ||
| return a == b; | ||
| } |
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,5 @@ | ||
| #include <stdbool.h> | ||
|
|
||
| bool main(__attribute__((private(0))) bool a, __attribute__((private(1))) bool b) { | ||
| return a || b; | ||
| } |
3 changes: 3 additions & 0 deletions
3
examples/C/fhe/unit_tests/nary_arithmetic_tests/nary_arithmetic_add.c
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,3 @@ | ||
| int main(__attribute__((private(0))) int a, __attribute__((private(1))) int b, __attribute__((private(1))) int c) { | ||
| return a + b + c; | ||
| } |
5 changes: 5 additions & 0 deletions
5
examples/C/fhe/unit_tests/nary_boolean_tests/nary_boolean_and.c
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,5 @@ | ||
| #include <stdbool.h> | ||
|
|
||
| bool main(__attribute__((private(0))) bool a, __attribute__((private(1))) bool b, __attribute__((private(1))) bool c) { | ||
| return a && b && c; | ||
| } |
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,2 @@ | ||
| def main(private u32 a, private u32 b) -> u32: | ||
| return a + b |
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,2 @@ | ||
| def main(private u32 a, private u32 b) -> u32: | ||
| return a * b |
3 changes: 3 additions & 0 deletions
3
examples/ZoKrates/fhe/unit_tests/arithmetic_tests/mult_add_pub.zok
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,3 @@ | ||
|
|
||
| def main(private u32 a, private u32 b, public u32 v) -> u32: | ||
| return a * b + v |
2 changes: 2 additions & 0 deletions
2
examples/ZoKrates/fhe/unit_tests/boolean_tests/boolean_and.zok
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,2 @@ | ||
| def main(private bool a, private bool b) -> bool: | ||
| return a && b |
2 changes: 2 additions & 0 deletions
2
examples/ZoKrates/fhe/unit_tests/boolean_tests/boolean_equals.zok
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,2 @@ | ||
| def main(private bool a, private bool b) -> bool: | ||
| return a == b |
2 changes: 2 additions & 0 deletions
2
examples/ZoKrates/fhe/unit_tests/boolean_tests/boolean_or.zok
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,2 @@ | ||
| def main(private bool a, private bool b) -> bool: | ||
| return a || b |
2 changes: 2 additions & 0 deletions
2
examples/ZoKrates/fhe/unit_tests/nary_arithmetic_tests/nary_arithmetic_add.zok
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,2 @@ | ||
| def main(private u32 a, private u32 b, private u32 c) -> u32: | ||
| return a + b + c |
2 changes: 2 additions & 0 deletions
2
examples/ZoKrates/fhe/unit_tests/nary_boolean_tests/nary_boolean_and.zok
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,2 @@ | ||
| def main(private bool a, private bool b, private bool c) -> bool: | ||
| return a && b && c |
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,40 @@ | ||
| #!/usr/bin/env zsh | ||
|
|
||
| set -ex | ||
|
|
||
| disable -r time | ||
|
|
||
| # cargo build --release --features c --example circ | ||
|
|
||
| BIN=./target/release/examples/circ | ||
| export CARGO_MANIFEST_DIR=$(pwd) | ||
|
|
||
| case "$OSTYPE" in | ||
| darwin*) | ||
| alias measure_time="gtime --format='%e seconds %M kB'" | ||
| ;; | ||
| linux*) | ||
| alias measure_time="time --format='%e seconds %M kB'" | ||
| ;; | ||
| esac | ||
|
|
||
| function fhe_test { | ||
| cpath=$1 | ||
| RUST_BACKTRACE=1 measure_time $BIN $cpath fhe | ||
| } | ||
|
|
||
| # build boolean tests | ||
| fhe_test ./examples/C/fhe/unit_tests/boolean_tests/boolean_and.c | ||
| fhe_test ./examples/C/fhe/unit_tests/boolean_tests/boolean_or.c | ||
| fhe_test ./examples/C/fhe/unit_tests/boolean_tests/boolean_equals.c | ||
|
|
||
| # build nary boolean tests | ||
| fhe_test ./examples/C/fhe/unit_tests/nary_boolean_tests/nary_boolean_and.c | ||
|
|
||
| # build arithmetic tests | ||
| fhe_test ./examples/C/fhe/unit_tests/arithmetic_tests/add.c | ||
| fhe_test ./examples/C/fhe/unit_tests/arithmetic_tests/mult.c | ||
| fhe_test ./examples/C/fhe/unit_tests/arithmetic_tests/mult_add_pub.c | ||
|
|
||
| # build nary arithmetic tests | ||
| fhe_test ./examples/C/fhe/unit_tests/nary_arithmetic_tests/nary_arithmetic_add.c |
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.