{"id":28681879,"url":"https://github.com/zkpersona/noir-hmac","last_synced_at":"2025-06-14T02:04:35.114Z","repository":{"id":287334820,"uuid":"964424863","full_name":"zkpersona/noir-hmac","owner":"zkpersona","description":"Noir implementation of HMAC(Hash-based Message Authentication Code)","archived":false,"fork":false,"pushed_at":"2025-04-11T07:47:38.000Z","size":52,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-04-11T08:37:03.907Z","etag":null,"topics":["hmac","hmac-sha256","library","noir","noir-lang","zero-knowledge"],"latest_commit_sha":null,"homepage":"","language":"Noir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zkpersona.png","metadata":{"files":{"readme":"readme.md","changelog":"CHANGELOG.md","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,"zenodo":null}},"created_at":"2025-04-11T07:35:56.000Z","updated_at":"2025-04-11T08:20:32.000Z","dependencies_parsed_at":"2025-04-11T08:37:22.753Z","dependency_job_id":"26d7382c-ee10-49ab-ad4a-ae44c7d37311","html_url":"https://github.com/zkpersona/noir-hmac","commit_stats":null,"previous_names":["zkpersona/noir-hmac"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/zkpersona/noir-hmac","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zkpersona%2Fnoir-hmac","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zkpersona%2Fnoir-hmac/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zkpersona%2Fnoir-hmac/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zkpersona%2Fnoir-hmac/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zkpersona","download_url":"https://codeload.github.com/zkpersona/noir-hmac/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zkpersona%2Fnoir-hmac/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259747214,"owners_count":22905310,"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":["hmac","hmac-sha256","library","noir","noir-lang","zero-knowledge"],"created_at":"2025-06-14T02:01:43.250Z","updated_at":"2025-06-14T02:04:35.107Z","avatar_url":"https://github.com/zkpersona.png","language":"Noir","funding_links":[],"categories":["Libraries"],"sub_categories":["Cryptography"],"readme":"# Noir HMAC(Hash-based Message Authentication Code)\n\nNoir implementation of HMAC(Hash-based Message Authentication Code). Currently, the following hash functions are supported:\n\n- SHA256\n\n\u003e Note: SHA512 will be supported in the future as soon as library is reviewed. See [noir-lang/sha512/pull/2](https://github.com/noir-lang/sha512/pull/2)\n\n## Noir version compatibility\n\nThis library is tested to work as of Noir version \u003e=1.0.0.beta-2\n\n## Benchmarks\n\nBenchmarks are ignored by `git` and checked on pull-request. As such, benchmarks may be generated\nwith the following command.\n\n```bash\n./scripts/build-gates-report.sh\n```\n\nThe benchmark will be generated at `./gates_report.json`.\n\n## Installation\n\nIn your _Nargo.toml_ file, add the version of this library you would like to install under dependency:\n\n```toml\n[dependencies]\nnoir_hmac = { tag = \"v0.1.0\", git = \"https://github.com/zkpersona/noir-hmac\", directory = \"lib\" }\n```\n\n## Usage\n\n### HMAC-SHA256\n\n```noir\nuse noir_hmac::hmac_sha256::hmac_sha256;\n\nfn hmac_sha256_test() {\n    let key: BoundedVec\u003cu8, 10\u003e = BoundedVec::from_array(\"secret_key\".as_bytes());\n    let message: BoundedVec\u003cu8, 11\u003e = BoundedVec::from_array(\"hello_world\".as_bytes());\n    let hmac: [u8; 32] = hmac_sha256(key, message);\n\n    let expected: [u8; 32] = [\n        32, 245, 74, 230, 153, 92, 121, 130, 198, 181, 233, 222, 161, 142, 167, 35, 8, 91, 220, 193,\n        245, 93, 185, 150, 77, 51, 84, 8, 96, 219, 96, 75,\n    ];\n\n    assert(hmac == expected);\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzkpersona%2Fnoir-hmac","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzkpersona%2Fnoir-hmac","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzkpersona%2Fnoir-hmac/lists"}