{"id":13630458,"url":"https://github.com/Consensys/gnark-crypto","last_synced_at":"2025-04-17T13:32:37.341Z","repository":{"id":36959479,"uuid":"249487917","full_name":"Consensys/gnark-crypto","owner":"Consensys","description":"gnark-crypto provides elliptic curve and pairing-based cryptography on BN, BLS12, BLS24 and BW6 curves. It also provides various algorithms (algebra, crypto) of particular interest to zero knowledge proof systems.","archived":false,"fork":false,"pushed_at":"2024-10-18T02:55:27.000Z","size":36237,"stargazers_count":495,"open_issues_count":59,"forks_count":162,"subscribers_count":16,"default_branch":"master","last_synced_at":"2024-10-19T05:42:29.286Z","etag":null,"topics":["biginteger","bls12-377","bls12-381","bn254","crypto","cryptography","ecc","eddsa","elliptic-curves","finite-field-arithmetic","fri","go","golang","hash-to-curve","mimc","pairing","snark","zkp","zksnark"],"latest_commit_sha":null,"homepage":"","language":"Go","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/Consensys.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":"CITATION.bib","codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-23T16:43:31.000Z","updated_at":"2024-10-18T11:14:08.000Z","dependencies_parsed_at":"2023-12-19T04:16:49.258Z","dependency_job_id":"0a912837-bd31-4347-a3d8-85df8c1ab9a9","html_url":"https://github.com/Consensys/gnark-crypto","commit_stats":{"total_commits":1845,"total_committers":24,"mean_commits":76.875,"dds":0.7360433604336043,"last_synced_commit":"564b6f724c3beac52d805e6e600d0a1fda9770b5"},"previous_names":["consensys/gurvy"],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Consensys%2Fgnark-crypto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Consensys%2Fgnark-crypto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Consensys%2Fgnark-crypto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Consensys%2Fgnark-crypto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Consensys","download_url":"https://codeload.github.com/Consensys/gnark-crypto/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223757596,"owners_count":17197577,"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":["biginteger","bls12-377","bls12-381","bn254","crypto","cryptography","ecc","eddsa","elliptic-curves","finite-field-arithmetic","fri","go","golang","hash-to-curve","mimc","pairing","snark","zkp","zksnark"],"created_at":"2024-08-01T22:01:43.834Z","updated_at":"2025-04-17T13:32:37.330Z","avatar_url":"https://github.com/Consensys.png","language":"Go","funding_links":[],"categories":["Go","Smart Contract Platforms"],"sub_categories":[],"readme":"# gnark-crypto\n\n[![Twitter URL](https://img.shields.io/twitter/url/https/twitter.com/gnark_team.svg?style=social\u0026label=Follow%20%40gnark_team)](https://x.com/gnark_team) [![License](https://img.shields.io/badge/license-Apache%202-blue)](LICENSE)  [![Go Report Card](https://goreportcard.com/badge/github.com/Consensys/gnark-crypto)](https://goreportcard.com/badge/github.com/Consensys/gnark-crypto) [![PkgGoDev](https://pkg.go.dev/badge/mod/github.com/consensys/gnark-crypto)](https://pkg.go.dev/mod/github.com/consensys/gnark-crypto) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.5815453.svg)](https://doi.org/10.5281/zenodo.5815453)\n\n`gnark-crypto` provides efficient cryptographic primitives, in Go:\n\n* Elliptic curve cryptography \u0026 **Pairing** on:\n  * [`bn254`] ([audit report](https://github.com/consensys/gnark/blob/master/audits/2022-10%20-%20Kudelski%20-%20gnark-crypto.pdf))\n  * [`bls12-381`] ([audit report](https://github.com/consensys/gnark/blob/master/audits/2022-10%20-%20Kudelski%20-%20gnark-crypto.pdf))\n  * [`bls24-317`]\n  * [`bls12-377`] / [`bw6-761`]\n  * [`bls24-315`] / [`bw6-633`]\n  * Each of these curves has a [`twistededwards`] sub-package with its companion curve which allow efficient elliptic curve cryptography inside zkSNARK circuits.\n* [`field/goff`] - Finite field arithmetic code generator (blazingly fast big.Int)\n* [`fft`] - Fast Fourier Transform\n* [`fri`] - FRI (multiplicative) commitment scheme\n* [`fiatshamir`] - Fiat-Shamir transcript builder\n* [`mimc`] - MiMC hash function using Miyaguchi-Preneel construction\n* [`kzg`] - KZG commitment scheme\n* [`permutation`] - Permutation proofs\n* [`plookup`] - Plookup proofs\n* [`eddsa`] - EdDSA signatures (on the companion [`twistededwards`] curves)\n\n`gnark-crypto` is actively developed and maintained by the team (gnark@consensys.net | [HackMD](https://hackmd.io/@gnark)) behind:\n\n* [`gnark`: a framework to execute (and verify) algorithms in zero-knowledge](https://github.com/Consensys/gnark)\n\n## Warning\n\n**`gnark-crypto` is not fully audited and is provided as-is, use at your own risk. In particular, `gnark-crypto` makes no security guarantees such as constant time implementation or side-channel attack resistance.**\n\n**To report a security bug, please refer to [`gnark` Security Policy](https://github.com/Consensys/gnark/blob/master/SECURITY.md).**\n\n`gnark-crypto` packages are optimized for 64bits architectures (x86 `amd64`) and tested on Unix (Linux / macOS).\n\n## Audits\n\nSee [list of audits for `gnark` and `gnark-crypto`](https://github.com/Consensys/gnark?tab=readme-ov-file#audits)\n\n## Getting started\n\n### Go version\n\n`gnark-crypto` is tested with the last 2 major releases of Go (currently 1.19 and 1.20).\n\n### Install `gnark-crypto`\n\n```bash\ngo get github.com/Consensys/gnark-crypto\n```\n\nNote that if you use go modules, in `go.mod` the module path is case sensitive (use `consensys` and not `ConsenSys`).\n\n### Development\n\nMost (but not all) of the code is generated from the templates in `internal/generator`.\n\nThe generated code contains little to no interfaces and is strongly typed with a field (generated by the `gnark-crypto/field` package). The two main factors driving this design choice are:\n\n1. Performance: `gnark-crypto` algorithms manipulate millions (if not billions) of field elements. Interface indirection at this level, plus garbage collection indexing takes a heavy toll on perf.\n2. Need to derive (mostly) identical code for various moduli and curves, with consistent APIs. Generics introduce significant performance overhead and are not yet suited for high performance computing.\n\nTo regenerate the files, see `internal/generator/main.go`. Run:\n\n```bash\ngo generate ./...\n```\n\n## Benchmarks\n\n[Benchmarking pairing-friendly elliptic curves libraries](https://hackmd.io/@gnark/eccbench)\n\n\u003eThe libraries are implemented in different languages and some use more assembly code than others. Besides the different algorithmic and software optimizations used across, it should be noted also that some libraries target constant-time implementation for some operations making it de facto slower. However, it can be clear that consensys/gnark-crypto is one of the fastest pairing-friendly elliptic curve libraries to be used in zkp projects with different curves.\n\n## Citing\n\nIf you use `gnark-crypto` in your research a citation would be appreciated.\nPlease use the following BibTeX to cite the most recent release.\n\n```bib\n@software{gnark-crypto-v0.15,\n  author       = {Gautam Botrel and\n                  Thomas Piellard and\n                  Youssef El Housni and\n                  Arya Tabaie and\n                  Gus Gutoski and\n                  Ivo Kubjas},\n  title        = {Consensys/gnark-crypto: v0.15.0},\n  month        = jan,\n  year         = 2025,\n  publisher    = {Zenodo},\n  version      = {v0.15.0},\n  doi          = {10.5281/zenodo.5815453},\n  url          = {https://doi.org/10.5281/zenodo.5815453}\n}\n```\n\n## Versioning\n\nWe use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/Consensys/gnark-crypto/tags).\n\n## License\n\nThis project is licensed under the Apache 2 License - see the [LICENSE](LICENSE) file for details.\n\n[`field/goff`]: https://pkg.go.dev/github.com/consensys/gnark-crypto/field/goff\n[`bn254`]: https://pkg.go.dev/github.com/consensys/gnark-crypto/ecc/bn254\n[`bls12-381`]: https://pkg.go.dev/github.com/consensys/gnark-crypto/ecc/bls12-381\n[`bls24-317`]: https://pkg.go.dev/github.com/consensys/gnark-crypto/ecc/bls24-317\n[`bls12-377`]: https://pkg.go.dev/github.com/consensys/gnark-crypto/ecc/bls12-377\n[`bls24-315`]: https://pkg.go.dev/github.com/consensys/gnark-crypto/ecc/bls24-315\n[`bw6-761`]: https://pkg.go.dev/github.com/consensys/gnark-crypto/ecc/bw6-761\n[`bw6-633`]: https://pkg.go.dev/github.com/consensys/gnark-crypto/ecc/bw6-633\n[`twistededwards`]: https://pkg.go.dev/github.com/consensys/gnark-crypto/ecc/bn254/twistededwards\n[`eddsa`]: https://pkg.go.dev/github.com/consensys/gnark-crypto/ecc/bn254/twistededwards/eddsa\n[`fft`]: https://pkg.go.dev/github.com/consensys/gnark-crypto/ecc/bn254/fr/fft\n[`fri`]: https://pkg.go.dev/github.com/consensys/gnark-crypto/ecc/bn254/fr/fri\n[`mimc`]: https://pkg.go.dev/github.com/consensys/gnark-crypto/ecc/bn254/fr/mimc\n[`kzg`]: https://pkg.go.dev/github.com/consensys/gnark-crypto/ecc/bn254/fr/kzg\n[`plookup`]: https://pkg.go.dev/github.com/consensys/gnark-crypto/ecc/bn254/fr/plookup\n[`permutation`]: https://pkg.go.dev/github.com/consensys/gnark-crypto/ecc/bn254/fr/permutation\n[`fiatshamir`]: https://pkg.go.dev/github.com/consensys/gnark-crypto/fiat-shamir\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FConsensys%2Fgnark-crypto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FConsensys%2Fgnark-crypto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FConsensys%2Fgnark-crypto/lists"}