{"id":13799470,"url":"https://github.com/TrustworthyComputing/T2-FHE-Compiler-and-Benchmarks","last_synced_at":"2025-05-13T08:31:15.345Z","repository":{"id":69912415,"uuid":"290877721","full_name":"TrustworthyComputing/T2-FHE-Compiler-and-Benchmarks","owner":"TrustworthyComputing","description":"A cross compiler and standardized benchmarks for fully homomorphic encryption","archived":false,"fork":false,"pushed_at":"2023-12-29T21:16:57.000Z","size":4747,"stargazers_count":33,"open_issues_count":1,"forks_count":6,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-11-18T14:58:45.703Z","etag":null,"topics":["benchmarks","compiler","fhe","helib","homomorphic-encryption","lattigo","palisade","seal","tfhe"],"latest_commit_sha":null,"homepage":"","language":"Java","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/TrustworthyComputing.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}},"created_at":"2020-08-27T20:43:23.000Z","updated_at":"2024-11-18T05:59:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"d7701c33-f99f-4d1c-81db-09ef30454c63","html_url":"https://github.com/TrustworthyComputing/T2-FHE-Compiler-and-Benchmarks","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TrustworthyComputing%2FT2-FHE-Compiler-and-Benchmarks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TrustworthyComputing%2FT2-FHE-Compiler-and-Benchmarks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TrustworthyComputing%2FT2-FHE-Compiler-and-Benchmarks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TrustworthyComputing%2FT2-FHE-Compiler-and-Benchmarks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TrustworthyComputing","download_url":"https://codeload.github.com/TrustworthyComputing/T2-FHE-Compiler-and-Benchmarks/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253903715,"owners_count":21981737,"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":["benchmarks","compiler","fhe","helib","homomorphic-encryption","lattigo","palisade","seal","tfhe"],"created_at":"2024-08-04T00:01:03.104Z","updated_at":"2025-05-13T08:31:14.707Z","avatar_url":"https://github.com/TrustworthyComputing.png","language":"Java","funding_links":[],"categories":["Toolkits"],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eT2: A cross compiler and standardized benchmarks for FHE computation \u003ca href=\"https://github.com/TrustworthyComputing/T2-FHE-Compiler-and-Benchmarks/blob/master/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-MIT-blue.svg\"\u003e\u003c/a\u003e \u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"./logos/t2-logo.png\" height=\"20%\" width=\"20%\"\u003e\n\u003c/p\u003e\n\n\n## Overview\nT2 is an *extensible cross compiler* and *standardized benchmark suite* enabling comparisons between\nfully-homomorphic encryption (FHE) libraries. The T2 repository comprises the\nT2 DSL and the T2 compiler from T2 DSL to state-of-the-art FHE back-ends.\n\n\nT2 aims to offer a standardized benchmark suite for FHE that encompasses\nrealistic use-cases. Additionally, the T2 compiler offers a great starting\npoint to explore the different backends (e.g., HElib, Lattigo, PALISADE, SEAL,\nand TFHE) as a single T2 program is effortlessly transpiled to all supported\nFHE libraries.\n\nThe T2 compiler supports three distinct computational models: *Integer*, *Binary*,\nand *Floating-Point* domains. Each domain utilizes different sets of functional\nunits, some of which are inherently supported by the backends, while others are\nimplemented on top of the FHE back-ends. This allows users to compare the\ndifferent domains and find the most efficient for their applications.\n\nT2 is the spiritual successor to the [TERMinator suite\nrepository](https://github.com/momalab/TERMinatorSuite),\nwhich includes benchmarks tailored to encrypted computation. The original\nTerminator suite targets partially homomorphic architectures, however, since its\nrelease, fully homomorphic encryption (FHE) has become increasingly popular and\nmore viable. To account for this, T2 targets FHE architectures by modifying the\noriginal benchmarks as well as adding new additions.\n\n\n### How to cite this work\nThe SoK outlining this framework appears in [PoPETS\n2023](https://petsymposium.org/popets/2023/popets-2023-0075.php) (the preprint can be accessed\n[here](https://eprint.iacr.org/2022/425.pdf)). An earlier journal article describing\nthe original Terminator suite can be accessed\n[here](https://ieeexplore.ieee.org/document/8307166), while the authors' version\nis available [here](https://jimouris.github.io/publications/mouris2018terminator.pdf).\nYou can cite these articles as follows:\n\n```\n@Article{PoPETS:Gouert23sok,\n  author =       \"Charles Gouert and\n                  Dimitris Mouris and\n                  Nektarios Georgios Tsoutsos\",\n  title =        \"{SoK: New Insights into Fully Homomorphic Encryption Libraries via Standardized Benchmarks}\",\n  volume =       2023,\n  month =        Jul,\n  year =         2023,\n  publisher =    sciendo,\n  journal =      \"{Proceedings on Privacy Enhancing Technologies}\",\n  number =       3,\n  pages =        \"154–172\",\n  doi =          \"10.56553/popets-2023-0075\",\n}\n\n@Article{IEEECAL:Mouris18terminator,\n  author  =     \"Dimitris Mouris and\n                 Nektarios Georgios Tsoutsos and\n                 Michail Maniatakos\",\n  title   =     \"{TERMinator Suite: Benchmarking Privacy-Preserving Architectures}\",\n  journal =     \"IEEE Computer Architecture Letters\",\n  year    =     \"2018\",\n  volume  =     \"17\",\n  number  =     \"2\",\n  pages   =     \"122-125\",\n  doi     =     \"10.1109/LCA.2018.281281\"}\n}\n```\n\n## Supported Homomorphic Encryption Libraries\n\n\u003cdiv style=\"background-color:#FFFF; color:#1A2067; border: solid #718096 4px; border-radius: 4px;\"\u003e\n\u003cp\u003e\n  \u003cimg src=\"./logos/t2-compiler.png\" align=\"right\" height=\"40%\" width=\"40%\" padding=10em\u003e\n  \u003ca href=\"https://github.com/tuneinsight/lattigo\"\u003eLattigo\u003c/a\u003e v4.1.0 \u003ca href=\"https://github.com/tuneinsight/lattigo/commit/adf762375670e412bab261cd7ffff9ca03777ad5\"\u003eadf7623\u003c/a\u003e\n  \u003cbr\u003e\n  \u003ca href=\"https://github.com/homenc/HElib\"\u003eHElib\u003c/a\u003e v2.2.2 \u003ca href=\"https://github.com/homenc/HElib/commit/d7be6f0dca6fa6cad2b2a0923d024ac27ce2e445\"\u003ed7be6f0\u003c/a\u003e\n  \u003cbr\u003e\n  \u003ca href=\"https://gitlab.com/palisade/palisade-release/\"\u003ePALISADE\u003c/a\u003e v1.11.9 \u003ca href=\"https://gitlab.com/palisade/palisade-release/-/commit/3d1f9a3f9fd389df1f8f27f286511f4f5871258b\"\u003e3d1f9a3f\u003c/a\u003e\n  \u003cbr\u003e\n  \u003ca href=\"https://github.com/microsoft/SEAL\"\u003eMicrosoft SEAL\u003c/a\u003e v4.1.1 \u003ca href=\"https://github.com/microsoft/SEAL/commit/206648d0e4634e5c61dcf9370676630268290b59\"\u003e206648d\u003c/a\u003e\n  \u003cbr\u003e\n  \u003ca href=\"https://github.com/tfhe/tfhe\"\u003eTFHE\u003c/a\u003e v1.0.1 \u003ca href=\"https://github.com/tfhe/tfhe/commit/6297bc72d9294e6e635738deb2e8dc7e4ff8bc61\"\u003e6297bc7\u003c/a\u003e\n  \u003cbr\u003e\n\u003c/p\u003e\n\u003c/div\u003e\n\u003cbr\u003e\n\n\n## Build and Run Instructions\n\n### Building with Docker\n* Build the Docker image:\n  ```powershell\n  docker build -t t2 .\n  ```\n* Run the Docker container: \n  ```powershell\n  docker run --rm -i -t t2 bash\n  ```\n\n### Building from Scratch\nTested on Ubuntu 22.04 LTS with Java 8, 9, and 19. For Lattigo, we used go version 1.17.6 and 1.18.1.\n\n#### Dependencies\n*\n  ```powershell\n  apt install cmake make build-essential g++ clang autoconf javacc patchelf openjdk-8-jdk maven m4 tar lzip libfftw3-dev\n  ```\n* [Go-lang](https://go.dev/dl/)\n* Follow and modify [clone_libs.sh](./.circleci/clone_libs.sh) and\n  [build_libs.sh](./.circleci/build_libs.sh) scripts to install the FHE libraries in your custom destinations.\n\n#### Compile the T2 compiler\n```powershell\nmvn initialize package\n```\n\nTo skip running the test when compiling the T2 compiler run:\n```powershell\nmvn package -Dmaven.test.skip\n```\n\n## Compile T2 programs\nTo compile a T2 program type:\n```powershell\njava -jar target/terminator-compiler-1.0.jar \u003cpath_to_t2_file\u003e [--debug] \u003cLIB\u003e [--w word_size]\n```\nwhere `\u003cLIB\u003e` can be one of `HElib`, `Lattigo`, `SEAL`, `PALISADE`, and `TFHE`. For instance:\n\n### Example of compiling a T2 program for SEAL:\n```powershell\njava -jar target/terminator-compiler-1.0.jar src/test/resources/tests/arithmetic.t2 --seal\n```\nwill use `SEAL` as the back-end over the integers.\n\n### Example of compiling a T2 program for Lattigo in the binary domain:\n```powershell\njava -jar target/terminator-compiler-1.0.jar src/test/resources/tests/bin_test.t2 --lattigo --w 6\n```\nwill use `Lattigo` as the back-end in the binary domain. The T2 compiler\nautomatically detects the appropriate scheme (i.e., `BFV/BGV` or `CKKS`) based\non the type of the encrypted variables that the T2 program uses (i.e.,\n`EncInt` or `EncDouble`).\n\n### Example of compiling a T2 program for SEAL in the floating-point domain:\n```powershell\njava -jar target/terminator-compiler-1.0.jar src/test/resources/tests/ckks_test.t2 --seal\n```\nwill use `SEAL` with the `CKKS` scheme.\n\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"./logos/twc.png\" height=\"20%\" width=\"20%\"\u003e\n\u003c/p\u003e\n\u003ch4 align=\"center\"\u003eTrustworthy Computing Group\u003c/h4\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTrustworthyComputing%2FT2-FHE-Compiler-and-Benchmarks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FTrustworthyComputing%2FT2-FHE-Compiler-and-Benchmarks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTrustworthyComputing%2FT2-FHE-Compiler-and-Benchmarks/lists"}