{"id":20009760,"url":"https://github.com/plsyssec/fact","last_synced_at":"2026-03-05T08:32:43.017Z","repository":{"id":27929434,"uuid":"70006940","full_name":"PLSysSec/FaCT","owner":"PLSysSec","description":"Flexible and Constant Time Programming Language","archived":false,"fork":false,"pushed_at":"2022-02-18T10:17:58.000Z","size":31994,"stargazers_count":201,"open_issues_count":1,"forks_count":15,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-08-21T08:46:19.920Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"OCaml","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PLSysSec.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":"2016-10-04T21:14:28.000Z","updated_at":"2025-07-29T14:49:24.000Z","dependencies_parsed_at":"2022-07-27T11:17:49.239Z","dependency_job_id":null,"html_url":"https://github.com/PLSysSec/FaCT","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PLSysSec/FaCT","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PLSysSec%2FFaCT","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PLSysSec%2FFaCT/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PLSysSec%2FFaCT/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PLSysSec%2FFaCT/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PLSysSec","download_url":"https://codeload.github.com/PLSysSec/FaCT/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PLSysSec%2FFaCT/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30115941,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T08:19:04.902Z","status":"ssl_error","status_checked_at":"2026-03-05T08:17:37.148Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":"2024-11-13T07:17:02.066Z","updated_at":"2026-03-05T08:32:42.986Z","avatar_url":"https://github.com/PLSysSec.png","language":"OCaml","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# FaCT\n\nThis is the compiler for the Flexible and Constant Time cryptographic programming language.\nFaCT is a domain-specific language that aids you in writing constant-time code for cryptographic routines\nthat need to be free from timing side channels.\n\n## Useful links:\n\n- [Our paper](/FaCT_extended.pdf)\n- [Online demo using Compiler Explorer](https://fact.sysnet.ucsd.edu/) ([source](https://github.com/bjohannesmeyer/fact-website) forked from [mattgodbolt/compiler-explorer](https://github.com/mattgodbolt/compiler-explorer))\n- [FaCT case studies / evaluation](https://github.com/PLSysSec/fact-eval)\n- [Haskell embedding](https://github.com/PLSysSec/inline-fact)\n- [Python embedding](https://github.com/PLSysSec/CTFFI)\n- [Vim syntax files](https://github.com/PLSysSec/factlang.vim)\n\n## Building\n\nTo build the compiler, you can either build from source or download a pre-built release.\nWe recommend building from source if possible.\n\n### Virtual machine image\n\nYou can download a [VM image pre-configured for building the FaCT compiler and case studies](https://drive.google.com/open?id=1xzw4Ohsdj4WqxJPl1RvvxSnhysMSejPi).\nThe file `fact.ova` should have a SHA256 sum of `089398c85c5074d911c2f2b67ca22df453235e8733f1eb283c71717cf70f714c`.\n\n### Using Docker\n\nIf you have docker installed, you can load our docker image with the build\nenvironment already installed:\n\n```\ncd docker/\n./run.sh\n```\n\nOnce inside the docker shell, run the following to finish setting up the environment:\n\n```\ncd FaCT/\neval $(opam config env)\n```\n\n### Setting up the build environment\n\nFaCT is developed using OCaml 4.06.0 and LLVM 6.0.\n\n### Using a local environment\n\nBuilding FaCT has been tested on Ubuntu 16.04, 18.04, and macOS.\n\n\n#### 1. Install System Dependencies\n\n**Ubuntu (16.04 \u0026 18.04)**\n\n\n```\nsudo apt install llvm-6.0 clang-6.0 cmake libgmp-dev m4 pkg-config\n```\n\n**macOS**\n\nThese instructions require [Homebrew](https://brew.sh)\n```\nbrew install cmake gmp m4 pkg-config\nbrew install llvm@6 --with-toolchain\n```\n\n**Note:** This does not put the proper version of clang on your `PATH`. You will need to run:\n```\nexport PATH=\"$(brew --prefix llvm@6)/bin:$PATH\"\n```\n\n#### 2. Install OCaml + packages\n\nWe recommend installing the [opam package manager](https://opam.ocaml.org/) to manage OCaml and package dependencies:\n\n```\nsh \u003c(curl -sL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh)\n```\n\nThen, install OCaml and the libraries:\n\n```\nopam init\neval $(opam config env)\nopam switch create 4.06.0\neval $(opam config env)\nopam switch import ocamlswitch.txt\n```\n\nFinally, make sure the Z3 lib is available to the OCaml compiler:\n```\nexport LD_LIBRARY_PATH=\"$HOME/.opam/4.06.0/lib/z3:$LD_LIBRARY_PATH\"\n```\n\n#### 3. Configure Paths\nThe FaCT compiler depends on the LLVM 6.0 toolchain **at runtime**,\nand expects binaries with `-6.0` suffixes. \nEnsure that `clang-6.0` is in your PATH:\n\n```\nclang-6.0 --version\n```\n\n### Compiling FaCT\n\nYou can now build the compiler:\n\n```\noasis setup\nmake\n```\n\nThis will produce the `factc` executable.\n\n## Usage\n\n#### Basic Usage\n\nRun ```./factc \u003csource files\u003e``` to compile a FaCT program.\n\n#### Link to a C library\n\nFaCT is designed to be called from C code. Compiling FaCT source files will\noutput an object file, which can then be linked to a C file. As an example:\n\n```\ncd example/\n../factc -generate-header example.fact\nclang-6.0 -c main.c\nclang-6.0 -o final main.o example.o\n```\n\nYou can then run the executable:\n\n```./final```\n\n#### Debugging\n\nMany debugging options and intermediate data structures are available. Run ```./factc -help``` for all options.\n\n## Acknowledgements\n\nWe thank the anonymous PLDI and PLDI AEC reviewers for their suggestions and\ninsightful comments.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplsyssec%2Ffact","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplsyssec%2Ffact","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplsyssec%2Ffact/lists"}