moosic-yosys-plugin
Yosys plugin for logic locking and supply-chain security
Science Score: 67.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 3 DOI reference(s) in README -
✓Academic publication links
Links to: zenodo.org -
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (13.4%) to scientific vocabulary
Keywords
Repository
Yosys plugin for logic locking and supply-chain security
Basic Info
Statistics
- Stars: 22
- Watchers: 4
- Forks: 3
- Open Issues: 3
- Releases: 11
Topics
Metadata Files
README.md
Logic Locking for Yosys
Description
When creating an electronic circuit, manufacturing steps are usually performed by third-party actors. In order to build confidence that the circuit built is not tempered with and is not used by third-parties, a variety of methods have been devised. A common approach, logic locking, is to introduce additional logic that requires the correct key to function as designed.
This mangling makes it more difficult to reverse-engineer the circuit, to add trojans, or simply to reuse without the correct key.
This repository provides a Yosys plugin to add logic locking functionality to a circuit and perform security analysis.
Slides and Video from Free Silicon Conference 2023
Logic locking in a nutshell
The most common technique for logic locking is to insert XOR/NXOR gates on some wires of the design, such that an extra input with the correct value is required for them to act as a (buffered) wire again. This value is 1 for NXOR and 0 for XOR. The key needs to be supplied as an input to unlock the circuit. This is the method used by the plugin.
Any gate that keeps the previous functionality could be inserted. For example, we can mix signals using multiplexers. A MUX is inserted on a wire with an irrelevant signal connected to the other input of the MUX. In this case, the key value selects between the correct signal and the irrelevant one. Another possibility is to replace gates with lookup-tables, which will have to be programmed correctly.
Several attacks have been designed against logic locking. This plugin provides countermeasures against common attacks based on Sat solvers.
Key handling (getting the key onto the chip) is highly application-specific and is left to the user.
Using the plugin
The plugin defines a new logic_locking command. To run Yosys with the plugin:
sh
yosys -m moosic
And in Yosys:
```sh
First synthetize and flatten our design; hierarchical designs are not supported
synth; flatten
Look at the command documentation
help logic_locking
Add logic locking with a 16b key, with hexadecimal key 048c
logic_locking -nb-locked 16 -key 048c
Add logic locking up to 5% of the module size, maximizing output corruption, with an auto-generated key
logic_locking -nb-locked 5% -target corruption
Check if the key can be recovered by a Sat attack after locking
llsatattack -key 048c ```
A new port is created on the selected module, named moosic_key by default.
The module will work as designed only when the correct key is provided as an input.
Installation instructions
To install this plugin - Install Yosys from source or from oss-cad-suite (a recent version is required). - Build and install:
sh
make
sudo make install
Design space exploration
Moosic allows you to explore the tradeoffs between performance and security. This will suggest many possible solutions with different tradeoffs (a Pareto front). It is up to you to pick one that works best for your usecase.
```sh
Run design space exploration on area, delay and corruption
Export solution identifiers and results to explore.csv
ll_explore -area -delay -corruption -output explore.csv
Show the gates that will be locked by a solution
ll_show -locking 38b0e
Compute more information (area, delay, security, ...) on a solution
ll_analyze -locking 38b0e
Apply a locking solution returned by design space exploration
Modify the design, adding a key input port and key gates
ll_apply -locking 38b0e -key 048 ```
Questions
You can ask any question you have on the Matrix channel. Don't hesitate to file an issue if you find a bug.
Owner
- Name: Gabriel Gouvine
- Login: Coloquinte
- Kind: user
- Location: Edinburgh
- Company: AMD
- Repositories: 36
- Profile: https://github.com/Coloquinte
Citation (CITATION.cff)
cff-version: 1.2.0
title: Moosic Yosys Plugin
message: >-
If you use this software and want to cite it, please use
the citation below.
type: software
authors:
- family-names: Gouvine
given-names: Gabriel
orcid: 0000-0003-3404-6659
- family-names: Chotin
given-names: Roselyne
orcid: 0000-0001-7990-9070
affiliation: LIP6
- family-names: Zaourar
given-names: Lilia
orcid: 0000-0002-6660-4347
affiliation: CEA LIST
- family-names: Fontaine
given-names: Jonathan
affiliation: CEA LIST
repository-code: https://github.com/Coloquinte/moosic-yosys-plugin
keywords:
- logic locking
- yosys plugin
license: GPL-2.0-or-later
date-released: 2023-10-25
doi: 10.5281/zenodo.10390403
GitHub Events
Total
- Create event: 1
- Release event: 1
- Issues event: 2
- Watch event: 2
- Issue comment event: 1
- Push event: 1
- Fork event: 1
Last Year
- Create event: 1
- Release event: 1
- Issues event: 2
- Watch event: 2
- Issue comment event: 1
- Push event: 1
- Fork event: 1
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 21
- Total pull requests: 9
- Average time to close issues: about 1 month
- Average time to close pull requests: about 3 hours
- Total issue authors: 6
- Total pull request authors: 2
- Average comments per issue: 1.38
- Average comments per pull request: 0.22
- Merged pull requests: 9
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 1
- Pull requests: 0
- Average time to close issues: about 1 month
- Average time to close pull requests: N/A
- Issue authors: 1
- Pull request authors: 0
- Average comments per issue: 1.0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- Coloquinte (12)
- mattvenn (4)
- gadfort (1)
- alain6666 (1)
- med-dee (1)
- thesourcerer8 (1)
Pull Request Authors
- Coloquinte (14)
- ElectricPotato (1)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- actions/checkout v3 composite
- actions/upload-artifact v3 composite