Skip to content

Commit

Permalink
fix(cli): fix naming
Browse files Browse the repository at this point in the history
  • Loading branch information
vivianjeng committed Oct 25, 2024
1 parent af5e4a8 commit 59b3b2b
Show file tree
Hide file tree
Showing 16 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion cli/src/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ fn circom_build_template(file_path: &str) -> Result<(), Box<dyn Error>> {

fn halo2_dependencies_template(file_path: &str) -> Result<(), Box<dyn Error>> {
let replacement =
"halo2-fibonacci = { git = \"https://github.com/ElusAegis/halo2-fibonacci-sample.git\" }";
"plonk-fibonacci = { package = \"plonk-fibonacci\", git = \"https://github.com/sifnoc/plonkish-fibonacci-sample.git\" }";
let target = "# HALO2_DEPENDENCIES";
replace_string_in_file(file_path, target, replacement)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ fun FibonacciComponent() {
)
}

val srsPath = getFilePathFromAssets("fibonacci_srs.bin")
val provingKeyPath = getFilePathFromAssets("fibonacci_pk.bin")
val verifyingKeyPath = getFilePathFromAssets("fibonacci_vk.bin")
val srsPath = getFilePathFromAssets("plonk_fibonacci_srs.bin")
val provingKeyPath = getFilePathFromAssets("plonk_fibonacci_pk.bin")
val verifyingKeyPath = getFilePathFromAssets("plonk_fibonacci_vk.bin")


val inputs = mutableMapOf<String, List<String>>()
Expand Down
2 changes: 1 addition & 1 deletion cli/src/template/halo2/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
// Module containing the Halo2 circuit logic (FibonacciMoproCircuit)

mopro_ffi::set_halo2_circuits! {
("fibonacci_pk.bin", halo2_fibonacci::prove, "fibonacci_vk.bin", halo2_fibonacci::verify),
("plonk_fibonacci_pk.bin", plonk_fibonacci::prove, "plonk_fibonacci_vk.bin", plonk_fibonacci::verify),
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
24 changes: 12 additions & 12 deletions cli/src/template/ios/MoproApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

/* Begin PBXBuildFile section */
2A59922F2CC7750200135402 /* multiplier2_final.zkey in Resources */ = {isa = PBXBuildFile; fileRef = 2A59922E2CC7750200135402 /* multiplier2_final.zkey */; };
2A5992332CC7750C00135402 /* fibonacci_vk.bin in Resources */ = {isa = PBXBuildFile; fileRef = 2A5992322CC7750C00135402 /* fibonacci_vk.bin */; };
2A5992342CC7750C00135402 /* fibonacci_srs.bin in Resources */ = {isa = PBXBuildFile; fileRef = 2A5992312CC7750C00135402 /* fibonacci_srs.bin */; };
2A5992352CC7750C00135402 /* fibonacci_pk.bin in Resources */ = {isa = PBXBuildFile; fileRef = 2A5992302CC7750C00135402 /* fibonacci_pk.bin */; };
2A5992332CC7750C00135402 /* plonk_fibonacci_vk.bin in Resources */ = {isa = PBXBuildFile; fileRef = 2A5992322CC7750C00135402 /* plonk_fibonacci_vk.bin */; };
2A5992342CC7750C00135402 /* plonk_fibonacci_srs.bin in Resources */ = {isa = PBXBuildFile; fileRef = 2A5992312CC7750C00135402 /* plonk_fibonacci_srs.bin */; };
2A5992352CC7750C00135402 /* plonk_fibonacci_pk.bin in Resources */ = {isa = PBXBuildFile; fileRef = 2A5992302CC7750C00135402 /* plonk_fibonacci_pk.bin */; };
2A5992392CC77A7E00135402 /* MoproBindings.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2A5992372CC77A7E00135402 /* MoproBindings.xcframework */; };
2A59923A2CC77A7E00135402 /* mopro.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A5992362CC77A7E00135402 /* mopro.swift */; };
/* End PBXBuildFile section */
Expand All @@ -37,9 +37,9 @@
2A5991FC2CC7722A00135402 /* MoproAppTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MoproAppTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
2A5992062CC7722A00135402 /* MoproAppUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MoproAppUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
2A59922E2CC7750200135402 /* multiplier2_final.zkey */ = {isa = PBXFileReference; lastKnownFileType = file; path = multiplier2_final.zkey; sourceTree = "<group>"; };
2A5992302CC7750C00135402 /* fibonacci_pk.bin */ = {isa = PBXFileReference; lastKnownFileType = archive.macbinary; path = fibonacci_pk.bin; sourceTree = "<group>"; };
2A5992312CC7750C00135402 /* fibonacci_srs.bin */ = {isa = PBXFileReference; lastKnownFileType = archive.macbinary; path = fibonacci_srs.bin; sourceTree = "<group>"; };
2A5992322CC7750C00135402 /* fibonacci_vk.bin */ = {isa = PBXFileReference; lastKnownFileType = archive.macbinary; path = fibonacci_vk.bin; sourceTree = "<group>"; };
2A5992302CC7750C00135402 /* plonk_fibonacci_pk.bin */ = {isa = PBXFileReference; lastKnownFileType = archive.macbinary; path = plonk_fibonacci_pk.bin; sourceTree = "<group>"; };
2A5992312CC7750C00135402 /* plonk_fibonacci_srs.bin */ = {isa = PBXFileReference; lastKnownFileType = archive.macbinary; path = plonk_fibonacci_srs.bin; sourceTree = "<group>"; };
2A5992322CC7750C00135402 /* plonk_fibonacci_vk.bin */ = {isa = PBXFileReference; lastKnownFileType = archive.macbinary; path = plonk_fibonacci_vk.bin; sourceTree = "<group>"; };
2A5992362CC77A7E00135402 /* mopro.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = mopro.swift; sourceTree = "<group>"; };
2A5992372CC77A7E00135402 /* MoproBindings.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = MoproBindings.xcframework; sourceTree = "<group>"; };
/* End PBXFileReference section */
Expand Down Expand Up @@ -97,9 +97,9 @@
2A5991ED2CC7722900135402 /* Products */,
2A5992382CC77A7E00135402 /* MoproiOSBindings */,
2A59922E2CC7750200135402 /* multiplier2_final.zkey */,
2A5992302CC7750C00135402 /* fibonacci_pk.bin */,
2A5992312CC7750C00135402 /* fibonacci_srs.bin */,
2A5992322CC7750C00135402 /* fibonacci_vk.bin */,
2A5992302CC7750C00135402 /* plonk_fibonacci_pk.bin */,
2A5992312CC7750C00135402 /* plonk_fibonacci_srs.bin */,
2A5992322CC7750C00135402 /* plonk_fibonacci_vk.bin */,
);
sourceTree = "<group>";
};
Expand Down Expand Up @@ -242,9 +242,9 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
2A5992332CC7750C00135402 /* fibonacci_vk.bin in Resources */,
2A5992342CC7750C00135402 /* fibonacci_srs.bin in Resources */,
2A5992352CC7750C00135402 /* fibonacci_pk.bin in Resources */,
2A5992332CC7750C00135402 /* plonk_fibonacci_vk.bin in Resources */,
2A5992342CC7750C00135402 /* plonk_fibonacci_srs.bin in Resources */,
2A5992352CC7750C00135402 /* plonk_fibonacci_pk.bin in Resources */,
2A59922F2CC7750200135402 /* multiplier2_final.zkey in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
6 changes: 3 additions & 3 deletions cli/src/template/ios/MoproApp/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ struct ContentView: View {
@State private var generatedHalo2Proof: Data?
@State private var halo2PublicInputs: Data?
private let zkeyPath = Bundle.main.path(forResource: "multiplier2_final", ofType: "zkey")!
private let srsPath = Bundle.main.path(forResource: "fibonacci_srs.bin", ofType: "")!
private let vkPath = Bundle.main.path(forResource: "fibonacci_vk.bin", ofType: "")!
private let pkPath = Bundle.main.path(forResource: "fibonacci_pk.bin", ofType: "")!
private let srsPath = Bundle.main.path(forResource: "plonk_fibonacci_srs.bin", ofType: "")!
private let vkPath = Bundle.main.path(forResource: "plonk_fibonacci_vk.bin", ofType: "")!
private let pkPath = Bundle.main.path(forResource: "plonk_fibonacci_pk.bin", ofType: "")!

var body: some View {
VStack(spacing: 10) {
Expand Down
6 changes: 3 additions & 3 deletions docs/docs/adapters/halo2.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ For example:

```rust
mopro_ffi::set_halo2_circuits! {
("fibonacci_pk.bin", halo2_fibonacci::prove, "fibonacci_vk.bin", halo2_fibonacci::verify),
("plonk_fibonacci_pk.bin", plonk_fibonacci::prove, "plonk_fibonacci_vk.bin", plonk_fibonacci::verify),
}
```

Expand All @@ -80,14 +80,14 @@ For example:
```rust
fn get_halo2_proving_circuit(circuit: &str) -> Result<Halo2ProveFn, MoproError> {
match circuit {
"fibonacci_pk.bin" => Ok(halo2_fibonacci::prove),
"plonk_fibonacci_pk.bin" => Ok(plonk_fibonacci::prove),
_ => Err(MoproError::CircuitNotFound),
}
}

fn get_halo2_verifying_circuit(circuit: &str) -> Result<Halo2VerifyFn, MoproError> {
match circuit {
"fibonacci_vk.bin" => Ok(halo2_fibonacci::verify),
"plonk_fibonacci_vk.bin" => Ok(plonk_fibonacci::verify),
_ => Err(MoproError::CircuitNotFound),
}
}
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/adapters/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ mopro_ffi::set_circom_circuits! {

// Halo2 adapter
mopro_ffi::set_halo2_circuits! {
("fibonacci_pk.bin", halo2_fibonacci::prove, "fibonacci_vk.bin", halo2_fibonacci::verify),
("plonk_fibonacci_pk.bin", plonk_fibonacci::prove, "plonk_fibonacci_vk.bin", plonk_fibonacci::verify),
}
```

Expand Down
6 changes: 3 additions & 3 deletions docs/versioned_docs/version-0.1.0/adapters/halo2.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ For example:

```rust
mopro_ffi::set_halo2_circuits! {
("fibonacci_pk.bin", halo2_fibonacci::prove, "fibonacci_vk.bin", halo2_fibonacci::verify),
("plonk_fibonacci_pk.bin", plonk_fibonacci::prove, "plonk_fibonacci_vk.bin", plonk_fibonacci::verify),
}
```

Expand All @@ -80,14 +80,14 @@ For example:
```rust
fn get_halo2_proving_circuit(circuit: &str) -> Result<Halo2ProveFn, MoproError> {
match circuit {
"fibonacci_pk.bin" => Ok(halo2_fibonacci::prove),
"plonk_fibonacci_pk.bin" => Ok(plonk_fibonacci::prove),
_ => Err(MoproError::CircuitNotFound),
}
}

fn get_halo2_verifying_circuit(circuit: &str) -> Result<Halo2VerifyFn, MoproError> {
match circuit {
"fibonacci_vk.bin" => Ok(halo2_fibonacci::verify),
"fibonacci_vk.bin" => Ok(plonk_fibonacci::verify),
_ => Err(MoproError::CircuitNotFound),
}
}
Expand Down
2 changes: 1 addition & 1 deletion docs/versioned_docs/version-0.1.0/adapters/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ mopro_ffi::set_circom_circuits! {

// Halo2 adapter
mopro_ffi::set_halo2_circuits! {
("fibonacci_pk.bin", halo2_fibonacci::prove, "fibonacci_vk.bin", halo2_fibonacci::verify),
("plonk_fibonacci_pk.bin", plonk_fibonacci::prove, "plonk_fibonacci_vk.bin", plonk_fibonacci::verify),
}
```

Expand Down
4 changes: 2 additions & 2 deletions mopro-ffi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,10 @@ pub struct ProofCalldata {
/// use crate::halo2::FibonacciMoproCircuit;
///
/// // Add `Fibonacci` circuit to generate proofs
/// mopro_ffi::set_halo2_proving_circuits!("fibonacci_pk.bin", FibonacciMoproCircuit::prove);
/// mopro_ffi::set_halo2_proving_circuits!("plonk_fibonacci_pk.bin", FibonacciMoproCircuit::prove);
///
/// // Add `Fibonacci` circuit to verify proofs
// mopro_ffi::set_halo2_verifying_circuits!("fibonacci_vk.bin", FibonacciMoproCircuit::verify);
// mopro_ffi::set_halo2_verifying_circuits!("plonk_fibonacci_vk.bin", FibonacciMoproCircuit::verify);
///
///
#[macro_export]
Expand Down

0 comments on commit 59b3b2b

Please sign in to comment.