{"id":43288275,"url":"https://github.com/secworks/blake2s","last_synced_at":"2026-02-01T18:04:52.132Z","repository":{"id":43285755,"uuid":"113904439","full_name":"secworks/blake2s","owner":"secworks","description":"Verilog implementation of the 32-bit version of the Blake2 hash function","archived":false,"fork":false,"pushed_at":"2025-03-30T17:47:46.000Z","size":589,"stargazers_count":21,"open_issues_count":0,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-30T18:31:03.309Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Verilog","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/secworks.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":"2017-12-11T20:20:15.000Z","updated_at":"2025-03-30T17:47:46.000Z","dependencies_parsed_at":"2025-03-30T18:36:23.394Z","dependency_job_id":null,"html_url":"https://github.com/secworks/blake2s","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/secworks/blake2s","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secworks%2Fblake2s","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secworks%2Fblake2s/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secworks%2Fblake2s/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secworks%2Fblake2s/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/secworks","download_url":"https://codeload.github.com/secworks/blake2s/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secworks%2Fblake2s/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28984873,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T17:52:09.146Z","status":"ssl_error","status_checked_at":"2026-02-01T17:49:53.529Z","response_time":56,"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":[],"created_at":"2026-02-01T18:04:51.440Z","updated_at":"2026-02-01T18:04:52.120Z","avatar_url":"https://github.com/secworks.png","language":"Verilog","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![build-openlane-sky130](https://github.com/secworks/blake2s/actions/workflows/ci.yml/badge.svg?branch=master\u0026event=push)](https://github.com/secworks/blake2s/actions/workflows/ci.yml)\n\n# blake2s\nVerilog implementation of the [BLAKE2s](https://blake2.net/) hash function.\n\n\n## Implementation status\nImplementation completed. Functionally correct. Functionally verified in\nreal hardware.  *Ready for use*.\n\n\n## Introduction\nBLAKE2s is 32-bit,  embedded- and hardware-oriented version of the BLAKE2 hash\nfunction. See the [BLAKE2 paper](https://blake2.net/blake2.pdf) for more\ninformation. Additionally, [RFC\n7693](https://tools.ietf.org/html/rfc7693) contains a good description,\na reference model and a test vecrtor.\n\nBLAKE2s operates on 32-bit words and produces digests of up to\n32 bytes. This version of BLAKE2s always generates a 32 byte (i.e. 256\nbit) digest.\n\nThis repository contains a forked version of the BLAKE2s reference model\nby  Markku-Juhani O. Saarinen that appears in [RFC 7693](https://www.rfc-editor.org/rfc/rfc7693.html).\nThe original repository [can be found\nhere](https://github.com/mjosaarinen/blake2_mjosref). The forked version\ncontains additional test cases that checks corner cases. The forked\nversion has also been instrumented to display internal values during\nprocessing. The model has been used to drive the functional\nverification of the core.\n\n\n### Contact information ##\nAssured provides customer support including customization, integration\nand system development related to the core. For more information,\nplease contact [Assured Security\nConsultants](https://www.assured.se/contact).\n\n\n## Operation\nThe core API follows the description in the BLAKE2s paper and the RFC,\nwith separate calls to init(), update() and finish() the\nprocessing. (Note that finish() is called final() in the paper and the\nRFC, but final() is a reserved word in Verilog).\n\nOne must always perform a init() operation separately, before any\nupdate() or finish() operations. One must also always perform a finish()\noperation to get the final digest.\n\nFor messages smaller than a single 64 byte block, update() should not be\ncalled. Instead finish() should be called. It is the callers\nresponsibility to set the blocklength to indicate the number of\nbytes. (A possible future improvement is to assume that the block size\nis 64 bytes for all blocks processed using the update() operation.)\n\nFor messages spanning more than one block, perform as many update()\noperations as there are complete blocks and then a single final()\noperation.\n\n\n### FuseSoC\nThis core is supported by the\n[FuseSoC](https://github.com/olofk/fusesoc) core package manager and\nbuild system. Some quick  FuseSoC instructions:\n\ninstall FuseSoC\n~~~\npip install fusesoc\n~~~\n\nCreate and enter a new workspace\n~~~\nmkdir workspace \u0026\u0026 cd workspace\n~~~\n\nRegister blake2s as a library in the workspace\n~~~\nfusesoc library add blake2s /path/to/blake2s\n~~~\n\n...if repo is available locally or...\n...to get the upstream repo\n~~~\nfusesoc library add blake2s https://github.com/secworks/blake2s\n~~~\n\nTo run lint\n~~~\nfusesoc run --target=lint secworks:crypto:blake2s\n~~~\n\nRun tb_blake2s testbench\n~~~\nfusesoc run --target=tb_blake2s secworks:crypto:blake2s\n~~~\n\nRun with modelsim instead of default tool (icarus)\n~~~\nfusesoc run --target=tb_blake2s --tool=modelsim secworks:crypto:blake2s\n~~~\n\nList all targets\n~~~\nfusesoc core show secworks:crypto:blake2s\n~~~\n\n\n## Performance\nA single block is processed in 24 cycles. Of these 20 cycles is for the 10\nrounds. The init() operation takes two cycles, and the finish()\noperation takes two additional cycles besides 24 cycles for the final\nblock processing. This means that for long messages, the core will take\n0.375 cycles/byte.\n\n\n## Implementation details\nThe core is a high speed, big, yet iterative implemenatation. It will\nperform 10 rounds in sequence. But the core contains four G_function\ninstantiations and can perform a round in two cycles.\n\nFor more compact implementations, the core can be restructured to use\ntwo or just a single, shared G_function.\n\nThe G_function itself is purely combinational logic, with no registers\nand no sharing of operations. For higher clock frequency, and/or a more\ncompact implementation the G_function can be rewored to be pipelined and\nto share for example the adders. Note that this will have a big impact\non the number of cycles required to process a block. Also the core\nitself will have to be updated to handle G_function latency beyond the\ncurrently expected one cycle latency.\n\nNote that there is no separate ports for key and key length.\n\nIt is the callers responsibility to clear the unused bits in block\ncontaining less than 64 bytes. This holds for both the blake2s_core\nmodule and the blake2s top level wrapper. For the latter, this means\nwriting one or more 32-bit all zero words.\n\nThe core calculate message length based on the number of bytes given\nwith each block. The core will also handle the last block as defined by\nthe paper and the RFC.\n\nThe message block buffer in blake_m_select.v is not mapped into a\nspecific memory macro, and may be implemented with registers by the\nsynthesis tool. For an efficient implementation, one would probably want\nto to change the implementation to use technology specific memory\nblocks.\n\n\n## Implementation results\nAny implementation results provided would be greatly appreciated.\n\n\n### Xilinx Artix 7 200T-1 ###\n- LUTs: 3387\n- Regs: 1893\n- Fmax: 61 MHz\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsecworks%2Fblake2s","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsecworks%2Fblake2s","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsecworks%2Fblake2s/lists"}