Skip to content

Commit 01098f0

Browse files
committed
feat: vk binary in fibonacci proof generator
1 parent 74a246e commit 01098f0

File tree

7 files changed

+19
-5
lines changed

7 files changed

+19
-5
lines changed

scripts/test_files/sp1/fibonacci_proof_generator/script/Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/test_files/sp1/fibonacci_proof_generator/script/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ edition = "2021"
66

77
[dependencies]
88
sp1-sdk = { git = "https://github.com/succinctlabs/sp1.git", rev = "v5.0.0" }
9+
bincode = "1.3.3"
910

1011
[build-dependencies]
1112
sp1-helper = { git = "https://github.com/succinctlabs/sp1.git", rev = "v5.0.0" }

scripts/test_files/sp1/fibonacci_proof_generator/script/src/main.rs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,23 @@ fn main() {
3939
let proof_file_path = format!("../../sp1_fibonacci_{}.proof", SP1_VERSION);
4040
proof.save(proof_file_path).expect("saving proof failed");
4141

42-
std::fs::write(format!("../../sp1_fibonacci_{}.pub", SP1_VERSION), proof.public_values)
43-
.expect("failed to save public inputs");
42+
std::fs::write(
43+
format!("../../sp1_fibonacci_{}.pub", SP1_VERSION),
44+
proof.public_values,
45+
)
46+
.expect("failed to save public inputs");
4447

45-
std::fs::write(format!("../../sp1_fibonacci_{}.vk", SP1_VERSION), vk.hash_bytes())
46-
.expect("failed to save vk hash");
48+
std::fs::write(
49+
format!("../../sp1_fibonacci_{}.vk", SP1_VERSION),
50+
vk.hash_bytes(),
51+
)
52+
.expect("failed to save vk hash");
53+
54+
std::fs::write(
55+
format!("../../sp1_fibonacci_{}_vk.bin", SP1_VERSION),
56+
bincode::serialize(&vk).unwrap()
57+
)
58+
.expect("failed to save vk hash");
4759

4860
let elf_file_path = format!("../../sp1_fibonacci_{}.elf", SP1_VERSION);
4961
let mut file = std::fs::File::create(elf_file_path).unwrap();
2.45 KB
Binary file not shown.
0 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
\:ܬ�:D�8=[a��-�]�u,�(
1+
g�~�V�EU�'�S�&J��Y�iA�[ +j�
234 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)