diff --git a/.gitignore b/.gitignore index fa881179..a97ddcdb 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,8 @@ # will have compiled files and executables target +Cargo.lock + # These are backup files generated by rustfmt **/*.rs.bk diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index b72700bf..00000000 --- a/Cargo.lock +++ /dev/null @@ -1,2829 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "addr2line" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" -dependencies = [ - "gimli 0.27.1", -] - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "ahash" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" -dependencies = [ - "getrandom", - "once_cell", - "version_check", -] - -[[package]] -name = "ahash" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", -] - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - -[[package]] -name = "ansi_term" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" -dependencies = [ - "winapi", -] - -[[package]] -name = "ark-bls12-377" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb00293ba84f51ce3bd026bd0de55899c4e68f0a39a5728cebae3a73ffdc0a4f" -dependencies = [ - "ark-ec", - "ark-ff", - "ark-std", -] - -[[package]] -name = "ark-bls12-381" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c775f0d12169cba7aae4caeb547bb6a50781c7449a8aa53793827c9ec4abf488" -dependencies = [ - "ark-ec", - "ark-ff", - "ark-serialize", - "ark-std", -] - -[[package]] -name = "ark-bn254" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a22f4561524cd949590d78d7d4c5df8f592430d221f7f3c9497bbafd8972120f" -dependencies = [ - "ark-ec", - "ark-ff", - "ark-std", -] - -[[package]] -name = "ark-cp6-782" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32e18cd86cdebaaafd25145e0c5080a7c37ff0963667c639198f128a809899eb" -dependencies = [ - "ark-bls12-377", - "ark-ec", - "ark-ff", - "ark-serialize", - "ark-std", - "itertools", -] - -[[package]] -name = "ark-crypto-primitives" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3a13b34da09176a8baba701233fdffbaa7c1b1192ce031a3da4e55ce1f1a56" -dependencies = [ - "ark-ec", - "ark-ff", - "ark-relations", - "ark-serialize", - "ark-snark", - "ark-std", - "blake2", - "derivative", - "digest", - "rayon", - "sha2", -] - -[[package]] -name = "ark-ec" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c60370a92f8e1a5f053cad73a862e1b99bc642333cd676fa11c0c39f80f4ac2" -dependencies = [ - "ark-ff", - "ark-poly", - "ark-serialize", - "ark-std", - "derivative", - "hashbrown 0.13.2", - "itertools", - "num-traits", - "rayon", - "zeroize", -] - -[[package]] -name = "ark-ff" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c2d42532524bee1da5a4f6f733eb4907301baa480829557adcff5dfaeee1d9a" -dependencies = [ - "ark-ff-asm", - "ark-ff-macros", - "ark-serialize", - "ark-std", - "derivative", - "digest", - "itertools", - "num-bigint", - "num-traits", - "paste", - "rayon", - "rustc_version", - "zeroize", -] - -[[package]] -name = "ark-ff-asm" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d6873aaba7959593d89babed381d33e2329453368f1bf3c67e07686a1c1056f" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "ark-ff-macros" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3c2e7d0f2d67cc7fc925355c74d36e7eda19073639be4a0a233d4611b8c959d" -dependencies = [ - "num-bigint", - "num-traits", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "ark-groth16" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20ceafa83848c3e390f1cbf124bc3193b3e639b3f02009e0e290809a501b95fc" -dependencies = [ - "ark-crypto-primitives", - "ark-ec", - "ark-ff", - "ark-poly", - "ark-relations", - "ark-serialize", - "ark-std", - "rayon", -] - -[[package]] -name = "ark-mnt4-298" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecb284f9f38cbedcae7e78f33e9a1f813db4e6b8103dacc3a143c2ddf32941aa" -dependencies = [ - "ark-ec", - "ark-ff", - "ark-r1cs-std", - "ark-std", -] - -[[package]] -name = "ark-mnt4-753" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d27256f8a5cfb4ac27f43cabfbadf45ab60a153a8f65a3474b4c89e48fd35e40" -dependencies = [ - "ark-ec", - "ark-ff", - "ark-r1cs-std", - "ark-std", -] - -[[package]] -name = "ark-mnt6-298" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b476521074ed1ccfec7277bbe5c6fcf76be15fe1aa63f23f2545f0c8ae6ae73" -dependencies = [ - "ark-ec", - "ark-ff", - "ark-mnt4-298", - "ark-r1cs-std", - "ark-std", -] - -[[package]] -name = "ark-mnt6-753" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "380c58d43c24fd113d41094f5e183e9a2e6ef8bbc8a281e304bfd5076fda7e7f" -dependencies = [ - "ark-ec", - "ark-ff", - "ark-mnt4-753", - "ark-r1cs-std", - "ark-std", -] - -[[package]] -name = "ark-poly" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f6ec811462cabe265cfe1b102fcfe3df79d7d2929c2425673648ee9abfd0272" -dependencies = [ - "ark-ff", - "ark-serialize", - "ark-std", - "derivative", - "hashbrown 0.13.2", - "rayon", -] - -[[package]] -name = "ark-r1cs-std" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de1d1472e5cb020cb3405ce2567c91c8d43f21b674aef37b0202f5c3304761db" -dependencies = [ - "ark-ec", - "ark-ff", - "ark-relations", - "ark-std", - "derivative", - "num-bigint", - "num-integer", - "num-traits", - "tracing", -] - -[[package]] -name = "ark-relations" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00796b6efc05a3f48225e59cb6a2cda78881e7c390872d5786aaf112f31fb4f0" -dependencies = [ - "ark-ff", - "ark-std", - "tracing", - "tracing-subscriber", -] - -[[package]] -name = "ark-serialize" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7e735959bc173ea4baf13327b19c22d452b8e9e8e8f7b7fc34e6bf0e316c33e" -dependencies = [ - "ark-serialize-derive", - "ark-std", - "digest", - "num-bigint", -] - -[[package]] -name = "ark-serialize-derive" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd34f0920d995d2c932f38861c416f70de89a6de9875876b012557079603e6cc" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "ark-snark" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84d3cc6833a335bb8a600241889ead68ee89a3cf8448081fb7694c0fe503da63" -dependencies = [ - "ark-ff", - "ark-relations", - "ark-serialize", - "ark-std", -] - -[[package]] -name = "ark-std" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" -dependencies = [ - "colored", - "num-traits", - "rand", - "rayon", -] - -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi 0.1.19", - "libc", - "winapi", -] - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "backtrace" -version = "0.3.67" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233d376d6d185f2a3093e58f283f60f880315b6c60075b01f36b3b85154564ca" -dependencies = [ - "addr2line", - "cc", - "cfg-if", - "libc", - "miniz_oxide", - "object 0.30.3", - "rustc-demangle", -] - -[[package]] -name = "bbs_plus" -version = "0.12.0" -dependencies = [ - "ark-bls12-381", - "ark-ec", - "ark-ff", - "ark-serialize", - "ark-std", - "blake2", - "digest", - "dock_crypto_utils", - "itertools", - "rayon", - "rmp-serde", - "schnorr_pok", - "serde", - "serde_json", - "serde_with", - "zeroize", -] - -[[package]] -name = "benches" -version = "0.4.0" -dependencies = [ - "ark-bls12-381", - "ark-ec", - "ark-ff", - "ark-serialize", - "ark-std", - "bbs_plus", - "blake2", - "coconut-crypto", - "criterion", - "dock_crypto_utils", - "itertools", - "schnorr_pok", - "serde", - "serde_with", - "test_utils", - "vb_accumulator", - "zeroize", -] - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "blake2" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" -dependencies = [ - "digest", -] - -[[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", -] - -[[package]] -name = "bstr" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223" -dependencies = [ - "lazy_static", - "memchr", - "regex-automata", - "serde", -] - -[[package]] -name = "bumpalo" -version = "3.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" - -[[package]] -name = "bytecheck" -version = "0.6.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d11cac2c12b5adc6570dad2ee1b87eff4955dac476fe12d81e5fdd352e52406f" -dependencies = [ - "bytecheck_derive", - "ptr_meta", -] - -[[package]] -name = "bytecheck_derive" -version = "0.6.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e576ebe98e605500b3c8041bb888e966653577172df6dd97398714eb30b9bf" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "byteorder" -version = "1.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" - -[[package]] -name = "cast" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" - -[[package]] -name = "cc" -version = "1.0.79" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "chrono" -version = "0.4.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e3c5919066adf22df73762e50cffcde3a758f2a848b113b586d1f86728b673b" -dependencies = [ - "iana-time-zone", - "num-integer", - "num-traits", - "winapi", -] - -[[package]] -name = "clap" -version = "2.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" -dependencies = [ - "bitflags", - "textwrap", - "unicode-width", -] - -[[package]] -name = "coconut-crypto" -version = "0.1.0" -dependencies = [ - "ark-bls12-381", - "ark-ec", - "ark-ff", - "ark-poly", - "ark-serialize", - "ark-std", - "blake2", - "digest", - "dock_crypto_utils", - "itertools", - "rayon", - "schnorr_pok", - "secret_sharing_and_dkg", - "serde", - "serde_with", - "zeroize", -] - -[[package]] -name = "codespan-reporting" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" -dependencies = [ - "termcolor", - "unicode-width", -] - -[[package]] -name = "colored" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3616f750b84d8f0de8a58bda93e08e2a81ad3f523089b05f1dffecab48c6cbd" -dependencies = [ - "atty", - "lazy_static", - "winapi", -] - -[[package]] -name = "compressed_sigma" -version = "0.0.3" -dependencies = [ - "ark-bls12-381", - "ark-ec", - "ark-ff", - "ark-poly", - "ark-serialize", - "ark-std", - "blake2", - "digest", - "dock_crypto_utils", - "rayon", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" - -[[package]] -name = "corosensei" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9847f90f32a50b0dcbd68bc23ff242798b13080b97b0569f6ed96a45ce4cf2cd" -dependencies = [ - "autocfg", - "cfg-if", - "libc", - "scopeguard", - "windows-sys", -] - -[[package]] -name = "cpufeatures" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" -dependencies = [ - "libc", -] - -[[package]] -name = "cranelift-bforest" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38faa2a16616c8e78a18d37b4726b98bfd2de192f2fdc8a39ddf568a408a0f75" -dependencies = [ - "cranelift-entity", -] - -[[package]] -name = "cranelift-codegen" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26f192472a3ba23860afd07d2b0217dc628f21fcc72617aa1336d98e1671f33b" -dependencies = [ - "cranelift-bforest", - "cranelift-codegen-meta", - "cranelift-codegen-shared", - "cranelift-entity", - "gimli 0.26.2", - "log", - "regalloc", - "smallvec", - "target-lexicon", -] - -[[package]] -name = "cranelift-codegen-meta" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f32ddb89e9b89d3d9b36a5b7d7ea3261c98235a76ac95ba46826b8ec40b1a24" -dependencies = [ - "cranelift-codegen-shared", -] - -[[package]] -name = "cranelift-codegen-shared" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01fd0d9f288cc1b42d9333b7a776b17e278fc888c28e6a0f09b5573d45a150bc" - -[[package]] -name = "cranelift-entity" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e3bfe172b83167604601faf9dc60453e0d0a93415b57a9c4d1a7ae6849185cf" - -[[package]] -name = "cranelift-frontend" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a006e3e32d80ce0e4ba7f1f9ddf66066d052a8c884a110b91d05404d6ce26dce" -dependencies = [ - "cranelift-codegen", - "log", - "smallvec", - "target-lexicon", -] - -[[package]] -name = "crc32fast" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "criterion" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b01d6de93b2b6c65e17c634a26653a29d107b3c98c607c765bf38d041531cd8f" -dependencies = [ - "atty", - "cast", - "clap", - "criterion-plot", - "csv", - "itertools", - "lazy_static", - "num-traits", - "oorandom", - "plotters", - "rayon", - "regex", - "serde", - "serde_cbor", - "serde_derive", - "serde_json", - "tinytemplate", - "walkdir", -] - -[[package]] -name = "criterion-plot" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2673cc8207403546f45f5fd319a974b1e6983ad1a3ee7e6041650013be041876" -dependencies = [ - "cast", - "itertools", -] - -[[package]] -name = "crossbeam-channel" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" -dependencies = [ - "cfg-if", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" -dependencies = [ - "cfg-if", - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01a9af1f4c2ef74bb8aa1f7e19706bc72d03598c8a570bb5de72243c7a9d9d5a" -dependencies = [ - "autocfg", - "cfg-if", - "crossbeam-utils", - "memoffset 0.7.1", - "scopeguard", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "csv" -version = "1.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22813a6dc45b335f9bade10bf7271dc477e81113e89eb251a0bc2a8a81c536e1" -dependencies = [ - "bstr", - "csv-core", - "itoa 0.4.8", - "ryu", - "serde", -] - -[[package]] -name = "csv-core" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b2466559f260f48ad25fe6317b3c8dac77b5bdb5763ac7d9d6103530663bc90" -dependencies = [ - "memchr", -] - -[[package]] -name = "cxx" -version = "1.0.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a140f260e6f3f79013b8bfc65e7ce630c9ab4388c6a89c71e07226f49487b72" -dependencies = [ - "cc", - "cxxbridge-flags", - "cxxbridge-macro", - "link-cplusplus", -] - -[[package]] -name = "cxx-build" -version = "1.0.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da6383f459341ea689374bf0a42979739dc421874f112ff26f829b8040b8e613" -dependencies = [ - "cc", - "codespan-reporting", - "once_cell", - "proc-macro2", - "quote", - "scratch", - "syn", -] - -[[package]] -name = "cxxbridge-flags" -version = "1.0.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90201c1a650e95ccff1c8c0bb5a343213bdd317c6e600a93075bca2eff54ec97" - -[[package]] -name = "cxxbridge-macro" -version = "1.0.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b75aed41bb2e6367cae39e6326ef817a851db13c13e4f3263714ca3cfb8de56" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "darling" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" -dependencies = [ - "darling_core 0.13.4", - "darling_macro 0.13.4", -] - -[[package]] -name = "darling" -version = "0.14.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0dd3cd20dc6b5a876612a6e5accfe7f3dd883db6d07acfbf14c128f61550dfa" -dependencies = [ - "darling_core 0.14.2", - "darling_macro 0.14.2", -] - -[[package]] -name = "darling_core" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn", -] - -[[package]] -name = "darling_core" -version = "0.14.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a784d2ccaf7c98501746bf0be29b2022ba41fd62a2e622af997a03e9f972859f" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "darling_macro" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" -dependencies = [ - "darling_core 0.13.4", - "quote", - "syn", -] - -[[package]] -name = "darling_macro" -version = "0.14.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7618812407e9402654622dd402b0a89dff9ba93badd6540781526117b92aab7e" -dependencies = [ - "darling_core 0.14.2", - "quote", - "syn", -] - -[[package]] -name = "delegatable_credentials" -version = "0.2.0" -dependencies = [ - "ark-bls12-381", - "ark-ec", - "ark-ff", - "ark-poly", - "ark-serialize", - "ark-std", - "blake2", - "digest", - "dock_crypto_utils", - "num-bigint", - "num-integer", - "rayon", - "schnorr_pok", - "serde", - "serde_with", - "zeroize", -] - -[[package]] -name = "derivative" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "digest" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" -dependencies = [ - "block-buffer", - "crypto-common", - "subtle", -] - -[[package]] -name = "dock_crypto_utils" -version = "0.9.0" -dependencies = [ - "ark-bls12-381", - "ark-ec", - "ark-ff", - "ark-poly", - "ark-serialize", - "ark-std", - "blake2", - "digest", - "itertools", - "merlin", - "rayon", - "serde", - "serde_with", -] - -[[package]] -name = "either" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" - -[[package]] -name = "enum-iterator" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eeac5c5edb79e4e39fe8439ef35207780a11f69c52cbe424ce3dfad4cb78de6" -dependencies = [ - "enum-iterator-derive", -] - -[[package]] -name = "enum-iterator-derive" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c134c37760b27a871ba422106eedbb8247da973a09e82558bf26d619c882b159" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "enumset" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19be8061a06ab6f3a6cf21106c873578bf01bd42ad15e0311a9c76161cb1c753" -dependencies = [ - "enumset_derive", -] - -[[package]] -name = "enumset_derive" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03e7b551eba279bf0fa88b83a46330168c1560a52a94f5126f892f0b364ab3e0" -dependencies = [ - "darling 0.14.2", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "fallible-iterator" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" - -[[package]] -name = "fastrand" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" -dependencies = [ - "instant", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "generic-array" -version = "0.14.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "getrandom" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - -[[package]] -name = "gimli" -version = "0.26.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" -dependencies = [ - "fallible-iterator", - "indexmap", - "stable_deref_trait", -] - -[[package]] -name = "gimli" -version = "0.27.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "221996f774192f0f718773def8201c4ae31f02616a54ccfc2d358bb0e5cefdec" - -[[package]] -name = "half" -version = "1.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" - -[[package]] -name = "hashbrown" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" -dependencies = [ - "ahash 0.7.6", -] - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -dependencies = [ - "ahash 0.7.6", -] - -[[package]] -name = "hashbrown" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash 0.8.3", -] - -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - -[[package]] -name = "hermit-abi" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" -dependencies = [ - "libc", -] - -[[package]] -name = "hex-literal" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d70693199b3cf4552f3fa720b54163927a3ebed2aef240efaf556033ab336a11" -dependencies = [ - "hex-literal-impl", - "proc-macro-hack", -] - -[[package]] -name = "hex-literal-impl" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59448fc2f82a5fb6907f78c3d69d843e82ff5b051923313cc4438cb0c7b745a8" -dependencies = [ - "proc-macro-hack", -] - -[[package]] -name = "iana-time-zone" -version = "0.1.54" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c17cc76786e99f8d2f055c11159e7f0091c42474dcc3189fbab96072e873e6d" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" -dependencies = [ - "cxx", - "cxx-build", -] - -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - -[[package]] -name = "indexmap" -version = "1.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", - "serde", -] - -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" - -[[package]] -name = "itoa" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440" - -[[package]] -name = "js-sys" -version = "0.3.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "keccak" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3afef3b6eff9ce9d8ff9b3601125eec7f0c8cbac7abd14f355d053fa56c98768" -dependencies = [ - "cpufeatures", -] - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "leb128" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" - -[[package]] -name = "legogroth16" -version = "0.6.0" -dependencies = [ - "ark-bls12-377", - "ark-bls12-381", - "ark-bn254", - "ark-cp6-782", - "ark-ec", - "ark-ff", - "ark-groth16", - "ark-mnt4-298", - "ark-mnt4-753", - "ark-mnt6-298", - "ark-mnt6-753", - "ark-poly", - "ark-r1cs-std", - "ark-relations", - "ark-serialize", - "ark-snark", - "ark-std", - "csv", - "derivative", - "dock_crypto_utils", - "fnv", - "hex-literal", - "log", - "num-bigint", - "rayon", - "serde_json", - "tracing", - "tracing-subscriber", - "wasmer", -] - -[[package]] -name = "libc" -version = "0.2.139" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" - -[[package]] -name = "libloading" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" -dependencies = [ - "cfg-if", - "winapi", -] - -[[package]] -name = "link-cplusplus" -version = "1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecd207c9c713c34f95a097a5b029ac2ce6010530c7b49d7fea24d977dede04f5" -dependencies = [ - "cc", -] - -[[package]] -name = "log" -version = "0.4.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "loupe" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b6a72dfa44fe15b5e76b94307eeb2ff995a8c5b283b55008940c02e0c5b634d" -dependencies = [ - "indexmap", - "loupe-derive", - "rustversion", -] - -[[package]] -name = "loupe-derive" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0fbfc88337168279f2e9ae06e157cfed4efd3316e14dc96ed074d4f2e6c5952" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "mach" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" -dependencies = [ - "libc", -] - -[[package]] -name = "matchers" -version = "0.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f099785f7595cc4b4553a174ce30dd7589ef93391ff414dbb67f62392b9e0ce1" -dependencies = [ - "regex-automata", -] - -[[package]] -name = "memchr" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" - -[[package]] -name = "memmap2" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b182332558b18d807c4ce1ca8ca983b34c3ee32765e47b3f0f69b90355cc1dc" -dependencies = [ - "libc", -] - -[[package]] -name = "memoffset" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" -dependencies = [ - "autocfg", -] - -[[package]] -name = "memoffset" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" -dependencies = [ - "autocfg", -] - -[[package]] -name = "merlin" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58c38e2799fc0978b65dfff8023ec7843e2330bb462f19198840b34b6582397d" -dependencies = [ - "byteorder", - "keccak", - "rand_core", - "zeroize", -] - -[[package]] -name = "miniz_oxide" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" -dependencies = [ - "adler", -] - -[[package]] -name = "more-asserts" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7843ec2de400bcbc6a6328c958dc38e5359da6e93e72e37bc5246bf1ae776389" - -[[package]] -name = "num-bigint" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-integer" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" -dependencies = [ - "autocfg", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" -dependencies = [ - "autocfg", -] - -[[package]] -name = "num_cpus" -version = "1.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" -dependencies = [ - "hermit-abi 0.2.6", - "libc", -] - -[[package]] -name = "object" -version = "0.28.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e42c982f2d955fac81dd7e1d0e1426a7d702acd9c98d19ab01083a6a0328c424" -dependencies = [ - "crc32fast", - "hashbrown 0.11.2", - "indexmap", - "memchr", -] - -[[package]] -name = "object" -version = "0.30.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea86265d3d3dcb6a27fc51bd29a4bf387fae9d2986b823079d4986af253eb439" -dependencies = [ - "memchr", -] - -[[package]] -name = "once_cell" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" - -[[package]] -name = "oorandom" -version = "11.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" - -[[package]] -name = "paste" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f746c4065a8fa3fe23974dd82f15431cc8d40779821001404d10d2e79ca7d79" - -[[package]] -name = "pin-project-lite" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" - -[[package]] -name = "plotters" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2538b639e642295546c50fcd545198c9d64ee2a38620a628724a3b266d5fbf97" -dependencies = [ - "num-traits", - "plotters-backend", - "plotters-svg", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "plotters-backend" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "193228616381fecdc1224c62e96946dfbc73ff4384fba576e052ff8c1bea8142" - -[[package]] -name = "plotters-svg" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a81d2759aae1dae668f783c308bc5c8ebd191ff4184aaa1b37f65a6ae5a56f" -dependencies = [ - "plotters-backend", -] - -[[package]] -name = "ppv-lite86" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" - -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", -] - -[[package]] -name = "proc-macro-hack" -version = "0.5.20+deprecated" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" - -[[package]] -name = "proc-macro2" -version = "1.0.51" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "proof_system" -version = "0.19.0" -dependencies = [ - "ark-bls12-381", - "ark-ec", - "ark-ff", - "ark-groth16", - "ark-r1cs-std", - "ark-relations", - "ark-serialize", - "ark-std", - "bbs_plus", - "blake2", - "coconut-crypto", - "digest", - "dock_crypto_utils", - "itertools", - "legogroth16", - "merlin", - "paste", - "rayon", - "rmp-serde", - "saver", - "schnorr_pok", - "serde", - "serde_json", - "serde_with", - "test_utils", - "vb_accumulator", - "zeroize", -] - -[[package]] -name = "ptr_meta" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" -dependencies = [ - "ptr_meta_derive", -] - -[[package]] -name = "ptr_meta_derive" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "quote" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "rand_chacha", - "rand_core", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom", -] - -[[package]] -name = "rayon" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" -dependencies = [ - "crossbeam-channel", - "crossbeam-deque", - "crossbeam-utils", - "num_cpus", -] - -[[package]] -name = "redox_syscall" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" -dependencies = [ - "bitflags", -] - -[[package]] -name = "regalloc" -version = "0.0.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62446b1d3ebf980bdc68837700af1d77b37bc430e524bf95319c6eada2a4cc02" -dependencies = [ - "log", - "rustc-hash", - "smallvec", -] - -[[package]] -name = "regex" -version = "1.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733" -dependencies = [ - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" -dependencies = [ - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.6.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" - -[[package]] -name = "region" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76e189c2369884dce920945e2ddf79b3dff49e071a167dd1817fa9c4c00d512e" -dependencies = [ - "bitflags", - "libc", - "mach", - "winapi", -] - -[[package]] -name = "remove_dir_all" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" -dependencies = [ - "winapi", -] - -[[package]] -name = "rend" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79af64b4b6362ffba04eef3a4e10829718a4896dac19daa741851c86781edf95" -dependencies = [ - "bytecheck", -] - -[[package]] -name = "rkyv" -version = "0.7.39" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cec2b3485b07d96ddfd3134767b8a447b45ea4eb91448d0a35180ec0ffd5ed15" -dependencies = [ - "bytecheck", - "hashbrown 0.12.3", - "ptr_meta", - "rend", - "rkyv_derive", - "seahash", -] - -[[package]] -name = "rkyv_derive" -version = "0.7.39" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6eaedadc88b53e36dd32d940ed21ae4d850d5916f2581526921f553a72ac34c4" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "rmp" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44519172358fd6d58656c86ab8e7fbc9e1490c3e8f14d35ed78ca0dd07403c9f" -dependencies = [ - "byteorder", - "num-traits", - "paste", -] - -[[package]] -name = "rmp-serde" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5b13be192e0220b8afb7222aa5813cb62cc269ebb5cac346ca6487681d2913e" -dependencies = [ - "byteorder", - "rmp", - "serde", -] - -[[package]] -name = "rustc-demangle" -version = "0.1.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" - -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - -[[package]] -name = "rustc_version" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" -dependencies = [ - "semver", -] - -[[package]] -name = "rustversion" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5583e89e108996506031660fe09baa5011b9dd0341b89029313006d1fb508d70" - -[[package]] -name = "ryu" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "saver" -version = "0.9.0" -dependencies = [ - "ark-bls12-381", - "ark-ec", - "ark-ff", - "ark-groth16", - "ark-r1cs-std", - "ark-relations", - "ark-serialize", - "ark-std", - "blake2", - "digest", - "dock_crypto_utils", - "legogroth16", - "merlin", - "rayon", - "rmp-serde", - "serde", - "serde_json", - "serde_with", - "zeroize", -] - -[[package]] -name = "schnorr_pok" -version = "0.9.0" -dependencies = [ - "ark-bls12-381", - "ark-ec", - "ark-ff", - "ark-serialize", - "ark-std", - "blake2", - "digest", - "dock_crypto_utils", - "rayon", - "rmp-serde", - "serde", - "serde_json", - "serde_with", - "zeroize", -] - -[[package]] -name = "scopeguard" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" - -[[package]] -name = "scratch" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1792db035ce95be60c3f8853017b3999209281c24e2ba5bc8e59bf97a0c590c1" - -[[package]] -name = "seahash" -version = "4.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" - -[[package]] -name = "secret_sharing_and_dkg" -version = "0.2.0" -dependencies = [ - "ark-bls12-381", - "ark-ec", - "ark-ff", - "ark-poly", - "ark-serialize", - "ark-std", - "blake2", - "digest", - "dock_crypto_utils", - "rayon", - "schnorr_pok", - "serde", - "serde_with", - "zeroize", -] - -[[package]] -name = "semver" -version = "1.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" - -[[package]] -name = "serde" -version = "1.0.156" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "314b5b092c0ade17c00142951e50ced110ec27cea304b1037c6969246c2469a4" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_bytes" -version = "0.11.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "416bda436f9aab92e02c8e10d49a15ddd339cea90b6e340fe51ed97abb548294" -dependencies = [ - "serde", -] - -[[package]] -name = "serde_cbor" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" -dependencies = [ - "half", - "serde", -] - -[[package]] -name = "serde_derive" -version = "1.0.156" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7e29c4601e36bcec74a223228dce795f4cd3616341a4af93520ca1a837c087d" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7434af0dc1cbd59268aa98b4c22c131c0584d2232f6fb166efb993e2832e896a" -dependencies = [ - "itoa 1.0.5", - "ryu", - "serde", -] - -[[package]] -name = "serde_with" -version = "1.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "678b5a069e50bf00ecd22d0cd8ddf7c236f68581b03db652061ed5eb13a312ff" -dependencies = [ - "serde", - "serde_with_macros", -] - -[[package]] -name = "serde_with_macros" -version = "1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e182d6ec6f05393cc0e5ed1bf81ad6db3a8feedf8ee515ecdd369809bcce8082" -dependencies = [ - "darling 0.13.4", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "sha2" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - -[[package]] -name = "sharded-slab" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" -dependencies = [ - "lazy_static", -] - -[[package]] -name = "smallvec" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" - -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - -[[package]] -name = "strsim" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" - -[[package]] -name = "subtle" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" - -[[package]] -name = "syn" -version = "1.0.107" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "synstructure" -version = "0.12.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "unicode-xid", -] - -[[package]] -name = "target-lexicon" -version = "0.12.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9410d0f6853b1d94f0e519fb95df60f29d2c1eff2d921ffdf01a4c8a3b54f12d" - -[[package]] -name = "tempfile" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" -dependencies = [ - "cfg-if", - "fastrand", - "libc", - "redox_syscall", - "remove_dir_all", - "winapi", -] - -[[package]] -name = "termcolor" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "test_utils" -version = "0.1.0" -dependencies = [ - "ark-bls12-381", - "ark-ec", - "ark-ff", - "ark-serialize", - "ark-std", - "bbs_plus", - "blake2", - "proof_system", - "schnorr_pok", - "vb_accumulator", -] - -[[package]] -name = "textwrap" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" -dependencies = [ - "unicode-width", -] - -[[package]] -name = "thiserror" -version = "1.0.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "thread_local" -version = "1.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" -dependencies = [ - "cfg-if", - "once_cell", -] - -[[package]] -name = "tinytemplate" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" -dependencies = [ - "serde", - "serde_json", -] - -[[package]] -name = "tracing" -version = "0.1.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" -dependencies = [ - "cfg-if", - "log", - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing-core" -version = "0.1.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" -dependencies = [ - "once_cell", - "valuable", -] - -[[package]] -name = "tracing-log" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" -dependencies = [ - "lazy_static", - "log", - "tracing-core", -] - -[[package]] -name = "tracing-serde" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" -dependencies = [ - "serde", - "tracing-core", -] - -[[package]] -name = "tracing-subscriber" -version = "0.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" -dependencies = [ - "ansi_term", - "chrono", - "lazy_static", - "matchers", - "regex", - "serde", - "serde_json", - "sharded-slab", - "smallvec", - "thread_local", - "tracing", - "tracing-core", - "tracing-log", - "tracing-serde", -] - -[[package]] -name = "typenum" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" - -[[package]] -name = "unicode-ident" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" - -[[package]] -name = "unicode-width" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" - -[[package]] -name = "unicode-xid" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" - -[[package]] -name = "valuable" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" - -[[package]] -name = "vb_accumulator" -version = "0.12.0" -dependencies = [ - "ark-bls12-381", - "ark-ec", - "ark-ff", - "ark-poly", - "ark-serialize", - "ark-std", - "blake2", - "digest", - "dock_crypto_utils", - "rayon", - "rmp-serde", - "schnorr_pok", - "serde", - "serde_json", - "serde_with", - "zeroize", -] - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "walkdir" -version = "2.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" -dependencies = [ - "same-file", - "winapi", - "winapi-util", -] - -[[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "wasm-bindgen" -version = "0.2.84" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.84" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.84" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.84" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.84" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" - -[[package]] -name = "wasm-encoder" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a584273ccc2d9311f1dd19dc3fb26054661fa3e373d53ede5d1144ba07a9acd" -dependencies = [ - "leb128", -] - -[[package]] -name = "wasmer" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea8d8361c9d006ea3d7797de7bd6b1492ffd0f91a22430cfda6c1658ad57bedf" -dependencies = [ - "cfg-if", - "indexmap", - "js-sys", - "loupe", - "more-asserts", - "target-lexicon", - "thiserror", - "wasm-bindgen", - "wasmer-artifact", - "wasmer-compiler", - "wasmer-compiler-cranelift", - "wasmer-derive", - "wasmer-engine", - "wasmer-engine-dylib", - "wasmer-engine-universal", - "wasmer-types", - "wasmer-vm", - "wasmparser", - "wat", - "winapi", -] - -[[package]] -name = "wasmer-artifact" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7aaf9428c29c1d8ad2ac0e45889ba8a568a835e33fd058964e5e500f2f7ce325" -dependencies = [ - "enumset", - "loupe", - "thiserror", - "wasmer-compiler", - "wasmer-types", -] - -[[package]] -name = "wasmer-compiler" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e67a6cd866aed456656db2cfea96c18baabbd33f676578482b85c51e1ee19d2c" -dependencies = [ - "enumset", - "loupe", - "rkyv", - "serde", - "serde_bytes", - "smallvec", - "target-lexicon", - "thiserror", - "wasmer-types", - "wasmparser", -] - -[[package]] -name = "wasmer-compiler-cranelift" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48be2f9f6495f08649e4f8b946a2cbbe119faf5a654aa1457f9504a99d23dae0" -dependencies = [ - "cranelift-codegen", - "cranelift-entity", - "cranelift-frontend", - "gimli 0.26.2", - "loupe", - "more-asserts", - "rayon", - "smallvec", - "target-lexicon", - "tracing", - "wasmer-compiler", - "wasmer-types", -] - -[[package]] -name = "wasmer-derive" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00e50405cc2a2f74ff574584710a5f2c1d5c93744acce2ca0866084739284b51" -dependencies = [ - "proc-macro-error", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "wasmer-engine" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f98f010978c244db431b392aeab0661df7ea0822343334f8f2a920763548e45" -dependencies = [ - "backtrace", - "enumset", - "lazy_static", - "loupe", - "memmap2", - "more-asserts", - "rustc-demangle", - "serde", - "serde_bytes", - "target-lexicon", - "thiserror", - "wasmer-artifact", - "wasmer-compiler", - "wasmer-types", - "wasmer-vm", -] - -[[package]] -name = "wasmer-engine-dylib" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0358af9c154724587731175553805648d9acb8f6657880d165e378672b7e53" -dependencies = [ - "cfg-if", - "enum-iterator", - "enumset", - "leb128", - "libloading", - "loupe", - "object 0.28.4", - "rkyv", - "serde", - "tempfile", - "tracing", - "wasmer-artifact", - "wasmer-compiler", - "wasmer-engine", - "wasmer-object", - "wasmer-types", - "wasmer-vm", - "which", -] - -[[package]] -name = "wasmer-engine-universal" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "440dc3d93c9ca47865a4f4edd037ea81bf983b5796b59b3d712d844b32dbef15" -dependencies = [ - "cfg-if", - "enumset", - "leb128", - "loupe", - "region", - "rkyv", - "wasmer-compiler", - "wasmer-engine", - "wasmer-engine-universal-artifact", - "wasmer-types", - "wasmer-vm", - "winapi", -] - -[[package]] -name = "wasmer-engine-universal-artifact" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f1db3f54152657eb6e86c44b66525ff7801dad8328fe677da48dd06af9ad41" -dependencies = [ - "enum-iterator", - "enumset", - "loupe", - "rkyv", - "thiserror", - "wasmer-artifact", - "wasmer-compiler", - "wasmer-types", -] - -[[package]] -name = "wasmer-object" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d831335ff3a44ecf451303f6f891175c642488036b92ceceb24ac8623a8fa8b" -dependencies = [ - "object 0.28.4", - "thiserror", - "wasmer-compiler", - "wasmer-types", -] - -[[package]] -name = "wasmer-types" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39df01ea05dc0a9bab67e054c7cb01521e53b35a7bb90bd02eca564ed0b2667f" -dependencies = [ - "backtrace", - "enum-iterator", - "indexmap", - "loupe", - "more-asserts", - "rkyv", - "serde", - "thiserror", -] - -[[package]] -name = "wasmer-vm" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30d965fa61f4dc4cdb35a54daaf7ecec3563fbb94154a6c35433f879466247dd" -dependencies = [ - "backtrace", - "cc", - "cfg-if", - "corosensei", - "enum-iterator", - "indexmap", - "lazy_static", - "libc", - "loupe", - "mach", - "memoffset 0.6.5", - "more-asserts", - "region", - "rkyv", - "scopeguard", - "serde", - "thiserror", - "wasmer-artifact", - "wasmer-types", - "winapi", -] - -[[package]] -name = "wasmparser" -version = "0.83.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "718ed7c55c2add6548cca3ddd6383d738cd73b892df400e96b9aa876f0141d7a" - -[[package]] -name = "wast" -version = "52.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15942180f265280eede7bc38b239e9770031d1821c02d905284216c645316430" -dependencies = [ - "leb128", - "memchr", - "unicode-width", - "wasm-encoder", -] - -[[package]] -name = "wat" -version = "1.0.57" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37212100d4cbe6f0f6ff6e707f1e5a5b5b675f0451231ed9e4235e234e127ed3" -dependencies = [ - "wast", -] - -[[package]] -name = "web-sys" -version = "0.3.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e33b99f4b23ba3eec1a53ac264e35a755f00e966e0065077d6027c0f575b0b97" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "which" -version = "4.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269" -dependencies = [ - "either", - "libc", - "once_cell", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-util" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" -dependencies = [ - "winapi", -] - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows" -version = "0.46.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdacb41e6a96a052c6cb63a144f24900236121c6f63f4f8219fef5977ecb0c25" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-sys" -version = "0.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43dbb096663629518eb1dfa72d80243ca5a6aca764cae62a2df70af760a9be75" -dependencies = [ - "windows_aarch64_msvc 0.33.0", - "windows_i686_gnu 0.33.0", - "windows_i686_msvc 0.33.0", - "windows_x86_64_gnu 0.33.0", - "windows_x86_64_msvc 0.33.0", -] - -[[package]] -name = "windows-targets" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc 0.42.2", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd761fd3eb9ab8cc1ed81e56e567f02dd82c4c837e48ac3b2181b9ffc5060807" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" - -[[package]] -name = "windows_i686_gnu" -version = "0.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cab0cf703a96bab2dc0c02c0fa748491294bf9b7feb27e1f4f96340f208ada0e" - -[[package]] -name = "windows_i686_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" - -[[package]] -name = "windows_i686_msvc" -version = "0.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cfdbe89cc9ad7ce618ba34abc34bbb6c36d99e96cae2245b7943cd75ee773d0" - -[[package]] -name = "windows_i686_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4dd9b0c0e9ece7bb22e84d70d01b71c6d6248b81a3c60d11869451b4cb24784" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff1e4aa646495048ec7f3ffddc411e1d829c026a2ec62b39da15c1055e406eaa" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" - -[[package]] -name = "zeroize" -version = "1.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c394b5bd0c6f669e7275d9c20aa90ae064cb22e75a1cad54e1b34088034b149f" -dependencies = [ - "zeroize_derive", -] - -[[package]] -name = "zeroize_derive" -version = "1.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44bf07cb3e50ea2003396695d58bf46bc9887a1f362260446fad6bc4e79bd36c" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "synstructure", -] diff --git a/Cargo.toml b/Cargo.toml index 56596034..8ebc7194 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,7 +36,7 @@ rayon = { version = "1" } digest = { version = "0.10", default-features = false, features = ["alloc"] } serde = { version = "1.0", default-features = false, features = ["derive"] } serde_with = { version = "1.10.0", default-features = false, features = ["macros"] } -zeroize = { version = "1.5.5", features = ["derive"] } +zeroize = { version = "1.6.0", features = ["derive"] } blake2 = { version = "0.10", default-features = false } ark-bls12-381 = { version = "^0.4.0", default-features = false, features = [ "curve" ] } merlin = { version = "^3.0", default-features = false } diff --git a/bbs_plus/src/proof.rs b/bbs_plus/src/proof.rs index a2afa001..dab028d4 100644 --- a/bbs_plus/src/proof.rs +++ b/bbs_plus/src/proof.rs @@ -61,7 +61,7 @@ use crate::{ setup::{PreparedSignatureParamsG1, SignatureParamsG1}, signature::SignatureG1, }; -use ark_ec::{pairing::Pairing, AffineRepr, CurveGroup, VariableBaseMSM}; +use ark_ec::{pairing::Pairing, AffineRepr, CurveGroup, Group, VariableBaseMSM}; use ark_ff::{Field, PrimeField, Zero}; use ark_serialize::{CanonicalDeserialize, CanonicalSerialize}; use ark_std::{ @@ -81,7 +81,7 @@ use itertools::multiunzip; use schnorr_pok::{error::SchnorrError, SchnorrCommitment, SchnorrResponse}; use serde::{Deserialize, Serialize}; use serde_with::serde_as; -use zeroize::Zeroize; +use zeroize::{Zeroize, ZeroizeOnDrop}; /// Proof of knowledge of BBS+ signature in group G1 /// The BBS+ signature proves validity of a set of messages {m_i}, i in I. This stateful protocol proves knowledge of such @@ -94,7 +94,16 @@ use zeroize::Zeroize; /// and then that challenge is used in post-challenge phase of all protocols. #[serde_as] #[derive( - Clone, PartialEq, Eq, Debug, CanonicalSerialize, CanonicalDeserialize, Serialize, Deserialize, + Clone, + PartialEq, + Eq, + Debug, + Zeroize, + ZeroizeOnDrop, + CanonicalSerialize, + CanonicalDeserialize, + Serialize, + Deserialize, )] pub struct PoKOfSignatureG1Protocol { #[serde_as(as = "ArkObjectBytes")] @@ -104,10 +113,12 @@ pub struct PoKOfSignatureG1Protocol { #[serde_as(as = "ArkObjectBytes")] pub d: E::G1Affine, /// For proving relation `A_bar - d = A_prime * -e + h_0 * r2` + #[zeroize(skip)] pub sc_comm_1: SchnorrCommitment, #[serde_as(as = "(ArkObjectBytes, ArkObjectBytes)")] sc_wits_1: (E::ScalarField, E::ScalarField), /// For proving relation `g1 + \sum_{i in D}(h_i*m_i)` = `d*r3 + {h_0}*{-s'} + sum_{j notin D}(h_j*m_j)` + #[zeroize(skip)] pub sc_comm_2: SchnorrCommitment, #[serde_as(as = "Vec")] sc_wits_2: Vec, @@ -197,11 +208,9 @@ impl PoKOfSignatureG1Protocol { // A' = A * r1 let A_prime = signature.A.mul_bigint(r1.into_bigint()); - let A_prime_affine = A_prime.into_affine(); // A_bar = r1 * b - e * A' - let mut b_r1 = b; - b_r1 *= r1; - let A_bar = b_r1 - (A_prime_affine.mul_bigint(signature.e.into_bigint())); + let b_r1 = b * r1; + let A_bar = b_r1 - (A_prime.mul_bigint(signature.e.into_bigint())); // d = r1 * b - r2 * h_0 let d = b_r1 - params.h_0.mul_bigint(r2.into_bigint()); let d_affine = d.into_affine(); @@ -216,6 +225,7 @@ impl PoKOfSignatureG1Protocol { // For each of the above relations, a Schnorr protocol is executed; the first to prove knowledge // of `(e, r2)`, and the second of `(r3, s', {m_j}_{j \notin D})`. The secret knowledge items are // referred to as witnesses, and the public items as instances. + let A_prime_affine = A_prime.into_affine(); let bases_1 = [A_prime_affine, params.h_0]; let randomness_1 = vec![E::ScalarField::rand(rng), E::ScalarField::rand(rng)]; let wits_1 = (-signature.e, r2); @@ -349,22 +359,6 @@ impl PoKOfSignatureG1Protocol { } } -impl Zeroize for PoKOfSignatureG1Protocol { - fn zeroize(&mut self) { - // Other members of `self` are public anyway - self.sc_comm_1.zeroize(); - self.sc_wits_1.zeroize(); - self.sc_comm_2.zeroize(); - self.sc_wits_2.zeroize(); - } -} - -impl Drop for PoKOfSignatureG1Protocol { - fn drop(&mut self) { - self.zeroize(); - } -} - impl PoKOfSignatureG1Proof where E: Pairing, @@ -573,7 +567,8 @@ mod tests { let mut rng = StdRng::seed_from_u64(0u64); let message_count = 20; let (messages, params, keypair, sig) = sig_setup(&mut rng, message_count); - sig.verify(&messages, &keypair.public_key, ¶ms).unwrap(); + sig.verify(&messages, keypair.public_key.clone(), params.clone()) + .unwrap(); let mut revealed_indices = BTreeSet::new(); revealed_indices.insert(0); @@ -691,14 +686,14 @@ mod tests { SignatureG1::::new(&mut rng, &messages_1, &keypair_1.secret_key, ¶ms_1) .unwrap(); sig_1 - .verify(&messages_1, &keypair_1.public_key, ¶ms_1) + .verify(&messages_1, keypair_1.public_key.clone(), params_1.clone()) .unwrap(); let sig_2 = SignatureG1::::new(&mut rng, &messages_2, &keypair_2.secret_key, ¶ms_2) .unwrap(); sig_2 - .verify(&messages_2, &keypair_2.public_key, ¶ms_2) + .verify(&messages_2, keypair_2.public_key.clone(), params_2.clone()) .unwrap(); // Add the same blinding for the message which has to be proven equal across messages diff --git a/bbs_plus/src/setup.rs b/bbs_plus/src/setup.rs index fc43acac..f266fd80 100644 --- a/bbs_plus/src/setup.rs +++ b/bbs_plus/src/setup.rs @@ -41,7 +41,7 @@ use ark_std::{ }; use digest::{Digest, DynDigest}; use schnorr_pok::{error::SchnorrError, impl_proof_of_knowledge_of_discrete_log}; -use zeroize::Zeroize; +use zeroize::{Zeroize, ZeroizeOnDrop}; use core::iter::once; use dock_crypto_utils::{ @@ -67,15 +67,10 @@ use serde_with::serde_as; Serialize, Deserialize, Zeroize, + ZeroizeOnDrop, )] pub struct SecretKey(#[serde_as(as = "ArkObjectBytes")] pub F); -impl Drop for SecretKey { - fn drop(&mut self) { - self.zeroize(); - } -} - impl SecretKey { pub fn generate_using_seed(seed: &[u8]) -> Self where @@ -87,6 +82,59 @@ impl SecretKey { } } +macro_rules! impl_sig_params_prepared { + ( $group_affine:ident, $group_projective:ident) => { + /// Number of messages supported in the multi-message + pub fn supported_message_count(&self) -> usize { + self.h.len() + } + + /// Commit to given messages using the parameters and the given blinding as a Pedersen commitment. + /// `indexed_messages_sorted_by_index` must produce items sorted by unique indices, otherwise, + /// an error will be returned. + /// Eg. if given messages `m_i`, `m_j`, and `m_k` in the iterator, the commitment converts messages to + /// scalars and multiplies them by the parameter curve points: + /// `params.h_0 * blinding + params.h_i * m_i + params.h_j * m_j + params.h_k * m_k` + /// Computes using multi-scalar multiplication + pub fn commit_to_messages<'a, MI>( + &self, + indexed_messages_sorted_by_index: MI, + blinding: &'a E::ScalarField, + ) -> Result + where + MI: IntoIterator, + { + let (bases, scalars): (Vec<_>, Vec<_>) = process_results( + pair_valid_items_with_slice::<_, _, _, BBSPlusError, _>( + indexed_messages_sorted_by_index, + CheckLeft(seq_pairs_satisfy(|a, b| a < b)), + &self.h, + ), + |iter| iter.chain(once((&self.h_0, blinding))).unzip(), + )?; + + Ok(E::$group_projective::msm_unchecked(&bases, &scalars).into_affine()) + } + + /// Compute `b` from the paper (equivalently 'A*{e+x}'). + /// `indexed_messages_sorted_by_index` must produce items sorted by unique indices, otherwise, + /// an error will be returned. + /// Commits to the given messages and adds `self.g1` to it, + /// `b = g_1 + h_0 * s + sum(h_i * m_i)` for all indices `i` in the map. + pub fn b<'a, MI>( + &self, + indexed_messages_sorted_by_index: MI, + s: &'a E::ScalarField, + ) -> Result + where + MI: IntoIterator, + { + let commitment = self.commit_to_messages(indexed_messages_sorted_by_index, s)?; + Ok(commitment + self.g1) + } + }; +} + macro_rules! impl_sig_params { ( $name:ident, $group_affine:ident, $group_projective:ident, $other_group_affine:ident, $other_group_projective:ident ) => { /// Signature params used while signing and verifying. Also used when proving knowledge of signature. @@ -184,54 +232,7 @@ macro_rules! impl_sig_params { || cfg_iter!(self.h).any(|v| v.is_zero())) } - /// Number of messages supported in the multi-message - pub fn supported_message_count(&self) -> usize { - self.h.len() - } - - /// Commit to given messages using the parameters and the given blinding as a Pedersen commitment. - /// `indexed_messages_sorted_by_index` must produce items sorted by unique indices, otherwise, - /// an error will be returned. - /// Eg. if given messages `m_i`, `m_j`, and `m_k` in the iterator, the commitment converts messages to - /// scalars and multiplies them by the parameter curve points: - /// `params.h_0 * blinding + params.h_i * m_i + params.h_j * m_j + params.h_k * m_k` - /// Computes using multi-scalar multiplication - pub fn commit_to_messages<'a, MI>( - &self, - indexed_messages_sorted_by_index: MI, - blinding: &'a E::ScalarField, - ) -> Result - where - MI: IntoIterator, - { - let (bases, scalars): (Vec<_>, Vec<_>) = process_results( - pair_valid_items_with_slice::<_, _, _, BBSPlusError, _>( - indexed_messages_sorted_by_index, - CheckLeft(seq_pairs_satisfy(|a, b| a < b)), - &self.h, - ), - |iter| iter.chain(once((&self.h_0, blinding))).unzip(), - )?; - - Ok(E::$group_projective::msm_unchecked(&bases, &scalars).into_affine()) - } - - /// Compute `b` from the paper (equivalently 'A*{e+x}'). - /// `indexed_messages_sorted_by_index` must produce items sorted by unique indices, otherwise, - /// an error will be returned. - /// Commits to the given messages and adds `self.g1` to it, - /// `b = g_1 + h_0 * s + sum(h_i * m_i)` for all indices `i` in the map. - pub fn b<'a, MI>( - &self, - indexed_messages_sorted_by_index: MI, - s: &'a E::ScalarField, - ) -> Result - where - MI: IntoIterator, - { - let commitment = self.commit_to_messages(indexed_messages_sorted_by_index, s)?; - Ok(commitment + self.g1) - } + impl_sig_params_prepared!($group_affine, $group_projective); } }; } @@ -373,6 +374,10 @@ impl From> for PreparedSignatureParamsG1 { } } +impl PreparedSignatureParamsG1 { + impl_sig_params_prepared!(G1Affine, G1); +} + impl From> for PreparedPublicKeyG2 { fn from(pk: PublicKeyG2) -> Self { Self(E::G2Prepared::from(pk.0)) diff --git a/bbs_plus/src/signature.rs b/bbs_plus/src/signature.rs index 9a556268..7432561a 100644 --- a/bbs_plus/src/signature.rs +++ b/bbs_plus/src/signature.rs @@ -86,14 +86,17 @@ use crate::error::BBSPlusError; use ark_ec::{pairing::Pairing, AffineRepr, CurveGroup, Group}; use ark_ff::{fields::Field, PrimeField}; use ark_serialize::{CanonicalDeserialize, CanonicalSerialize}; -use ark_std::{fmt::Debug, rand::RngCore, vec::Vec, UniformRand, Zero}; +use ark_std::{fmt::Debug, ops::Mul, rand::RngCore, vec::Vec, UniformRand, Zero}; -use crate::setup::{PublicKeyG1, PublicKeyG2, SecretKey, SignatureParamsG1, SignatureParamsG2}; +use crate::{ + prelude::PreparedSignatureParamsG1, + setup::{PreparedPublicKeyG2, PublicKeyG1, SecretKey, SignatureParamsG1, SignatureParamsG2}, +}; use ark_std::collections::BTreeMap; use dock_crypto_utils::serde_utils::*; use serde::{Deserialize, Serialize}; use serde_with::serde_as; -use zeroize::Zeroize; +use zeroize::{Zeroize, ZeroizeOnDrop}; macro_rules! impl_signature_struct { ( $name:ident, $group:ident ) => { @@ -108,6 +111,8 @@ macro_rules! impl_signature_struct { CanonicalDeserialize, Serialize, Deserialize, + Zeroize, + ZeroizeOnDrop, )] pub struct $name { #[serde_as(as = "ArkObjectBytes")] @@ -117,50 +122,14 @@ macro_rules! impl_signature_struct { #[serde_as(as = "ArkObjectBytes")] pub s: E::ScalarField, } - - impl Zeroize for $name { - fn zeroize(&mut self) { - self.A.zeroize(); - self.e.zeroize(); - self.s.zeroize(); - } - } - - impl Drop for $name { - fn drop(&mut self) { - self.zeroize(); - } - } }; } impl_signature_struct!(SignatureG1, G1Affine); impl_signature_struct!(SignatureG2, G2Affine); -// Macro to do the pairing check in signature verification when signature is in group G1 -macro_rules! pairing_check_for_g1_sig { - ($A:expr, $w:expr, $g2:expr, $k:expr) => { - E::multi_pairing( - [E::G1Prepared::from($A), E::G1Prepared::from($k)], - [E::G2Prepared::from($w), E::G2Prepared::from($g2)], - ) - .is_zero() - }; -} - -// Macro to do the pairing check in signature verification when signature is in group G2 -macro_rules! pairing_check_for_g2_sig { - ($A:expr, $w:expr, $g2:expr, $k:expr) => { - E::multi_pairing( - [E::G1Prepared::from($w), E::G1Prepared::from($g2)], - [E::G2Prepared::from($A), E::G2Prepared::from($k)], - ) - .is_zero() - }; -} - macro_rules! impl_signature_alg { - ( $name:ident, $params:ident, $pk:ident, $sig_group_proj:ident, $sig_group_affine:ident, $pairing:tt ) => { + ( $name:ident, $params:ident, $pk:ident, $sig_group_proj:ident, $sig_group_affine:ident, $verif_params:ident ) => { /// Signature creation and verification impl $name { /// Create a new signature with all messages known to the signer. @@ -251,14 +220,14 @@ macro_rules! impl_signature_alg { } } - /// Verify the validity of the signature. Assumes that the public key and parameters - /// have been validated already. - pub fn verify( + /// Basic validations before signature verification like there is at-least 1 message, the + /// number of messages are supported by params, signature is non-zero. Returns value to be + /// used in pairing check + pub fn pre_verify( &self, messages: &[E::ScalarField], - pk: &$pk, - params: &$params, - ) -> Result<(), BBSPlusError> { + params: &$verif_params, + ) -> Result { if messages.is_empty() { return Err(BBSPlusError::NoMessageToSign); } @@ -271,18 +240,8 @@ macro_rules! impl_signature_alg { if !self.is_non_zero() { return Err(BBSPlusError::ZeroSignature); } - let b = params.b(messages.iter().enumerate(), &self.s)?; - let g2_e = params.g2.mul_bigint(self.e.into_bigint()); - if !$pairing!( - self.A, - (g2_e + pk.0).into_affine(), // g2*e + w - (-(params.g2.into_group())).into_affine(), - b.into_affine() - ) { - return Err(BBSPlusError::InvalidSignature); - } - Ok(()) + Ok(b) } } }; @@ -292,19 +251,76 @@ impl_signature_alg!( SignatureG1, SignatureParamsG1, PublicKeyG2, - G1Projective, + G1, G1Affine, - pairing_check_for_g1_sig + PreparedSignatureParamsG1 ); impl_signature_alg!( SignatureG2, SignatureParamsG2, PublicKeyG1, - G2Projective, + G2, G2Affine, - pairing_check_for_g2_sig + SignatureParamsG2 ); +impl SignatureG1 { + /// Verify the validity of the signature. Assumes that the public key and parameters + /// have been validated already. + pub fn verify( + &self, + messages: &[E::ScalarField], + pk: impl Into>, + params: impl Into>, + ) -> Result<(), BBSPlusError> { + let params = params.into(); + // The pairing check is `e(A, pk + g2*e) == e(b, g2)` which can be written as `e(A, pk)*e(A, g2*e) == e(b, g2)`. + // Simplifying more `e(A, pk)*e(A*e, g2) == e(b, g2)` ==> `e(A, pk)*e(A*e, g2)*e(-b, g2) == 1` => `e(A, pk)*e(A*e - b, g2) == 1`. + let b = self.pre_verify(messages, ¶ms)?; + // Aeb = A*e - b + let Aeb = self.A.mul(self.e) - b; + if !E::multi_pairing( + [ + E::G1Prepared::from(self.A), + E::G1Prepared::from(Aeb.into_affine()), + ], + [pk.into().0, params.g2], + ) + .is_zero() + { + return Err(BBSPlusError::InvalidSignature); + } + Ok(()) + } +} + +impl SignatureG2 { + /// Verify the validity of the signature. Assumes that the public key and parameters + /// have been validated already. + pub fn verify( + &self, + messages: &[E::ScalarField], + pk: &PublicKeyG1, + params: &SignatureParamsG2, + ) -> Result<(), BBSPlusError> { + // The pairing check is `e(pk + g2*e, A) == e(g2, b)` + let b = self.pre_verify(messages, params)?; + let g2_e = params.g2.mul_bigint(self.e.into_bigint()); + if !E::multi_pairing( + [ + E::G1Prepared::from((g2_e + pk.0).into_affine()), + E::G1Prepared::from((-(params.g2.into_group())).into_affine()), + ], + [E::G2Prepared::from(self.A), E::G2Prepared::from(b)], + ) + .is_zero() + { + return Err(BBSPlusError::InvalidSignature); + } + Ok(()) + } +} + #[cfg(test)] mod tests { use super::*; @@ -321,8 +337,23 @@ mod tests { type Fr = ::ScalarField; + macro_rules! params_and_pk_for_g1_sig { + ($params:expr, $pk:expr) => { + ( + PreparedSignatureParamsG1::from($params), + PreparedPublicKeyG2::from($pk), + ) + }; + } + + macro_rules! params_and_pk_for_g2_sig { + ($params:expr, $pk:expr) => { + (&$params, &$pk) + }; + } + macro_rules! test_sig_verif { - ($keypair:ident, $params:ident, $sig:ident, $rng:ident, $message_count: ident, $messages: ident, $group: ident) => { + ($keypair:ident, $params:ident, $sig:ident, $rng:ident, $message_count: ident, $messages: ident, $group: ident, $verif_params_and_pk: tt) => { let params = $params::::generate_using_rng(&mut $rng, $message_count); let keypair = $keypair::::generate_using_rng(&mut $rng, ¶ms); let public_key = &keypair.public_key; @@ -340,12 +371,18 @@ mod tests { assert!(params.is_valid()); assert!(public_key.is_valid()); + let (verif_params, verif_pk) = + $verif_params_and_pk!(params.clone(), public_key.clone()); + let mut zero_sig = sig.clone(); zero_sig.A = $group::zero(); - assert!(zero_sig.verify(&$messages, public_key, ¶ms).is_err()); + assert!(zero_sig.verify(&$messages, verif_pk, verif_params).is_err()); + + let (verif_params, verif_pk) = + $verif_params_and_pk!(params.clone(), public_key.clone()); let start = Instant::now(); - sig.verify(&$messages, public_key, ¶ms).unwrap(); + sig.verify(&$messages, verif_pk, verif_params).unwrap(); println!( "Time to verify signature over multi-message of size {} is {:?}", $message_count, @@ -387,11 +424,20 @@ mod tests { ¶ms, ) .unwrap(); + + let (verif_params, verif_pk) = + $verif_params_and_pk!(params.clone(), public_key.clone()); + // First test should fail since the signature is blinded - assert!(blinded_sig.verify(&$messages, public_key, ¶ms).is_err()); + assert!(blinded_sig + .verify(&$messages, verif_pk, verif_params) + .is_err()); + + let (verif_params, verif_pk) = + $verif_params_and_pk!(params.clone(), public_key.clone()); let sig = blinded_sig.unblind(&blinding); - sig.verify(&$messages, public_key, ¶ms).unwrap(); + sig.verify(&$messages, verif_pk, verif_params).unwrap(); // sig and blinded_sig have same struct so just checking serialization on sig test_serialization!($sig, sig); @@ -407,6 +453,7 @@ mod tests { let message_count = 20; let messages: Vec = (0..message_count).map(|_| Fr::rand(&mut rng)).collect(); + println!("Signature in Group G1"); { test_sig_verif!( KeypairG2, @@ -415,10 +462,12 @@ mod tests { rng, message_count, messages, - G1Affine + G1Affine, + params_and_pk_for_g1_sig ); } + println!("Signature in Group G2"); { test_sig_verif!( KeypairG1, @@ -427,7 +476,8 @@ mod tests { rng, message_count, messages, - G2Affine + G2Affine, + params_and_pk_for_g2_sig ); } } diff --git a/coconut/Cargo.toml b/coconut/Cargo.toml index 7862792c..99b7c6a5 100644 --- a/coconut/Cargo.toml +++ b/coconut/Cargo.toml @@ -27,8 +27,8 @@ schnorr_pok = { version = "0.9.0", default-features = false, path = "../schnorr_ secret_sharing_and_dkg = { version = "0.2.0", default-features = false, path = "../secret_sharing_and_dkg" } [dev-dependencies] -blake2 = { version = "0.10.6", default-features = false } -ark-bls12-381 = { version = "0.4.0", default-features = false, features = [ "curve" ] } +blake2.workspace = true +ark-bls12-381.workspace = true [features] default = ["std", "parallel"] diff --git a/delegatable_credentials/src/accumulator.rs b/delegatable_credentials/src/accumulator.rs index 2d6b92e0..62ef50ff 100644 --- a/delegatable_credentials/src/accumulator.rs +++ b/delegatable_credentials/src/accumulator.rs @@ -13,9 +13,11 @@ use ark_std::{ UniformRand, }; use dock_crypto_utils::poly::poly_from_roots; -use zeroize::Zeroize; +use zeroize::{Zeroize, ZeroizeOnDrop}; -#[derive(Clone, Debug, PartialEq, Eq, Zeroize, CanonicalSerialize, CanonicalDeserialize)] +#[derive( + Clone, Debug, PartialEq, Eq, Zeroize, ZeroizeOnDrop, CanonicalSerialize, CanonicalDeserialize, +)] pub struct SecretKey(pub E::ScalarField); #[derive(Clone, Debug, PartialEq, Eq, CanonicalSerialize, CanonicalDeserialize)] @@ -24,12 +26,6 @@ pub struct PublicKey(pub E::G2Affine); #[derive(Clone, Debug, PartialEq, CanonicalSerialize, CanonicalDeserialize)] pub struct PreparedPublicKey(pub E::G2Prepared); -impl Drop for SecretKey { - fn drop(&mut self) { - self.0.zeroize(); - } -} - impl SecretKey { pub fn new(rng: &mut R) -> Self { Self(E::ScalarField::rand(rng)) diff --git a/delegatable_credentials/src/auditor.rs b/delegatable_credentials/src/auditor.rs index b81be657..3ff291b4 100644 --- a/delegatable_credentials/src/auditor.rs +++ b/delegatable_credentials/src/auditor.rs @@ -9,20 +9,16 @@ use ark_std::{ vec::Vec, UniformRand, }; -use zeroize::Zeroize; +use zeroize::{Zeroize, ZeroizeOnDrop}; -#[derive(Clone, Debug, PartialEq, Eq, Zeroize, CanonicalSerialize, CanonicalDeserialize)] +#[derive( + Clone, Debug, PartialEq, Eq, Zeroize, ZeroizeOnDrop, CanonicalSerialize, CanonicalDeserialize, +)] pub struct AuditorSecretKey(pub E::ScalarField); #[derive(Clone, Debug, PartialEq, Eq, CanonicalSerialize, CanonicalDeserialize)] pub struct AuditorPublicKey(pub E::G1Affine); -impl Drop for AuditorSecretKey { - fn drop(&mut self) { - self.0.zeroize(); - } -} - impl AuditorSecretKey { pub fn new(rng: &mut R) -> Self { Self(E::ScalarField::rand(rng)) diff --git a/delegatable_credentials/src/mercurial_sig.rs b/delegatable_credentials/src/mercurial_sig.rs index 2639eb3b..6cd3282a 100644 --- a/delegatable_credentials/src/mercurial_sig.rs +++ b/delegatable_credentials/src/mercurial_sig.rs @@ -11,7 +11,7 @@ use ark_serialize::{CanonicalDeserialize, CanonicalSerialize}; use ark_std::{cfg_iter, fmt::Debug, rand::RngCore, vec::Vec, UniformRand}; use digest::DynDigest; -use zeroize::Zeroize; +use zeroize::{Zeroize, ZeroizeOnDrop}; use dock_crypto_utils::serde_utils::*; @@ -37,15 +37,10 @@ use crate::error::DelegationError; Serialize, Deserialize, Zeroize, + ZeroizeOnDrop, )] pub struct SecretKey(#[serde_as(as = "Vec")] pub Vec); -impl Drop for SecretKey { - fn drop(&mut self) { - self.0.zeroize(); - } -} - /// Public key used to verify `Signature` #[serde_as] #[derive( @@ -98,6 +93,7 @@ pub struct Signature { Serialize, Deserialize, Zeroize, + ZeroizeOnDrop, )] pub struct SignatureG2 { #[serde_as(as = "ArkObjectBytes")] @@ -108,14 +104,6 @@ pub struct SignatureG2 { pub Y_tilde: E::G1Affine, } -impl Drop for Signature { - fn drop(&mut self) { - self.Z.zeroize(); - self.Y.zeroize(); - self.Y_tilde.zeroize(); - } -} - impl SecretKey { pub fn new(rng: &mut R, size: usize) -> Result { if size == 0 { diff --git a/delegatable_credentials/src/msbm/keys.rs b/delegatable_credentials/src/msbm/keys.rs index 8ebbad41..76481daf 100644 --- a/delegatable_credentials/src/msbm/keys.rs +++ b/delegatable_credentials/src/msbm/keys.rs @@ -12,17 +12,19 @@ use ark_ff::{ use ark_serialize::{CanonicalDeserialize, CanonicalSerialize}; use ark_std::{cfg_iter, ops::Neg, rand::RngCore, vec, vec::Vec, UniformRand}; use digest::DynDigest; -use zeroize::Zeroize; +use zeroize::{Zeroize, ZeroizeOnDrop}; #[cfg(feature = "parallel")] use rayon::prelude::*; /// Secret key of the form `(x_0, (x_1, x_2, x_3, ..., x_n))`. The key `(x_1, x_2, x_3, ..., x_n)` is the /// secret key for the Mercurial signature scheme -#[derive(Clone, Debug, PartialEq, Eq, Zeroize, CanonicalSerialize, CanonicalDeserialize)] +#[derive( + Clone, Debug, PartialEq, Eq, Zeroize, ZeroizeOnDrop, CanonicalSerialize, CanonicalDeserialize, +)] pub struct RootIssuerSecretKey(pub E::ScalarField, pub SecretKey); -#[derive(Clone, Debug, PartialEq, Eq, Zeroize, CanonicalSerialize, CanonicalDeserialize)] +#[derive(Clone, Debug, PartialEq, Eq, CanonicalSerialize, CanonicalDeserialize)] pub struct RootIssuerPublicKey { /// `x_0*P1` pub X_0: E::G1Affine, @@ -39,17 +41,23 @@ pub struct PreparedRootIssuerPublicKey { pub X: PreparedPublicKey, } -#[derive(Clone, Debug, PartialEq, Eq, Zeroize, CanonicalSerialize, CanonicalDeserialize)] +#[derive( + Clone, Debug, PartialEq, Eq, Zeroize, ZeroizeOnDrop, CanonicalSerialize, CanonicalDeserialize, +)] pub struct UserSecretKey(pub E::ScalarField); #[derive(Clone, Debug, PartialEq, Eq, CanonicalSerialize, CanonicalDeserialize)] pub struct UserPublicKey(pub E::G1Affine); /// Key to update the credential, i.e. extend it with more commitments -#[derive(Clone, PartialEq, Eq, Debug, CanonicalSerialize, CanonicalDeserialize)] +#[derive( + Clone, PartialEq, Eq, Debug, Zeroize, ZeroizeOnDrop, CanonicalSerialize, CanonicalDeserialize, +)] pub struct UpdateKey { /// 0-based commitment index in the credential from which this key can add commitments + #[zeroize(skip)] pub start_index: usize, + #[zeroize(skip)] pub max_attributes_per_commitment: usize, /// One key for each commitment index in the signature pub keys: Vec>, @@ -73,13 +81,6 @@ impl RootIssuerSecretKey { } } -impl Drop for RootIssuerSecretKey { - fn drop(&mut self) { - self.0.zeroize(); - self.1 .0.zeroize(); - } -} - impl RootIssuerPublicKey { pub fn new(secret_key: &RootIssuerSecretKey, P1: &E::G1Affine, P2: &E::G2Affine) -> Self { let x_0 = secret_key.0.into_bigint(); @@ -101,12 +102,6 @@ impl From> for PreparedRootIssuerPublicKey } } -impl Drop for UserSecretKey { - fn drop(&mut self) { - self.0.zeroize(); - } -} - impl UserSecretKey { pub fn new(rng: &mut R) -> Self { Self(E::ScalarField::rand(rng)) @@ -151,12 +146,6 @@ impl UserPublicKey { } } -impl Drop for UpdateKey { - fn drop(&mut self) { - self.keys.zeroize(); - } -} - impl UpdateKey { pub fn randomize(&self, r: &E::ScalarField) -> Self { let r_repr = r.into_bigint(); diff --git a/delegatable_credentials/src/protego/keys.rs b/delegatable_credentials/src/protego/keys.rs index 8cbd19a6..587f80f9 100644 --- a/delegatable_credentials/src/protego/keys.rs +++ b/delegatable_credentials/src/protego/keys.rs @@ -7,11 +7,13 @@ use ark_ff::PrimeField; use ark_serialize::{CanonicalDeserialize, CanonicalSerialize}; use ark_std::{rand::RngCore, vec::Vec, UniformRand}; use digest::DynDigest; -use zeroize::Zeroize; +use zeroize::{Zeroize, ZeroizeOnDrop}; /// Secret key of the credential issuer. The size of the key would be at least 3 and at most 7 depending on it /// supporting revocation and/or audit as each feature adds 2 elements to the key -#[derive(Clone, Debug, PartialEq, Eq, Zeroize, CanonicalSerialize, CanonicalDeserialize)] +#[derive( + Clone, Debug, PartialEq, Eq, Zeroize, ZeroizeOnDrop, CanonicalSerialize, CanonicalDeserialize, +)] pub struct IssuerSecretKey { pub secret_key: SecretKey, /// Whether revocation is supported @@ -38,12 +40,6 @@ pub struct PreparedIssuerPublicKey { pub supports_audit: bool, } -impl Drop for IssuerSecretKey { - fn drop(&mut self) { - self.secret_key.0.zeroize(); - } -} - impl IssuerSecretKey { pub fn new( rng: &mut R, @@ -107,7 +103,9 @@ impl From> for PreparedIssuerPublicKey { } } -#[derive(Clone, Debug, PartialEq, Eq, Zeroize, CanonicalSerialize, CanonicalDeserialize)] +#[derive( + Clone, Debug, PartialEq, Eq, Zeroize, ZeroizeOnDrop, CanonicalSerialize, CanonicalDeserialize, +)] pub struct UserSecretKey(pub E::ScalarField, pub Option); /// Each user, i.e. credential receiver has key pair and when the credential supports auditability, the @@ -116,13 +114,6 @@ pub struct UserSecretKey(pub E::ScalarField, pub Option(pub E::G1Affine, pub Option); -impl Drop for UserSecretKey { - fn drop(&mut self) { - self.0.zeroize(); - self.1.zeroize(); - } -} - impl UserSecretKey { pub fn new(rng: &mut R, supports_revocation: bool) -> Self { Self( diff --git a/legogroth16/Cargo.toml b/legogroth16/Cargo.toml index c7f45fbe..4c5ce583 100644 --- a/legogroth16/Cargo.toml +++ b/legogroth16/Cargo.toml @@ -46,9 +46,6 @@ tracing-subscriber = { version = "0.2" } hex-literal = "0.2.1" serde_json = "1.0.64" -[profile.release] -lto = true - [features] default = ["parallel", "circom", "aggregation"] std = ["ark-ff/std", "ark-ec/std", "ark-poly/std", "ark-relations/std", "ark-std/std", "wasmer-sys", "ark-groth16/std", "dock_crypto_utils/std" ] diff --git a/proof_system/src/witness.rs b/proof_system/src/witness.rs index 6b192189..ed6c20c6 100644 --- a/proof_system/src/witness.rs +++ b/proof_system/src/witness.rs @@ -7,7 +7,7 @@ use dock_crypto_utils::serde_utils::*; use serde::{Deserialize, Serialize}; use serde_with::{serde_as, Same}; use vb_accumulator::witness::{MembershipWitness, NonMembershipWitness}; -use zeroize::Zeroize; +use zeroize::{Zeroize, ZeroizeOnDrop}; use crate::error::ProofSystemError; pub use serialization::*; @@ -115,7 +115,7 @@ impl Zeroize for PoKBBSSignatureG1 { self.signature.zeroize(); self.unrevealed_messages .values_mut() - .for_each(|v| v.zeroize()); + .for_each(|v| v.zeroize()) } } @@ -128,7 +128,16 @@ impl Drop for PoKBBSSignatureG1 { /// Secret data when proving accumulator membership #[serde_as] #[derive( - Clone, Debug, PartialEq, Eq, CanonicalSerialize, CanonicalDeserialize, Serialize, Deserialize, + Clone, + Debug, + PartialEq, + Eq, + Zeroize, + ZeroizeOnDrop, + CanonicalSerialize, + CanonicalDeserialize, + Serialize, + Deserialize, )] #[serde(bound = "")] pub struct Membership { @@ -137,23 +146,19 @@ pub struct Membership { pub witness: MembershipWitness, } -impl Zeroize for Membership { - fn zeroize(&mut self) { - self.element.zeroize(); - self.witness.zeroize(); - } -} - -impl Drop for Membership { - fn drop(&mut self) { - self.zeroize(); - } -} - /// Secret data when proving accumulator non-membership #[serde_as] #[derive( - Clone, Debug, PartialEq, Eq, CanonicalSerialize, CanonicalDeserialize, Serialize, Deserialize, + Clone, + Debug, + PartialEq, + Eq, + Zeroize, + ZeroizeOnDrop, + CanonicalSerialize, + CanonicalDeserialize, + Serialize, + Deserialize, )] #[serde(bound = "")] pub struct NonMembership { @@ -162,19 +167,6 @@ pub struct NonMembership { pub witness: NonMembershipWitness, } -impl Zeroize for NonMembership { - fn zeroize(&mut self) { - self.element.zeroize(); - self.witness.zeroize(); - } -} - -impl Drop for NonMembership { - fn drop(&mut self) { - self.zeroize(); - } -} - /// Witness for the Circom program. Only contains circuit wires that are explicitly set by the prover #[serde_as] #[derive( diff --git a/proof_system/tests/bbs_plus_and_accumulator.rs b/proof_system/tests/bbs_plus_and_accumulator.rs index 77d1cd10..74cfa107 100644 --- a/proof_system/tests/bbs_plus_and_accumulator.rs +++ b/proof_system/tests/bbs_plus_and_accumulator.rs @@ -62,13 +62,13 @@ fn pok_of_3_bbs_plus_sig_and_message_equality() { let sig_2 = SignatureG1::::new(&mut rng, &msgs_2, &keypair_2.secret_key, ¶ms_2).unwrap(); sig_2 - .verify(&msgs_2, &keypair_2.public_key, ¶ms_2) + .verify(&msgs_2, keypair_2.public_key.clone(), params_2.clone()) .unwrap(); let sig_3 = SignatureG1::::new(&mut rng, &msgs_3, &keypair_3.secret_key, ¶ms_3).unwrap(); sig_3 - .verify(&msgs_3, &keypair_3.public_key, ¶ms_3) + .verify(&msgs_3, keypair_3.public_key.clone(), params_3.clone()) .unwrap(); // Prepare revealed messages for the proof of knowledge of 1st signature @@ -999,7 +999,7 @@ fn requesting_partially_blind_bbs_plus_sig() { .unwrap(); let sig = blinded_sig.unblind(&blinding); - sig.verify(&msgs, &sig_keypair.public_key, &sig_params) + sig.verify(&msgs, sig_keypair.public_key.clone(), sig_params.clone()) .unwrap(); } @@ -1022,7 +1022,7 @@ fn proof_spec_modification() { let sig_2 = SignatureG1::::new(&mut rng, &msgs_2, &keypair_2.secret_key, ¶ms_2).unwrap(); sig_2 - .verify(&msgs_2, &keypair_2.public_key, ¶ms_2) + .verify(&msgs_2, keypair_2.public_key.clone(), params_2.clone()) .unwrap(); let mut statements = Statements::::G1Affine>::new(); diff --git a/saver/src/keygen.rs b/saver/src/keygen.rs index 6d9a169e..4243cecc 100644 --- a/saver/src/keygen.rs +++ b/saver/src/keygen.rs @@ -7,7 +7,7 @@ use ark_serialize::{CanonicalDeserialize, CanonicalSerialize}; use ark_std::{cfg_iter, rand::RngCore, vec::Vec, UniformRand}; use serde::{Deserialize, Serialize}; use serde_with::serde_as; -use zeroize::Zeroize; +use zeroize::{Zeroize, ZeroizeOnDrop}; #[cfg(feature = "parallel")] use rayon::prelude::*; @@ -27,15 +27,10 @@ use dock_crypto_utils::{msm::multiply_field_elems_with_same_group_elem, serde_ut Serialize, Deserialize, Zeroize, + ZeroizeOnDrop, )] pub struct SecretKey(#[serde_as(as = "ArkObjectBytes")] pub F); -impl Drop for SecretKey { - fn drop(&mut self) { - self.zeroize(); - } -} - /// Used to encrypt, rerandomize and verify the encryption. Called "PK" in the paper. #[serde_as] #[derive( diff --git a/schnorr_pok/src/lib.rs b/schnorr_pok/src/lib.rs index 6bb603e4..998a7f97 100644 --- a/schnorr_pok/src/lib.rs +++ b/schnorr_pok/src/lib.rs @@ -31,7 +31,7 @@ use ark_ff::PrimeField; use ark_serialize::{CanonicalDeserialize, CanonicalSerialize}; use ark_std::{cfg_iter, fmt::Debug, io::Write, ops::Add, vec::Vec}; use digest::Digest; -use zeroize::Zeroize; +use zeroize::{Zeroize, ZeroizeOnDrop}; use dock_crypto_utils::hashing_utils::field_elem_from_try_and_incr; @@ -53,13 +53,23 @@ pub trait SchnorrChallengeContributor { /// Commitment to randomness during step 1 of the Schnorr protocol to prove knowledge of 1 or more discrete logs #[serde_as] #[derive( - Clone, Debug, PartialEq, Eq, CanonicalSerialize, CanonicalDeserialize, Serialize, Deserialize, + Clone, + Debug, + PartialEq, + Eq, + Zeroize, + ZeroizeOnDrop, + CanonicalSerialize, + CanonicalDeserialize, + Serialize, + Deserialize, )] pub struct SchnorrCommitment { /// Randomness. 1 per discrete log #[serde_as(as = "Vec")] pub blindings: Vec, /// The commitment to all the randomnesses, i.e. `bases[0] * blindings[0] + ... + bases[i] * blindings[i]` + #[zeroize(skip)] #[serde_as(as = "ArkObjectBytes")] pub t: G, } @@ -95,19 +105,6 @@ where } } -impl Zeroize for SchnorrCommitment { - fn zeroize(&mut self) { - // Not zeroizing `self.t` as its public - self.blindings.zeroize(); - } -} - -impl Drop for SchnorrCommitment { - fn drop(&mut self) { - self.zeroize(); - } -} - impl SchnorrChallengeContributor for SchnorrCommitment where G: AffineRepr, diff --git a/secret_sharing_and_dkg/src/common.rs b/secret_sharing_and_dkg/src/common.rs index 4b75b6e2..c7b1890a 100644 --- a/secret_sharing_and_dkg/src/common.rs +++ b/secret_sharing_and_dkg/src/common.rs @@ -3,7 +3,7 @@ use ark_ff::PrimeField; use ark_serialize::{CanonicalDeserialize, CanonicalSerialize}; use ark_std::{cfg_into_iter, cfg_iter, vec::Vec}; -use zeroize::Zeroize; +use zeroize::{Zeroize, ZeroizeOnDrop}; #[cfg(feature = "parallel")] use rayon::prelude::*; @@ -13,22 +13,30 @@ pub type ShareId = u16; pub type ParticipantId = u16; /// Share used in Shamir secret sharing and Feldman verifiable secret sharing -#[derive(Clone, Debug, PartialEq, Eq, Zeroize, CanonicalSerialize, CanonicalDeserialize)] +#[derive( + Clone, Debug, PartialEq, Eq, Zeroize, ZeroizeOnDrop, CanonicalSerialize, CanonicalDeserialize, +)] pub struct Share { + #[zeroize(skip)] pub id: ShareId, + #[zeroize(skip)] pub threshold: ShareId, pub share: F, } /// Collection of `Share`s. A sufficient number of `Share`s reconstruct the secret. /// Expects unique shares, i.e. each share has a different `ShareId` and each has the same threshold. -#[derive(Clone, Debug, PartialEq, Eq, Zeroize, CanonicalSerialize, CanonicalDeserialize)] +#[derive(Clone, Debug, PartialEq, Eq, CanonicalSerialize, CanonicalDeserialize)] pub struct Shares(pub Vec>); /// Share used in Pedersen verifiable secret sharing -#[derive(Clone, Debug, PartialEq, Eq, Zeroize, CanonicalSerialize, CanonicalDeserialize)] +#[derive( + Clone, Debug, PartialEq, Eq, Zeroize, ZeroizeOnDrop, CanonicalSerialize, CanonicalDeserialize, +)] pub struct VerifiableShare { + #[zeroize(skip)] pub id: ShareId, + #[zeroize(skip)] pub threshold: ShareId, pub secret_share: F, pub blinding_share: F, @@ -36,22 +44,16 @@ pub struct VerifiableShare { /// Collection of `VerifiableShares`s. A sufficient number of `VerifiableShares`s reconstruct the secret. /// Expects unique shares, i.e. each share has a different `ShareId` and each has the same threshold. -#[derive(Clone, Debug, PartialEq, Eq, Zeroize, CanonicalSerialize, CanonicalDeserialize)] +#[derive(Clone, Debug, PartialEq, Eq, CanonicalSerialize, CanonicalDeserialize)] pub struct VerifiableShares(pub Vec>); /// Commitments to coefficients of the of the polynomial created during secret sharing. Each commitment /// in the vector could be a Pedersen commitment or a computationally hiding and computationally binding /// commitment (scalar multiplication of the coefficient with a public group element). The former is used /// in Pedersen secret sharing and the latter in Feldman -#[derive(Clone, Debug, PartialEq, Eq, Zeroize, CanonicalSerialize, CanonicalDeserialize)] +#[derive(Clone, Debug, PartialEq, Eq, CanonicalSerialize, CanonicalDeserialize)] pub struct CommitmentToCoefficients(pub Vec); -impl Drop for Share { - fn drop(&mut self) { - self.share.zeroize(); - } -} - impl From<(ShareId, ShareId, F)> for Share { fn from((i, t, s): (ShareId, ShareId, F)) -> Self { Share { @@ -62,13 +64,6 @@ impl From<(ShareId, ShareId, F)> for Share { } } -impl Drop for VerifiableShare { - fn drop(&mut self) { - self.secret_share.zeroize(); - self.blinding_share.zeroize(); - } -} - impl Shares { pub fn threshold(&self) -> ShareId { self.0[0].threshold diff --git a/secret_sharing_and_dkg/src/feldman_dvss_dkg.rs b/secret_sharing_and_dkg/src/feldman_dvss_dkg.rs index d80ca3e5..e0fe2d6e 100644 --- a/secret_sharing_and_dkg/src/feldman_dvss_dkg.rs +++ b/secret_sharing_and_dkg/src/feldman_dvss_dkg.rs @@ -14,7 +14,7 @@ use zeroize::Zeroize; use rayon::prelude::*; /// Used by a participant to store received shares and commitment coefficients. -#[derive(Clone, Debug, PartialEq, Eq, Zeroize, CanonicalSerialize, CanonicalDeserialize)] +#[derive(Clone, Debug, PartialEq, Eq, CanonicalSerialize, CanonicalDeserialize)] pub struct SharesAccumulator { pub participant_id: ParticipantId, pub threshold: ShareId, @@ -22,6 +22,12 @@ pub struct SharesAccumulator { pub coeff_comms: BTreeMap>, } +impl Zeroize for SharesAccumulator { + fn zeroize(&mut self) { + self.shares.values_mut().for_each(|v| v.zeroize()) + } +} + impl SharesAccumulator { pub fn new(id: ParticipantId, threshold: ShareId) -> Self { Self { diff --git a/secret_sharing_and_dkg/src/pedersen_dvss.rs b/secret_sharing_and_dkg/src/pedersen_dvss.rs index d098a58f..e833541e 100644 --- a/secret_sharing_and_dkg/src/pedersen_dvss.rs +++ b/secret_sharing_and_dkg/src/pedersen_dvss.rs @@ -22,7 +22,7 @@ use crate::{ }; /// Used by a participant to store received shares and commitment coefficients. -#[derive(Clone, Debug, PartialEq, Eq, Zeroize, CanonicalSerialize, CanonicalDeserialize)] +#[derive(Clone, Debug, PartialEq, Eq, CanonicalSerialize, CanonicalDeserialize)] pub struct SharesAccumulator { pub participant_id: ParticipantId, pub threshold: ShareId, @@ -30,6 +30,12 @@ pub struct SharesAccumulator { pub coeff_comms: BTreeMap>, } +impl Zeroize for SharesAccumulator { + fn zeroize(&mut self) { + self.shares.values_mut().for_each(|v| v.zeroize()) + } +} + impl SharesAccumulator { pub fn new(id: ParticipantId, threshold: ShareId) -> Self { Self { diff --git a/secret_sharing_and_dkg/src/pedersen_vss.rs b/secret_sharing_and_dkg/src/pedersen_vss.rs index b8929535..01e7c4ae 100644 --- a/secret_sharing_and_dkg/src/pedersen_vss.rs +++ b/secret_sharing_and_dkg/src/pedersen_vss.rs @@ -105,14 +105,11 @@ pub fn deal_secret( VerifiableShares( cfg_into_iter!(s_shares.0) .zip(cfg_into_iter!(t_shares.0)) - .map(|(s, t)| { - assert_eq!(s.id, t.id); - VerifiableShare { - id: s.id, - threshold, - secret_share: s.share, - blinding_share: t.share, - } + .map(|(s, t)| VerifiableShare { + id: s.id, + threshold, + secret_share: s.share, + blinding_share: t.share, }) .collect(), ), diff --git a/test_utils/src/bbs_plus.rs b/test_utils/src/bbs_plus.rs index 8efe389a..2b341f39 100644 --- a/test_utils/src/bbs_plus.rs +++ b/test_utils/src/bbs_plus.rs @@ -29,6 +29,7 @@ pub fn sig_setup_given_messages( let params = SignatureParamsG1::::generate_using_rng(rng, messages.len()); let keypair = KeypairG2::::generate_using_rng(rng, ¶ms); let sig = SignatureG1::::new(rng, messages, &keypair.secret_key, ¶ms).unwrap(); - sig.verify(messages, &keypair.public_key, ¶ms).unwrap(); + sig.verify(messages, keypair.public_key.clone(), params.clone()) + .unwrap(); (params, keypair, sig) } diff --git a/vb_accumulator/src/proofs.rs b/vb_accumulator/src/proofs.rs index 1767ca9b..0db3d5c5 100644 --- a/vb_accumulator/src/proofs.rs +++ b/vb_accumulator/src/proofs.rs @@ -107,7 +107,7 @@ use ark_std::{fmt::Debug, io::Write, rand::RngCore, vec::Vec, UniformRand}; use digest::Digest; use dock_crypto_utils::{hashing_utils::projective_group_elem_from_try_and_incr, serde_utils::*}; use schnorr_pok::{error::SchnorrError, SchnorrChallengeContributor}; -use zeroize::Zeroize; +use zeroize::{Zeroize, ZeroizeOnDrop}; use dock_crypto_utils::{ concat_slices, msm::WindowTable, randomized_pairing_check::RandomizedPairingChecker, @@ -232,7 +232,16 @@ where /// Common elements of the randomized witness between membership and non-membership witness #[serde_as] #[derive( - Clone, PartialEq, Eq, Debug, CanonicalSerialize, CanonicalDeserialize, Serialize, Deserialize, + Clone, + PartialEq, + Eq, + Debug, + Zeroize, + ZeroizeOnDrop, + CanonicalSerialize, + CanonicalDeserialize, + Serialize, + Deserialize, )] pub struct RandomizedWitness { #[serde_as(as = "ArkObjectBytes")] @@ -255,6 +264,7 @@ pub struct RandomizedWitness { Serialize, Deserialize, Zeroize, + ZeroizeOnDrop, )] pub struct Blindings { #[serde_as(as = "ArkObjectBytes")] @@ -316,7 +326,16 @@ pub struct SchnorrResponse { /// Randomized membership witness #[serde_as] #[derive( - Clone, PartialEq, Eq, Debug, CanonicalSerialize, CanonicalDeserialize, Serialize, Deserialize, + Clone, + PartialEq, + Eq, + Debug, + Zeroize, + ZeroizeOnDrop, + CanonicalSerialize, + CanonicalDeserialize, + Serialize, + Deserialize, )] pub struct MembershipRandomizedWitness( #[serde( @@ -337,6 +356,7 @@ pub struct MembershipRandomizedWitness( Serialize, Deserialize, Zeroize, + ZeroizeOnDrop, )] pub struct MembershipBlindings( #[serde(bound = "Blindings: Serialize, for<'a> Blindings: Deserialize<'a>")] @@ -386,7 +406,16 @@ pub struct MembershipProof { /// Protocol for proving knowledge of the member and the membership witness #[serde_as] #[derive( - Clone, PartialEq, Eq, Debug, CanonicalSerialize, CanonicalDeserialize, Serialize, Deserialize, + Clone, + PartialEq, + Eq, + Debug, + Zeroize, + ZeroizeOnDrop, + CanonicalSerialize, + CanonicalDeserialize, + Serialize, + Deserialize, )] pub struct MembershipProofProtocol { #[serde_as(as = "ArkObjectBytes")] @@ -395,6 +424,7 @@ pub struct MembershipProofProtocol { bound = "MembershipRandomizedWitness: Serialize, for<'a> MembershipRandomizedWitness: Deserialize<'a>" )] pub randomized_witness: MembershipRandomizedWitness, + #[zeroize(skip)] #[serde( bound = "MembershipSchnorrCommit: Serialize, for<'a> MembershipSchnorrCommit: Deserialize<'a>" )] @@ -408,7 +438,16 @@ pub struct MembershipProofProtocol { /// Randomized non-membership witness #[serde_as] #[derive( - Clone, PartialEq, Eq, Debug, CanonicalSerialize, CanonicalDeserialize, Serialize, Deserialize, + Clone, + PartialEq, + Eq, + Debug, + Zeroize, + ZeroizeOnDrop, + CanonicalSerialize, + CanonicalDeserialize, + Serialize, + Deserialize, )] pub struct NonMembershipRandomizedWitness { #[serde( @@ -433,6 +472,7 @@ pub struct NonMembershipRandomizedWitness { Serialize, Deserialize, Zeroize, + ZeroizeOnDrop, )] pub struct NonMembershipBlindings { #[serde(bound = "Blindings: Serialize, for<'a> Blindings: Deserialize<'a>")] @@ -502,7 +542,16 @@ pub struct NonMembershipProof { /// Protocol for proving knowledge of the non-member and the non-membership witness #[serde_as] #[derive( - Clone, PartialEq, Eq, Debug, CanonicalSerialize, CanonicalDeserialize, Serialize, Deserialize, + Clone, + PartialEq, + Eq, + Debug, + Zeroize, + ZeroizeOnDrop, + CanonicalSerialize, + CanonicalDeserialize, + Serialize, + Deserialize, )] pub struct NonMembershipProofProtocol { #[serde_as(as = "ArkObjectBytes")] @@ -513,6 +562,7 @@ pub struct NonMembershipProofProtocol { bound = "NonMembershipRandomizedWitness: Serialize, for<'a> NonMembershipRandomizedWitness: Deserialize<'a>" )] pub randomized_witness: NonMembershipRandomizedWitness, + #[zeroize(skip)] #[serde( bound = "NonMembershipSchnorrCommit: Serialize, for<'a> NonMembershipSchnorrCommit: Deserialize<'a>" )] @@ -1129,20 +1179,6 @@ where } } -impl Zeroize for MembershipProofProtocol { - fn zeroize(&mut self) { - // Other members of `self` are public anyway - self.element.zeroize(); - self.schnorr_blindings.zeroize(); - } -} - -impl Drop for MembershipProofProtocol { - fn drop(&mut self) { - self.zeroize(); - } -} - impl ProofProtocol for NonMembershipProofProtocol where E: Pairing {} impl NonMembershipProofProtocol @@ -1283,21 +1319,6 @@ where } } -impl Zeroize for NonMembershipProofProtocol { - fn zeroize(&mut self) { - // Other members of `self` are public anyway - self.element.zeroize(); - self.d.zeroize(); - self.schnorr_blindings.zeroize(); - } -} - -impl Drop for NonMembershipProofProtocol { - fn drop(&mut self) { - self.zeroize(); - } -} - impl MembershipProof where E: Pairing, diff --git a/vb_accumulator/src/setup.rs b/vb_accumulator/src/setup.rs index f5233a3a..113de122 100644 --- a/vb_accumulator/src/setup.rs +++ b/vb_accumulator/src/setup.rs @@ -35,7 +35,7 @@ use ark_ff::{ }; use ark_serialize::{CanonicalDeserialize, CanonicalSerialize}; use ark_std::{fmt::Debug, io::Write, rand::RngCore, vec::Vec, UniformRand}; -use zeroize::Zeroize; +use zeroize::{Zeroize, ZeroizeOnDrop}; use digest::{Digest, DynDigest}; use schnorr_pok::{error::SchnorrError, impl_proof_of_knowledge_of_discrete_log}; @@ -59,15 +59,10 @@ use serde_with::serde_as; Serialize, Deserialize, Zeroize, + ZeroizeOnDrop, )] pub struct SecretKey(#[serde_as(as = "ArkObjectBytes")] pub F); -impl Drop for SecretKey { - fn drop(&mut self) { - self.zeroize(); - } -} - /// Public key for accumulator manager #[serde_as] #[derive( @@ -76,10 +71,20 @@ impl Drop for SecretKey { pub struct PublicKey(#[serde_as(as = "ArkObjectBytes")] pub E::G2Affine); #[derive( - Clone, PartialEq, Eq, Debug, CanonicalSerialize, CanonicalDeserialize, Serialize, Deserialize, + Clone, + PartialEq, + Eq, + Debug, + Zeroize, + ZeroizeOnDrop, + CanonicalSerialize, + CanonicalDeserialize, + Serialize, + Deserialize, )] pub struct Keypair { pub secret_key: SecretKey, + #[zeroize(skip)] pub public_key: PublicKey, } @@ -181,18 +186,6 @@ where } } -impl Zeroize for Keypair { - fn zeroize(&mut self) { - self.secret_key.zeroize(); - } -} - -impl Drop for Keypair { - fn drop(&mut self) { - self.zeroize(); - } -} - impl PublicKey { /// Generate public key from given secret key and signature parameters pub fn new_from_secret_key( diff --git a/vb_accumulator/src/witness.rs b/vb_accumulator/src/witness.rs index 4785e1a8..1ba00189 100644 --- a/vb_accumulator/src/witness.rs +++ b/vb_accumulator/src/witness.rs @@ -103,7 +103,7 @@ use ark_ff::{batch_inversion, fields::Field, One, PrimeField}; use ark_serialize::{CanonicalDeserialize, CanonicalSerialize}; use ark_std::{cfg_into_iter, cfg_iter, fmt::Debug, vec::Vec}; use dock_crypto_utils::serde_utils::*; -use zeroize::Zeroize; +use zeroize::{Zeroize, ZeroizeOnDrop}; use serde::{Deserialize, Serialize}; use serde_with::serde_as; @@ -448,6 +448,7 @@ pub trait Witness { Serialize, Deserialize, Zeroize, + ZeroizeOnDrop, )] pub struct MembershipWitness(#[serde_as(as = "ArkObjectBytes")] pub G); @@ -463,6 +464,7 @@ pub struct MembershipWitness(#[serde_as(as = "ArkObjectBytes")] p Serialize, Deserialize, Zeroize, + ZeroizeOnDrop, )] pub struct NonMembershipWitness { #[serde_as(as = "ArkObjectBytes")] @@ -471,18 +473,6 @@ pub struct NonMembershipWitness { pub C: G, } -impl Drop for MembershipWitness { - fn drop(&mut self) { - self.zeroize(); - } -} - -impl Drop for NonMembershipWitness { - fn drop(&mut self) { - self.zeroize(); - } -} - impl Witness for MembershipWitness where G: AffineRepr {} impl MembershipWitness