{"id":22303542,"url":"https://github.com/lovesh/libsnark-playground","last_synced_at":"2025-07-29T04:31:07.104Z","repository":{"id":150949927,"uuid":"149136289","full_name":"lovesh/libsnark-playground","owner":"lovesh","description":"Learning ZkSNARKs using libsnark","archived":false,"fork":false,"pushed_at":"2018-12-26T15:07:29.000Z","size":15195,"stargazers_count":12,"open_issues_count":2,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-05T07:03:33.955Z","etag":null,"topics":["libsnark","mimc","zk-snarks","zksnarks"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lovesh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2018-09-17T14:15:46.000Z","updated_at":"2023-07-13T03:23:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"e4eabb7e-65e8-4b09-8c55-7ee37a0a1a4f","html_url":"https://github.com/lovesh/libsnark-playground","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lovesh/libsnark-playground","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovesh%2Flibsnark-playground","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovesh%2Flibsnark-playground/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovesh%2Flibsnark-playground/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovesh%2Flibsnark-playground/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lovesh","download_url":"https://codeload.github.com/lovesh/libsnark-playground/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovesh%2Flibsnark-playground/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267629044,"owners_count":24118126,"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","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["libsnark","mimc","zk-snarks","zksnarks"],"created_at":"2024-12-03T18:44:11.234Z","updated_at":"2025-07-29T04:31:07.094Z","avatar_url":"https://github.com/lovesh.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Libsnark playground\n\nPlaying with Zk-SNARKs. Some of the code taken from libsnark tutorial repositories from [Christian Lundkvist](https://github.com/christianlundkvist/libsnark-tutorial) and [Howard Wu](https://github.com/howardwu/libsnark-tutorial). The latter contains the build instructions.\n1. [Example to prove knowledge of factors of a number](src/factorisation.cpp), i.e given a public output `c`, prove the knowledge of 2 numbers `a` and `b` such that `a * b = c`.\n2. [Prove the knowledge of pre-image of a sha256 hash](src/sha256.cpp). Uses libsnark's sha256 gadget. Byte representation of inputs and output can be generated using [python helper script](src/generate_sha256_gadget_tests.py). Use the function `short_string_hash` to generate bytes.\n3. [MiMC-Fiestel hash pre-image](src/longsightf-gadget.hpp). 2 implementations, [one](https://github.com/josojo/mimcHashTimings) from [josojo](https://github.com/josojo) that does exponentiation (x^3) during round and other does inverse (x^-1) during the round as suggested by [Dmitry Khovratovich](https://github.com/khovratovich) \n4. [Shark MiMC](src/sharkmimc.hpp) as suggested by [Dmitry Khovratovich](https://github.com/khovratovich). Contains 2 gadgets, `SharkMimc_cube_gadget` which treats `x^3` as S-box function and `SharkMimc_inverse_gadget` which treats `x^-1` as S-box function. ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flovesh%2Flibsnark-playground","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flovesh%2Flibsnark-playground","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flovesh%2Flibsnark-playground/lists"}