{"id":19407463,"url":"https://github.com/siamumar/triloc","last_synced_at":"2026-03-01T08:31:37.181Z","repository":{"id":84149703,"uuid":"43577548","full_name":"siamumar/TriLoc","owner":"siamumar","description":"Privacy Preserving Localization for Smart Automotive Systems","archived":false,"fork":false,"pushed_at":"2018-06-03T08:26:17.000Z","size":25670,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-25T01:41:57.545Z","etag":null,"topics":["garbled-circuits","location-privacy","privacy","privacy-preserving-localization"],"latest_commit_sha":null,"homepage":"","language":"Verilog","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/siamumar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2015-10-02T21:37:26.000Z","updated_at":"2020-11-23T09:00:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"d07499f2-77bf-4ad4-85d8-c81db17d0e71","html_url":"https://github.com/siamumar/TriLoc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/siamumar/TriLoc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siamumar%2FTriLoc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siamumar%2FTriLoc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siamumar%2FTriLoc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siamumar%2FTriLoc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/siamumar","download_url":"https://codeload.github.com/siamumar/TriLoc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siamumar%2FTriLoc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29965341,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T06:55:38.174Z","status":"ssl_error","status_checked_at":"2026-03-01T06:53:04.810Z","response_time":124,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["garbled-circuits","location-privacy","privacy","privacy-preserving-localization"],"created_at":"2024-11-10T11:47:19.965Z","updated_at":"2026-03-01T08:31:37.159Z","avatar_url":"https://github.com/siamumar.png","language":"Verilog","funding_links":[],"categories":[],"sub_categories":[],"readme":"Privacy Preserving Localization\n=======\nThis project is a simulation of the privacy preserving localization protocol for smart cars presented in [1]. For privacy preserving computation it employs\n- TinyGarble framework [2] for privacy preserving computation using Yao's Garbled Circuits (GC). \n- Semi-Honest-BMR framework [3] for privacy preserving computation using BMR.\n\n## C++ Source Code\nFirst, install the dependencies required by TinyGarble (described in the README file of the TinyGarble repository).\n\nThen compile by first configuring CMake and then calling `make` inside the `bin` directory. \n```\n  $ ./configure\n  $ cd bin\n  $ make\n  $ cd ..\n```\nUsage for the generated binary file `TriLoc` is as follows\n```\n  -h [ --help ]                           produce help message\n  -l [ --lost ]                           the lost car\n  -a [ --assisting ]                      an assisting car\n  -p [ --ports ] arg (=1111, 2222, 3333)  socket ports, the lost car opens 3 ports, each assisting car connects to one of them\n  -s [ --server_ip ] arg (=127.0.0.1)     server ip of lost car\n  -d [ --data_file ] arg (=../../test_data/location_data.txt)\n                                          file containing \u003cx,y\u003e coordinates of the assisting cars and their respective distances from the lost car\n```\nWe assume that all the assisting cars know their locations and respective distances from the lost car and read them from the location data file. \n\nExample run: GC. It uses the default location data file at test_data/location_data.txt.\n```\nTerminal 1: $ bin/CPP_src//TriLoc -l -p 1111 2222 3333\nTerminal 2: $ bin/CPP_src//TriLoc -a -p 1111\nTerminal 3: $ bin/CPP_src//TriLoc -a -p 2222\nTerminal 4: $ bin/CPP_src//TriLoc -a -p 3333\n```\nExample run: BMR. It uses the default location data files at test_data.\n```\nTerminal 1: $ ../Semi-Honest-BMR/BMRPassive.out 0 Netlist/syn/TriLoc_BMR_8.bmr test_data/lost.txt test_data/ip.txt 43739841701238781571456410093f43 0\nTerminal 2: $ ../Semi-Honest-BMR/BMRPassive.out 1 Netlist/syn/TriLoc_BMR_8.bmr test_data/assisting1.txt test_data/ip.txt  43739841701238781571456410093f43 0\nTerminal 3: $ ../Semi-Honest-BMR/BMRPassive.out 2 Netlist/syn/TriLoc_BMR_8.bmr test_data/assisting2.txt test_data/ip.txt  43739841701238781571456410093f43 0\nTerminal 4: $ ../Semi-Honest-BMR/BMRPassive.out 3 Netlist/syn/TriLoc_BMR_8.bmr test_data/assisting3.txt test_data/ip.txt  43739841701238781571456410093f43 0\n```\n\n## Simulation\n### MATLAB Simulation\nThe MATALB implementation of the triangle localization method in non-privacy preserving setting is included in the MAT_SIM directory. It also include code for analysing the error associated with the localization method (note that the privacy preserving computation does not introduce any additional error).\n### Verilog Simulation\nTo simulate with Xilinx Vivado create the Vivado project with TriLoc_Vivado.tcl in the Netlist directory. To create the project, in Vivado tcl console run\n```\nsource TriLoc_Vivado.tcl\n```\nTo update the project\n```\ncd [get_property DIRECTORY [current_project]]\nwrite_project_tcl -force -target_proj_dir TriLoc_Vivado TriLoc_Vivado.tcl\n```\n\n## Generating Netlist\nNetlist generation requires the [TinyGarbleCircuitSynthesis](https://github.com/siamumar/TinyGarbleCircuitSynthesis.git) library.\n\nThe Netlist directory includes the Verilog implementation of the functions required by the Yao's GC protocol:\n- Intersection: to compute the pair of intersections of two circles. It has two implementations- with sequential and combinational implementations of the square root function.\n- Inside: to check which one of the intersections is inside a third circle\n- One_vertex: combination of Intersection and Inside to compute one vertex of the triangle\n- Median: to compute the median of the triangle\n- TriLoc: combination of One_vertex and Median to compute the final location\n\nIntersection and Inside netlists are used in the GC based protocol and the TriLoc netlist is used in the BMR based protocol. \n\n\nTo compile the Verilog files to netlists with Synopsys DC, run inside Netlist/dc/\n```\n$ ./compile.sh $1 $2 $3 $4 $5 $6\n```\n$1, $2,$3, $4, $5, $6 are flags for \u003ci\u003eintersections_seq.v\u003c/i\u003e, \u003ci\u003eintersections_comb.v\u003c/i\u003e, \u003ci\u003einside.v\u003c/i\u003e, \u003ci\u003eone_vertex.v\u003c/i\u003e, \u003ci\u003emedian_x_3.v\u003c/i\u003e, \u003ci\u003eTriLoc_BMR.v\u003c/i\u003e respectively. Set them to 1 to compile the corresponding Verilog files, otherwise set them to 0. \n\nTo compile the TriLoc code to netlists with Yosys, run inside Netlist/dc/\n```\n$ yosys -s TriLoc_BMR_syn.yos\n```\n\nTo generate the SCD files required by TinyGarble call `V2SCD_Main` in [TinyGarbleCircuitSynthesis](https://github.com/siamumar/TinyGarbleCircuitSynthesis.git)/Verilog2SCD. \n```\n$ ../TinyGarbleCircuitSynthesis/Verilog2SCD/bin/V2SCD_Main -i Netlist/syn/\u003cfile\u003e.v -o Netlist/syn/\u003cfile\u003e.scd --log2std\n```\nTo generate the circuit file required by BMR call `V2BMR_Main` in [TinyGarbleCircuitSynthesis](https://github.com/siamumar/TinyGarbleCircuitSynthesis.git)/Verilog2BMR. \n```\n$ ../TinyGarbleCircuitSynthesis/Verilog2BMR/bin/V2BMR_Main -i Netlist/syn/TriLoc_BMR_8.v -b Netlist/syn/TriLoc_BMR_8.bmr -p 16 16 16 27 --log2std\n```\n\nThe bit length can be changed by changing the parameter `N`. Also set the macros accordingly in `CPP_src\\tri_loc.h`. Netlists and SCD files with bit length 8 is already provided inside the `Netlist\\syn` directory.\n\n## References\n[1] Siam U. Hussain, and Farinaz Koushanfar, [\"Privacy Preserving Localization for Smart Automotive Systems.\"](http://aceslab.org/sites/default/files/Localization.pdf) \u003ci\u003eDesign Automation Conference, 2016\u003c/i\u003e, June, 2016.\n\n[2] Ebrahim M. Songhori, Siam U. Hussain, Ahmad-Reza Sadeghi, Thomas Schneider\nand Farinaz Koushanfar, [\"TinyGarble: Highly Compressed and Scalable Sequential\nGarbled Circuits.\"](http://aceslab.org/sites/default/files/TinyGarble.pdf) \u003ci\u003eSecurity\nand Privacy, 2015 IEEE Symposium on\u003c/i\u003e,  May, 2015.\n\n[3] Aner Ben-Efraim, Yehuda Lindell, and Eran Omri, [\"Optimizing Semi-Honest Secure Multiparty Computation for the Internet\"](https://eprint.iacr.org/2016/1066.pdf), \u003ci\u003eACM SIGSAC Conference on Computer and Communications Security\u003c/i\u003e, Oct, 2016. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiamumar%2Ftriloc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsiamumar%2Ftriloc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiamumar%2Ftriloc/lists"}