{"id":22303534,"url":"https://github.com/lovesh/cks_accumulator","last_synced_at":"2026-04-01T22:07:48.693Z","repository":{"id":57604036,"uuid":"233850923","full_name":"lovesh/cks_accumulator","owner":"lovesh","description":"Pairing based accumulator","archived":false,"fork":false,"pushed_at":"2020-01-21T12:42:00.000Z","size":12,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-03T02:20:06.941Z","etag":null,"topics":["accumulator","pairings"],"latest_commit_sha":null,"homepage":null,"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/lovesh.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}},"created_at":"2020-01-14T13:45:38.000Z","updated_at":"2023-03-25T13:17:49.000Z","dependencies_parsed_at":"2022-08-28T09:10:22.099Z","dependency_job_id":null,"html_url":"https://github.com/lovesh/cks_accumulator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lovesh/cks_accumulator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovesh%2Fcks_accumulator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovesh%2Fcks_accumulator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovesh%2Fcks_accumulator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovesh%2Fcks_accumulator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lovesh","download_url":"https://codeload.github.com/lovesh/cks_accumulator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovesh%2Fcks_accumulator/sbom","scorecard":{"id":600178,"data":{"date":"2025-08-11","repo":{"name":"github.com/lovesh/cks_accumulator","commit":"35fedd7f856199f9e1a882852fda3fa9ba4559b9"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Code-Review","score":0,"reason":"Found 0/4 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-21T00:12:43.045Z","repository_id":57604036,"created_at":"2025-08-21T00:12:43.045Z","updated_at":"2025-08-21T00:12:43.045Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31018562,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-27T03:51:26.850Z","status":"ssl_error","status_checked_at":"2026-03-27T03:51:09.693Z","response_time":164,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["accumulator","pairings"],"created_at":"2024-12-03T18:44:08.831Z","updated_at":"2026-03-27T04:21:26.672Z","avatar_url":"https://github.com/lovesh.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Accumulator using Bilinear maps\n\nBased on the paper An Accumulator [Based on Bilinear Maps and Efficient Revocation for Anonymous Credentials](https://eprint.iacr.org/2008/539.pdf). \nModified to work with type-3 pairings. Adds 2 features not mentioned in the paper:\n1. Ability to remove indices from the accumulator.\n1. Efficient witness generation (independent of the size of the accumulator) using knowledge of trapdoor\n\nAccumulator from section 3.2 of the paper\n\n## API\n1. Accumulator is defined over group G1. To initialize a new Accumulator, call `Accumulator::new`.\n1. To track which indices are present in the accumulator so that they are not accidentally added again or removed when \nthey were not present and to update witness, a trait `AccumulatorState` is defined. For testing, an in-memory implementation is present. \n1. For generating and querying entries which are added to the accumulator, a trait `AccumulatorEntries` is defined. \nFor testing, an in-memory implementation is defined.\n1. For a sample of how an accumulator is setup, look at testing function `setup_accumulator_for_testing`.\n\n1. To add an index `idx` in the accumulator, use method `Accumulator::add_index`. The method returns a new accumulator and updates the `state`. \nSuppose `accum` is the accumulator before adding that index, `state` is an `AccumulatorState` and `entries` is an `AccumulatorEntries`, then this is how to add in index\n    ```rust\n    // indices are 1-based. `accum` does not have the index `idx` but `accum_1` does\n    let accum_1 = accum.add_index(idx, \u0026entries, \u0026mut state);\n    ```\n   \n1. To check presence of a value in an accumulator, a `Witness` is needed. To generate a witness, there are 2 methods, \nthe slower one does not require a trapdoor and has complexity proportional to the size of the accumulator but the faster \none using the trapdoor has constant asymptotic complexity.  \nTo generate a witness for index `idx` without using the trapdoor, use method `Witness::for_index` which iterates over the \nindices in `state` and gets the corresponding entries from `entries`.  \n    ```rust\n    let witness = Witness::for_index(idx, \u0026state, \u0026entries);\n    ```\n   \n    To generate a witness for index `idx` using the trapdoor\n    ```rust\n    // `cur_accum` is the accumulator without `idx`. \n    let witness = Witness::for_index_using_trapdoor(idx, \u0026cur_accum, \u0026entries, \u0026state, \u0026trapdoor);\n    ```\n   \n1. To check whether an index `idx` is present in the accumulator, use method `Accumulator::has_index`.\n    ```rust\n    // `witness` is a `Witness` and `z` = e(g1, g2)^{gamma^{size+1}} \n    accum_1.has_index(idx, \u0026witness, \u0026entries, \u0026z);\n    ```\n\n1. To update the witness after some elements have been added or removed, the old witness can be updated using `Witness:update`.\n    ```rust\n    // `witness_old` is the old witness which is being updated, `added` and `removed` are the `HashSet`s of added and \n    removed indices. \n    let witness_updated = witness_old.update(added, removed, \u0026entries);\n    ```\n\n1. To remove an index `idx`, use `Accumulator::remove_index` to get a new accumulator with the index removed.\n    ```rust\n    // indices are 1-based. `accum` has the index `idx` but `accum_1` does not\n    let accum_1 = accum.remove_index(idx, \u0026entries, \u0026mut state);\n    ```\n\n1. If the entry updating the accumulator has access to trapdoor, there is a convenience method to add an index and \nefficiently compute the witness as well.\n    ```rust\n    let (new_accum, wit) = cur_accum.add_index_and_compute_witness(idx, \u0026entries, \u0026mut state, \u0026trapdoor);\n    ``` \n\n\nSee the tests for detailed examples.\n\n## TODO:\n- Signature to prove knowledge of accumulated value.\n- Check if for signatures, BBS+ can be avoided and PS can be used instead.\n- Check if tradeoffs possible by switching groups G1 and G2.\n- Convert asserts to errors\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flovesh%2Fcks_accumulator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flovesh%2Fcks_accumulator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flovesh%2Fcks_accumulator/lists"}