{"id":26233635,"url":"https://github.com/docknetwork/crypto","last_synced_at":"2025-04-11T23:20:05.288Z","repository":{"id":44534910,"uuid":"391902476","full_name":"docknetwork/crypto","owner":"docknetwork","description":"Rust crypto library for data privacy tools","archived":false,"fork":false,"pushed_at":"2025-04-10T11:56:31.000Z","size":74079,"stargazers_count":101,"open_issues_count":6,"forks_count":36,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-04-10T12:58:49.885Z","etag":null,"topics":["accumulator","anonymous-credentials","cryptography","delegatable-credentials","distributed-key-generation","dkg","group-signatures","oblivious-transfer","publicly-verifiable-secret-sharing","range-proofs","schnorr","secret-sharing","sigma-protocol","signatures","structure-preserving-signatures","threshold-signatures","verifiable-encryption","verifiable-secret-sharing","zero-knowledge-proofs","zk-snarks"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/docknetwork.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-02T10:17:00.000Z","updated_at":"2025-04-10T11:56:36.000Z","dependencies_parsed_at":"2024-03-29T15:27:11.521Z","dependency_job_id":"86c2ac4e-1705-4a73-aa34-003459a1f05a","html_url":"https://github.com/docknetwork/crypto","commit_stats":{"total_commits":160,"total_committers":4,"mean_commits":40.0,"dds":"0.23750000000000004","last_synced_commit":"f96be8d06083321f306b7adf0d418367582f9b1f"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docknetwork%2Fcrypto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docknetwork%2Fcrypto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docknetwork%2Fcrypto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docknetwork%2Fcrypto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/docknetwork","download_url":"https://codeload.github.com/docknetwork/crypto/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248225648,"owners_count":21068078,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["accumulator","anonymous-credentials","cryptography","delegatable-credentials","distributed-key-generation","dkg","group-signatures","oblivious-transfer","publicly-verifiable-secret-sharing","range-proofs","schnorr","secret-sharing","sigma-protocol","signatures","structure-preserving-signatures","threshold-signatures","verifiable-encryption","verifiable-secret-sharing","zero-knowledge-proofs","zk-snarks"],"created_at":"2025-03-13T01:16:54.909Z","updated_at":"2025-04-11T23:20:05.265Z","avatar_url":"https://github.com/docknetwork.png","language":"Rust","readme":"# TBD\n\n[![CI](https://github.com/docknetwork/crypto/actions/workflows/test.yml/badge.svg)](https://github.com/docknetwork/crypto/actions/workflows/test.yml)\n[![Apache-2](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/docknetwork/crypto/blob/main/LICENSE)\n[![Dependencies](https://deps.rs/repo/github/docknetwork/crypto/status.svg)](https://deps.rs/repo/github/docknetwork/crypto)\n\nLibrary providing privacy enhancing cryptographic primitives.\n\n## Primitives\n\n1. [Schnorr proof of knowledge protocol](./schnorr_pok) to prove knowledge of discrete log and inequality of discrete logs. [This](https://crypto.stanford.edu/cs355/19sp/lec5.pdf) is a good reference. \n2. [BBS and BBS+ signatures](./bbs_plus) for anonymous credentials. BBS+ is based on the paper [Anonymous Attestation Using the Strong Diffie Hellman Assumption Revisited](https://eprint.iacr.org/2016/663) and \n   BBS is based on the paper [Revisiting BBS Signatures](https://eprint.iacr.org/2023/275). Also implements the threshold variants of these based on the paper [Threshold BBS+ Signatures for Distributed Anonymous Credential Issuance](https://eprint.iacr.org/2023/602)\n3. [Dynamic accumulators, both positive and universal](./vb_accumulator). Based on the papers [Dynamic Universal Accumulator with Batch Update over Bilinear Groups](https://eprint.iacr.org/2020/777) and [Efficient Constructions of Pairing Based Accumulators](https://eprint.iacr.org/2021/638). Implements a keyed-verification variant of these accumulators as well which does not require pairings.\n4. [Composite proof system](./proof_system) that combines above primitives for use cases like \n   - prove knowledge of a BBS+ signature and the corresponding messages\n   - prove knowledge of a modified PS signature and the corresponding messages\n   - equality of signed messages (from same or different signatures) in zero knowledge\n   - inequality of signed messages with public or committed values in zero knowledge\n   - the (non)membership of a certain signed message(s)in the accumulator\n   - numeric bounds (min, max) on the messages can be proved in zero-knowledge \n   - verifiable encryption of signed messages under BBS+ or PS. \n   - zk-SNARK created from R1CS and WASM generated by [Circom](https://docs.circom.io/) with witnesses as BBS+ signed messages (not exclusively though). \n5. [Verifiable encryption](./saver) using [SAVER](https://eprint.iacr.org/2019/1270).\n6. [Compression and amortization of Sigma protocols](./compressed_sigma). This is PoC implementation.\n7. [Secret sharing schemes and DKG](./secret_sharing_and_dkg). Implements several verifiable secret sharing schemes and DKG from Gennaro and FROST. Also implements protocol to do a distributed DLOG check.\n8. [Cocount and PS signatures](./coconut/). Based on the paper [Security Analysis of Coconut, an Attribute-Based Credential Scheme with Threshold Issuance](https://eprint.iacr.org/2022/011)\n9. [LegoGroth16](./legogroth16/).  LegoGroth16, the [LegoSNARK](https://eprint.iacr.org/2019/142) variant of [Groth16](https://eprint.iacr.org/2016/260) zkSNARK proof system\n10. [Oblivious Transfer (OT) and Oblivious Transfer Extensions (OTE)](./oblivious_transfer).\n11. [Short group signatures](./short_group_sig/). BB signature and weak-BB signature and their proofs of knowledge based on the papers [Short Signatures Without Random Oracles](https://eprint.iacr.org/2004/171) and [Scalable Revocation Scheme for Anonymous Credentials Based on n-times Unlinkable Proofs](http://library.usc.edu.ph/ACM/SIGSAC%202017/wpes/p123.pdf).\n12. [Keyed-Verification Anonymous Credentials (KVAC)](./kvac). Implements Keyed-Verification Anonymous Credentials (KVAC) schemes.\n13. [SyRA](./syra). Implements sybil resilient signatures to be used for generating pseudonyms for low-entropy credential attributes.\n14. [Verifiable encryption](./verifiable_encryption) using the paper [Verifiable Encryption from MPC-in-the-Head](https://eprint.iacr.org/2021/1704.pdf).\n\n## Composite proof system\n\nThe [proof system](./proof_system) that uses above-mentioned primitives. \n\n## Build\n\n`cargo build` or `cargo build --release`\n\nBy default, it uses standard library and [rayon](https://github.com/rayon-rs/rayon) for parallelization\n\nTo build with standard library but without parallelization, use `cargo build --no-default-features --features=std`\n\nFor `no_std` support, build as `cargo build --no-default-features --features=wasmer-sys`\n\nFor WASM, build as `cargo build --no-default-features --features=wasmer-js --target wasm32-unknown-unknown`\n\n## Test\n\n`cargo test`\n\nThe above maybe slower as it runs the tests in debug mode and some tests work on large inputs. \nFor running tests faster, run `cargo test --release`\n\n## Benchmarking\n\n[Criterion](https://github.com/bheisler/criterion.rs) benchmarks [here](./benches)\n\nSome tests also print time consumed by the operations, run `cargo test --release -- --nocapture [test name]`\n\n## WASM wrapper\n\nA WASM wrapper has been created over this repo [here](https://github.com/docknetwork/crypto-wasm). The wrapper is then used to create [this Typescript library](https://github.com/docknetwork/crypto-wasm-ts) which is more ergonomic than using the wrapper as the wrapper contains free floating functions.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdocknetwork%2Fcrypto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdocknetwork%2Fcrypto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdocknetwork%2Fcrypto/lists"}