Skip to content

Commit

Permalink
Change whitelist -> allowlist
Browse files Browse the repository at this point in the history
  • Loading branch information
samtay committed Jul 18, 2023
1 parent 50eb091 commit 73c5f3b
Show file tree
Hide file tree
Showing 12 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ jobs:
# Build and run the tests
- name: Build and run tests
run: cargo test --workspace --verbose --release
- name: Verify examples outside of workspace (whitelist_zkp)
- name: Verify examples outside of workspace (allowlist_zkp)
run: cargo test --workspace --verbose
working-directory: ./examples/whitelist_zkp
working-directory: ./examples/allowlist_zkp
- name: Build sunscreen and bincode
run: cargo build --release --package sunscreen --package bincode
- name: Build mdBook
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ members = [
"sunscreen_compiler_common",
"sunscreen_zkp_backend",
]
exclude = ["mdBook", "rust-playground", "examples/whitelist_zkp"]
exclude = ["mdBook", "rust-playground", "examples/allowlist_zkp"]

[profile.release]
split-debuginfo = "packed"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# whitelist
# allowlist

This example shows a possible project layout using cargo workspaces. The
`prover` and `verifier` are separate crates and refer to the common `zkp` crate
Expand All @@ -9,8 +9,8 @@ communicate by sending the serialized proof over a network call. However, we can
demonstrate a similar scenario by having them communicate as separate processes,
piping a serialized proof from `prover` stdout to `verifier` stdin.

In this whitelist zkp, the verifier verifies that the prover has an entry on its
public whitelist, without revealing which entry. The whitelist is hardcoded to
In this allowlist zkp, the verifier verifies that the prover has an entry on its
public allowlist, without revealing which entry. The allowlist is hardcoded to
the numbers 100 to 199 inclusive.

```shell
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ use sunscreen::{
bulletproofs::BulletproofsBackend, types::zkp::BulletproofsField, ZkpProgramFnExt,
};

use zkp::{default_list, whitelist};
use zkp::{default_list, allowlist};

fn main() -> Result<()> {
let prog = whitelist.compile::<BulletproofsBackend>()?;
let runtime = whitelist.runtime::<BulletproofsBackend>()?;
let prog = allowlist.compile::<BulletproofsBackend>()?;
let runtime = allowlist.runtime::<BulletproofsBackend>()?;

let entry: BulletproofsField = get_first_arg()?.unwrap_or(101).into();
let list: [BulletproofsField; 100] = default_list();
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ use sunscreen::{
bulletproofs::BulletproofsBackend, types::zkp::BulletproofsField, Proof, ZkpProgramFnExt,
};

use zkp::{default_list, whitelist};
use zkp::{default_list, allowlist};

fn main() -> Result<()> {
let prog = whitelist.compile::<BulletproofsBackend>()?;
let runtime = whitelist.runtime::<BulletproofsBackend>()?;
let prog = allowlist.compile::<BulletproofsBackend>()?;
let runtime = allowlist.runtime::<BulletproofsBackend>()?;

let proof: Proof = bincode::deserialize_from(io::stdin())?;

Expand All @@ -31,8 +31,8 @@ mod tests {

#[test]
fn main_works() -> Result<()> {
let prog = whitelist.compile::<BulletproofsBackend>()?;
let runtime = whitelist.runtime::<BulletproofsBackend>()?;
let prog = allowlist.compile::<BulletproofsBackend>()?;
let runtime = allowlist.runtime::<BulletproofsBackend>()?;

let entry: BulletproofsField = 101.into();
let list: [BulletproofsField; 100] = default_list();
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use sunscreen::{types::zkp::Field, zkp_program, zkp_var, FieldSpec};

/// A ZKP proving a private entry is equal to one of the values in a list.
#[zkp_program]
pub fn whitelist<F: FieldSpec>(entry: Field<F>, #[public] list: [Field<F>; 100]) {
pub fn allowlist<F: FieldSpec>(entry: Field<F>, #[public] list: [Field<F>; 100]) {
let zero = zkp_var!(0);
let one = zkp_var!(1);
let mut poly = one;
Expand Down

0 comments on commit 73c5f3b

Please sign in to comment.