2 个版本
0.1.1 | 2024年7月2日 |
---|---|
0.1.0 | 2024年5月17日 |
#2023 在 解析器实现
每月 76 次下载
用于 rln
28KB
243 行
ark-zkey
通过序列化到 arkworks
友好格式来更快地读取 zkey
的库。
有关上下文,请参阅 https://github.com/zkmopro/mopro/issues/25。
如何使用
运行以下命令将 zkey
转换为 arkzkey
。这应作为预处理步骤执行。
cargorun --binarkzkey-util --release --./test-vectors/keccak256_256_test_final.zkey
这将在原始 zkey 所在的同一目录中生成并放置一个 arkzkey
文件。
您还可以本地安装它
cargoinstall --binarkzkey-util --path .
测试
cargo test multiplier2 --release -- --nocapture
cargo test keccak256 --release -- --nocapture
cargo test rsa --release -- --nocapture
基准(Keccak)
cargo测试 keccak256 --release ----nocapture
running 1 test
Reading zkey from: ./test-vectors/keccak256_256_test_final.zkey
Time to read zkey: 101.761584ms
Serializing proving key and constraint matrices
Time to serialize proving key and constraint matrices: 42ns
[build] Writing arkzkey to: ./test-vectors/keccak256_256_test_final.arkzkey
[build] Time to write arkzkey: 9.048011125s
Reading arkzkey from: ./test-vectors/keccak256_256_test_final.arkzkey
Time to open arkzkey file: 40.875µs
Time to mmap arkzkey: 14.541µs
Time to deserialize proving key: 9.050112917s
Time to deserialize matrices: 26.763958ms
Time to read arkzkey: 9.077114958s
test tests::test_keccak256_serialization_deserialization ... ok
电路 | zkey | ark-zkey |
---|---|---|
乘数 | 3 KB | 1KB |
keccak256 | 81.1 MB | 49.5 MB |
rsa | 134.9 MB | 97.8 MB |
依赖项
~24–37MB
~477K SLoC