{"id":15833671,"url":"https://github.com/itzmeanjan/tinyjambu","last_synced_at":"2025-10-25T11:04:22.086Z","repository":{"id":40432961,"uuid":"485242966","full_name":"itzmeanjan/tinyjambu","owner":"itzmeanjan","description":"Accelerated TinyJambu - Lightweight Authenticated Encryption Algorithms","archived":false,"fork":false,"pushed_at":"2023-01-04T09:24:03.000Z","size":174,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-06T13:41:32.741Z","etag":null,"topics":["aead","authenticated-encryption","lwc","nist","nist-lwc","tinyjambu","verified-decryption"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/itzmeanjan.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":"2022-04-25T06:04:46.000Z","updated_at":"2024-06-18T09:04:19.000Z","dependencies_parsed_at":"2023-02-02T07:01:49.607Z","dependency_job_id":null,"html_url":"https://github.com/itzmeanjan/tinyjambu","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/itzmeanjan/tinyjambu","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itzmeanjan%2Ftinyjambu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itzmeanjan%2Ftinyjambu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itzmeanjan%2Ftinyjambu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itzmeanjan%2Ftinyjambu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itzmeanjan","download_url":"https://codeload.github.com/itzmeanjan/tinyjambu/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itzmeanjan%2Ftinyjambu/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280943394,"owners_count":26417747,"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-10-25T02:00:06.499Z","response_time":81,"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":["aead","authenticated-encryption","lwc","nist","nist-lwc","tinyjambu","verified-decryption"],"created_at":"2024-10-05T13:41:20.176Z","updated_at":"2025-10-25T11:04:22.068Z","avatar_url":"https://github.com/itzmeanjan.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tinyjambu\nAccelerated TinyJambu - Lightweight Authenticated Encryption Algorithms\n\n## Overview\n\nAfter working on `ascon` **A**uthenticated **E**ncryption with **A**ssociated **D**ata suite, I've taken up another final round candidate of NIST **L**ight **W**eight **C**ryptography competition `tinyjambu`, which offers three authenticated encryption algorithms, variated based on secret key bit length.\n\nAEAD Algorithm | Secret Key ( Bit Length )\n--- | --:\nTinyJambu-128 | 128\nTinyJambu-192 | 192\nTinyJambu-256 | 256\n\n\u003e **Note** Learn more about AEAD [here](https://en.wikipedia.org/wiki/Authenticated_encryption)\n\n\u003e **Note** If interested in learning more about my work on Ascon AEAD, see [here](https://github.com/itzmeanjan/ascon)\n\nTinyJambu-{128, 192, 256} offers lightweight authenticated encryption/ verified decryption algorithms. Encryption/ Decryption procedures take following inputs and computes these outputs.\n\nAlgorithm | Input | Output\n--- | --: | --:\n`encrypt` | 16/ 24/ 32 -bytes secret key, 12 -bytes public message nonce, N -bytes of plain text s.t. N \u003e= 0 and N -bytes of associated data s.t. N \u003e= 0 | N -bytes encrypted data s.t. N \u003e= 0 \u0026\u0026 len(text) == len(cipher) and 8 -bytes authentication tag\n`decrypt` | 16/ 24/ 32 -bytes secret key, 12 -bytes public message nonce, 8 -bytes of authentication tag, N -bytes encrypted data s.t. N \u003e= 0 and N -bytes of associated data s.t. N \u003e= 0 | N -bytes decrypted data s.t. N \u003e= 0 \u0026\u0026 len(cipher) == len(text) and boolean flag denoting success of verification\n\nHere I'm maintaining one easy-to-use, zero-dependency, header-only C++ library, which implements all three variants of TinyJambu. I've also written a Python wrapper interface for underlying C++ implementation, which one might want to use in their Python programs.\n\n\u003e **Note** During implementation, I followed [this](https://csrc.nist.gov/CSRC/media/Projects/lightweight-cryptography/documents/finalist-round/updated-spec-doc/tinyjambu-spec-final.pdf) specification of TinyJambu.\n\n## Prerequisites\n\n- C++ compilers like `clang++`/ `g++`, along C++ standard library, implementing C++20 specification\n\n```bash\n$ clang++ --version\nUbuntu clang version 14.0.0-1ubuntu1\nTarget: aarch64-unknown-linux-gnu\nThread model: posix\nInstalledDir: /usr/bin\n\n$ g++ --version\ng++ (Ubuntu 11.2.0-19ubuntu1) 11.2.0\n```\n\n- System development utilities like `make`, `cmake` and `git`\n\n```bash\n$ make --version\nGNU Make 4.3\n\n$ cmake --version\ncmake version 3.22.1\n\n$ git --version\ngit version 2.34.1\n```\n\n- For benchmarking TinyJambu-{128, 192, 256} on CPU, you'll need to have `google-benchmark` library globally installed; see [this](https://github.com/google/benchmark/tree/60b16f1#installation) guide.\n\n- If you want to use/ test/ benchmark Python API, you need to have `python3`, along with some dependencies, which can be installed using `pip`.\n\n```bash\n$ python3 --version\nPython 3.10.8\n\n# If you don't have pip installed\n$ sudo apt-get install python3-pip\n\n# Download Python dependencies\n$ python3 -m pip install -r wrapper/python/requirements.txt --user\n```\n\n\u003e **Note** But probably, you want to use `virtualenv` instead of polluting your global Python installation.\n\n```bash\n# download virtualenv\npython3 -m pip install --user virtualenv\n\npushd wrapper/python\n\n# create virtualenv work directory\npython3 -m virtualenv .\n# enable virtualenv\nsource bin/activate # notice shell prompt change\n\n# download dependencies inside virtualenv\npython3 -m pip install -r requirements.txt\n\n# do whatever you want to do inside virtualenv workspace\n# ...\n# ...\n\n# disable virtualenv\ndeactivate # notice shell prompt change\n\npopd\n```\n\n## Testing\n\nFor ensuring functional correctness of TinyJambu-{128, 192, 256} AEAD, I've written following test cases\n\n- Given randomly generated secret key, public message nonce, plain text bytes ( length \u003e= 0 ) \u0026 associated data bytes ( length \u003e= 0 )\n    - first, compute encrypted bytes \u0026 authentication tag\n    - then, attempt to decrypt, ensure that verification passes, while also employing byte-by-byte comparison of decrypted and original plain text\n- Given randomly generated secret key, public message nonce, plain text bytes ( length \u003e= 0 ) \u0026 associated data bytes ( length \u003e= 0 )\n    - first, compute encrypted bytes \u0026 authentication tag\n    - then, mutate ( just a single bit flip should suffice ) either of secret key/ public message nonce/ authentication tag/ encrypted bytes/ associated data\n    - finally, attempt to decrypt, authentication tag verification must fail. Alongside check that unverified plain text is never released i.e. plain text bytes should be zeroed in case of tag verification failure.\n- Test correctness and compatibility using Known Answer Tests provided with NIST LWC submission of TinyJambu.\n\nIssue following command(s) to run test cases on all variants of TinyJambu\n\n```bash\nFBK=32 make   # 32 feedback bits in-parallel\nFBK=64 make   # 2x32 feedback bits per iteration\nFBK=128 make  # 4x32 feedback bits per iteration\n```\n\n\u003e **Note** You may safely skip specifying `FBK`, default choice `FBK=32` is automatically set !\n\n## Benchmarking\n\nFind micro-benchmarking ( using `google-benchmark` ) results [here](./bench/README.md)\n\n## Usage\n\n`tinyjambu` being a simple, zero-dependency, header-only C++ library, it's pretty easy to start using it. Just add `./include` path while compiling your program ( inform your compiler about this include path using `-I ./include` syntax ), which uses `tinyjambu`.\n\nI've written following example programs which demonstrate use of TinyJambu-{128, 192, 256} C++ API\n\n- [TinyJambu-128](./example/tinyjambu_128.cpp)\n- [TinyJambu-192](./example/tinyjambu_192.cpp)\n- [TinyJambu-256](./example/tinyjambu_256.cpp)\n\nYou may also want to use Python API of `tinyjambu`, consider checking [here](https://github.com/itzmeanjan/tinyjambu/blob/1082f55/wrapper/python/example.py) for usage example.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitzmeanjan%2Ftinyjambu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitzmeanjan%2Ftinyjambu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitzmeanjan%2Ftinyjambu/lists"}