{"id":19909080,"url":"https://github.com/dyne/pangolin","last_synced_at":"2025-10-24T01:35:18.067Z","repository":{"id":141086362,"uuid":"259651931","full_name":"dyne/pangolin","owner":"dyne","description":"The Secret Pangolin Code, Fastest Proximity Tracing in the West (FPTW)","archived":false,"fork":false,"pushed_at":"2020-05-05T02:14:31.000Z","size":899,"stargazers_count":8,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-07T10:35:44.471Z","etag":null,"topics":["c","contact-tracing","dp3t","optimization","proximity-tracing","speed"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dyne.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-04-28T13:56:24.000Z","updated_at":"2023-02-27T17:50:54.000Z","dependencies_parsed_at":"2023-03-24T22:44:21.684Z","dependency_job_id":null,"html_url":"https://github.com/dyne/pangolin","commit_stats":{"total_commits":19,"total_committers":3,"mean_commits":6.333333333333333,"dds":"0.21052631578947367","last_synced_commit":"db7595a95b394c1d6206ab560a6b810c425899ee"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dyne%2Fpangolin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dyne%2Fpangolin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dyne%2Fpangolin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dyne%2Fpangolin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dyne","download_url":"https://codeload.github.com/dyne/pangolin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252133723,"owners_count":21699586,"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":["c","contact-tracing","dp3t","optimization","proximity-tracing","speed"],"created_at":"2024-11-12T21:14:19.584Z","updated_at":"2025-10-24T01:35:18.007Z","avatar_url":"https://github.com/dyne.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.dyne.org\"\u003e\n    \u003cimg alt=\"Pangolin\" src=\"./img/pangolin.svg\" width=\"150\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003e\n  The Secret Pangolin Code\u003c/br\u003e\n  \u003csub\u003eFastest Proximity Tracing in the West (FPTW)\u003c/sub\u003e\n\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://dyne.org\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/%3C%2F%3E%20with%20%E2%9D%A4%20by-Dyne.org-blue.svg\" alt=\"Dyne.org\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cbr\u003e\u003cbr\u003e\n\n\u003ch4 align=\"center\"\u003e\n  \u003ca href=\"#-install\"\u003e💾 Install\u003c/a\u003e\n  \u003cspan\u003e • \u003c/span\u003e\n  \u003ca href=\"#-quick-start\"\u003e🎮 Quick start\u003c/a\u003e\n  \u003cspan\u003e • \u003c/span\u003e\n  \u003ca href=\"#-api\"\u003e🐝 API\u003c/a\u003e\n  \u003cspan\u003e • \u003c/span\u003e\n  \u003ca href=\"#-testing\"\u003e📋 Testing\u003c/a\u003e\n  \u003cspan\u003e • \u003c/span\u003e\n  \u003ca href=\"#-acknowledgements\"\u003e😍 Acknowledgements\u003c/a\u003e\n  \u003cspan\u003e • \u003c/span\u003e\n  \u003ca href=\"#-links\"\u003e🌐 Links\u003c/a\u003e\n  \u003cspan\u003e • \u003c/span\u003e\n  \u003ca href=\"#-contributing\"\u003e👤 Contributing\u003c/a\u003e\n  \u003cspan\u003e • \u003c/span\u003e\n  \u003ca href=\"#-license\"\u003e💼 License\u003c/a\u003e\n\u003c/h4\u003e\n\n\u003cbr\u003e\u003cbr\u003e\n\nThis is a library implementing \"proximity tracing\" protocols for privacy-preserving contact tracing. \n\nThe Secret Pangolin Code has the ambition to run at blazing fast speeds while being easy to maintain and fully compliant with FIPS.\n\nThis code is the Fastest Proximity Tracing in the West, until proven wrong of course! and developed with the _embedded first_ mindset.\n\nAt this moment the first and only protocol implemented is [DP3T](https://github.com/dp-3T/documents)\n\nPangolin is crafted with care by developers of the [DECODE project](https://decodeproject.eu) about data-ownership and [technological sovereignty](https://www.youtube.com/watch?v=RvBRbwBm_nQ). Our effort is that of improving people's awareness of how their data is processed by algorithms, as well facilitate the work of developers to create along [privacy by design principles](https://decodeproject.eu/publications/privacy-design-strategies-decode-architecture) using algorithms that can be deployed in any situation without any change.\n\n\n\u003cdetails id=\"toc\"\u003e\n \u003csummary\u003e\u003cstrong\u003e🚩 Table of Contents\u003c/strong\u003e (click to expand)\u003c/summary\u003e\n\n* [Install](#-install)\n* [Quick start](#-quick-start)\n* [API](#-api)\n* [Testing](#-testing)\n* [Troubleshooting \u0026 debugging](#-troubleshooting--debugging)\n* [Acknowledgements](#-acknowledgements)\n* [Links](#-links)\n* [Contributing](#-contributing)\n* [License](#-license)\n\u003c/details\u003e\n\n---\n## 💾 Install\n\nSimply run the default target of `Makefile`\n\n```bash\nmake\n```\n\n---\n## 🎮 Quick start\n\nTo see Pangolin in action your best move is to run the tests like\n\n```bash\nmake check\n```\n\n---\n## 🐝 API\n\nLook a the [header\nfile](https://github.com/dyne/pangolin/blob/master/src/dp3t.h) to see\nthe current API, more documentation will come soon.\n\nFunctions:\n```c\nvoid renew_key(sk_t dest, sk_t src);\n\nint32_t generate_beacons(beacons_t *beacons, uint32_t max_beacons,\n                         const sk_t oldest_sk, const uint32_t day, const uint32_t ttl,\n                         const char *bk, uint32_t bklen);\n\nint32_t match_positive(matches_t *matches, uint32_t max_matches,\n                       const sk_t positive, const contacts_t *contacts);\n\t\t\t\t\t   \n```\n\nData structures:\n```c\n// simple offset structure of num elements sized EPHID_LEN bytes\ntypedef struct {\n\tuint32_t epochs;           //\u003c data length (capacity) provided by caller\n\tchar     broadcast[32];   //\u003c broadcast key\n\tuint32_t broadcast_len;  //\u003c broadcast key length\n\tbeacon_t ephids[0];    //\u003c data offset provided by caller\n} beacons_t;\n\ntypedef struct __attribute__((packed)) {\n\tuint8_t day;\n\tuint8_t epoch;\n\tuint8_t rssi;\n\tuint8_t reserved;\n\tuint8_t data[16];\n} contact_t;\n\ntypedef struct {\n\tuint32_t count;             //\u003c number of ephids stored\n\tcontact_t *ephids;         //\u003c array of ephids\n\tuint32_t epochs;          //\u003c how many epochs in a day\n\tchar     broadcast[32];  //\u003c broadcast key\n\tuint32_t broadcast_len; //\u003c broadcast key length\n} contacts_t; // always const\n\n// struct filled with match_positive results, it does not use more\n// memory but returns pointers to contact_t data passed in from\n// contacts_t\ntypedef struct {\n\tuint32_t count;           //\u003c number of ephids stored\n\tcontact_t *ephids[0];     //\u003c array of pointers to contacts found\n} matches_t;\n```\n\n## 📋 Testing\n\nRunning the test with\n\n```bash\nmake check\n```\n\nwill test the build against [DP3T vectors published here](https://github.com/DP-3T/documents/issues/62).\n\nTo ease the maintainance, production and comparison of test vectors one can also use our other software [Zenroom](https://zenroom.org) which also includes a [DP3T implemetation in Zencode](https://medium.com/@jaromil/decentralized-privacy-preserving-proximity-tracing-cryptography-made-easy-af0a6ae48640)\n\n---\n## 🐛 Troubleshooting \u0026 debugging\n\n\u003e Nothing to report as per now\n\nIf you find any problem or suspicious behaviours please [open an issue](../../issues)\n\n---\n## 😍 Acknowledgements\n\nCopyright © 2020 by [Dyne.org](https://www.dyne.org) foundation, Amsterdam.\n\n**The Secret Pangolin Code is licensed as AGPLv3; we are open to grant license exceptions for specific needs.**\n\nDesigned, written and maintained by Daniele Lacamera \u0026 Denis \"Jaromil\" Roio.\n\nwith contributions by Puria Nafisi Azizi.\n\nThis software relies on the awesome **wolfSSL/wolfCrypt** library.\n\nThe temporary Icon is made by [Freepik](https://www.flaticon.com/authors/freepik) from [www.flaticon.com](http://www.flaticon.com/)\n\nThe name of this project is a tribute to the [Secret Rabbit Code](http://www.mega-nerd.com/SRC/) by Erik de Castro Lopo, a seminal project in the Linux Audio scene.\n\n---\n## 🌐 Links\n\nThe Secret Pangolin Code is used by:\n- [DECODE Proximity HW](https://github.com/dyne/decode-proximity-hw): our own implementation for NRF52DK, Arduino Nano 33 IoT, Pinetime etc.\n- [ESP32-DP3T](https://github.com/chriamue/esp32-dp3t): third party, beware use of mbedTLS may break FIPS compliancy at the moment\n\nMore links:\n- [Decentralized Privacy-Preserving Proximity Tracing (DP3T)](https://github.com/DP-3T/documents)\n- [Dyne.org foundation (Amsterdam)](https://dyne.org/)\n- [DECODE project on data sovereignty](https://decodeproject.eu)\n- [Zenroom crypto VM](https://zenroom.org)\n\n---\n## 👥 Contributing\n\nPlease first take a look at the [Dyne.org - Contributor License Agreement](CONTRIBUTING.md) then\n\n1.  🔀 [FORK IT](../../fork)\n2.  Create your feature branch `git checkout -b feature/branch`\n3.  Commit your changes `git commit -am 'Add some fooBar'`\n4.  Push to the branch `git push origin feature/branch`\n5.  Create a new Pull Request\n6.  🙏 Thank you\n\n---\n## 💼 Disclaimer\n    The Secret Pangolin Code, aka the Fastest Proximity Tracing in the West (FPTW)\n    Copyright (c) 2020 Dyne.org foundation, Amsterdam\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Affero General Public License as\n    published by the Free Software Foundation, either version 3 of the\n    License, or (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Affero General Public License for more details.\n\n    You should have received a copy of the GNU Affero General Public License\n    along with this program.  If not, see \u003chttp://www.gnu.org/licenses/\u003e.\n\n**[🔝 back to top](#toc)**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdyne%2Fpangolin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdyne%2Fpangolin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdyne%2Fpangolin/lists"}