Skip to content

[fi] Add ChipShouter support #393

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions doc/chipshouter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# EMFI Setup

ot-sca supports EMFI with the ChipShouter + ChipWhisperer Husky + ChipShover XZY table.

## Setup

To perform electromagnetic fault injection evaluations with ot-sca, you need to setup the gear as following:

![](img/chipshouter_setup.png)

* [ChipShouter](https://www.newae.com/products/nae-cw520)
* Injects the electromagnetic pulse into the DUT (i.e., the CW310 FPGA board or the chip)
* Configured by the ot-sca framework to receive a pulse at the hardware trigger (SMB) input from the ChipWhisperer Husky
* Electromagnetic pulse is based on the received pulse from the Husky
* [ChipShover](https://github.com/newaetech/ChipShover)
* Moves the XZY position of the ChipShouter
* Configured & controlled by ot-sca
* [ChipWhisperer Husky](https://www.newae.com/products/nae-cwhusky)
* Configured & controlled by ot-sca
* Receives trigger signal from DUT
* Generates pulse at the Trigger/Glitch out SMB output
* Forwarded to the ChipShouter input

![](img/cs_setup.jpg)

The picture above shows the entire setup.
By connecting the Husky Trigger/Glitch out (SMB) port to the ChipShouter hardware trigger (SMB), the pulse is forwarded from the Husky to the ChipShouter.
The DUT trigger is connected to the ChipWhisperer Husky IO4 port.

## Electromagnetic Pulse Generation

The ChipShouter is configured by the ot-sca framework to receive a pulse at the hardware trigger (SMB) input that is generated by the ChipWhisperer Husky at the Trigger/Glitch out (SMB) output.
Internally, the ChipShouter shapes the electromagnetic pulse based on this received pulse.

To allow fine adjustment steps, the pulse is generated at the HS2 output of the ChipWhisperer Husky.
```python
self.cwh.clock.clkgen_freq = 50e6
self.cwh.glitch.output = 'enable_only'
self.cwh.glitch.repeat = <width>
self.cwh.glitch.ext_offset = <offset>
```
The code snippet above shows the glitch width configuration.
When using the `enable_only` mode, the minimum glitch length as well as the minimum glitch step width is the `clkgen_freq`, i.e., `20ns`.
The glitch width can be configured with the `repeat` setting.
By setting this parameter to 5, the glitch width is `5 * 20ns = 100ns`.
Similar, to configure the trigger delay, set the `ext_offset`, i.e., a glitch offset of 10 means `10 * 20ns = 200ns`.

The electromagnetic pulse voltage is directly set in the ChipShouter over the serial interface.

## Timing Diagram

![](img/chipshouter_trigger.png)

The timing diagram above shows the trigger signal generated by the DUT (yellow), the pulse generated by the Husky (red) and the electromagnetic pulse generated by the ChipShouter (blue).

When detecting the rising edge of the DUT trigger signal, the Huksy waits for `trigger_delay` ns before sending the pules out of the HS2 output port.

Please note that the ChipWhisperer Husky as well as the ChipShouter has a small latency, i.e., even with a `trigger_delay = 0ns`, the electromagnetic pulse is not injected immediately.
194 changes: 194 additions & 0 deletions doc/img/chipshouter_setup.drawio
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
<mxfile host="app.diagrams.net" agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36" version="26.1.0">
<diagram name="Page-1" id="riEWMHiLTF9Y2TbZ6S7O">
<mxGraphModel dx="934" dy="1858" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="gtuDRXqGYE2C-aJImSRh-3" value="Pentest Framework" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="120" y="290" width="140" height="30" as="geometry" />
</mxCell>
<mxCell id="GZRp_enLugIMK-H5HnV--2" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="gtuDRXqGYE2C-aJImSRh-1" target="gtuDRXqGYE2C-aJImSRh-7">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="GZRp_enLugIMK-H5HnV--3" value="Trigger" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="GZRp_enLugIMK-H5HnV--2">
<mxGeometry x="-0.1603" y="2" relative="1" as="geometry">
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="gtuDRXqGYE2C-aJImSRh-1" value="DUT&lt;br&gt;(CW310 or chip)" style="rounded=0;whiteSpace=wrap;html=1;strokeColor=#9C4D53;fillColor=none;strokeWidth=2;" parent="1" vertex="1">
<mxGeometry x="120" y="180" width="140" height="140" as="geometry" />
</mxCell>
<mxCell id="gtuDRXqGYE2C-aJImSRh-23" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.75;exitY=1;exitDx=0;exitDy=0;entryX=0;entryY=0.25;entryDx=0;entryDy=0;" parent="1" source="gtuDRXqGYE2C-aJImSRh-1" target="gtuDRXqGYE2C-aJImSRh-17" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="gtuDRXqGYE2C-aJImSRh-26" value="Response" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="gtuDRXqGYE2C-aJImSRh-23" vertex="1" connectable="0">
<mxGeometry x="-0.4239" y="-1" relative="1" as="geometry">
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="GZRp_enLugIMK-H5HnV--23" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.25;exitDx=0;exitDy=0;entryX=1;entryY=0.75;entryDx=0;entryDy=0;" edge="1" parent="1" source="gtuDRXqGYE2C-aJImSRh-7" target="GZRp_enLugIMK-H5HnV--9">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="GZRp_enLugIMK-H5HnV--47" value="Pulse" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="GZRp_enLugIMK-H5HnV--23">
<mxGeometry x="-0.5426" y="-1" relative="1" as="geometry">
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="gtuDRXqGYE2C-aJImSRh-7" value="CW Husky&lt;br&gt;Scope" style="rounded=0;whiteSpace=wrap;html=1;strokeColor=#032E96;fillColor=none;strokeWidth=2;" parent="1" vertex="1">
<mxGeometry x="320" y="180" width="140" height="140" as="geometry" />
</mxCell>
<mxCell id="gtuDRXqGYE2C-aJImSRh-22" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.75;exitDx=0;exitDy=0;entryX=0.25;entryY=1;entryDx=0;entryDy=0;" parent="1" source="gtuDRXqGYE2C-aJImSRh-17" target="gtuDRXqGYE2C-aJImSRh-1" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="gtuDRXqGYE2C-aJImSRh-25" value="Configuration" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="gtuDRXqGYE2C-aJImSRh-22" vertex="1" connectable="0">
<mxGeometry x="0.3824" relative="1" as="geometry">
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="GZRp_enLugIMK-H5HnV--5" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;" edge="1" parent="1" source="gtuDRXqGYE2C-aJImSRh-17" target="gtuDRXqGYE2C-aJImSRh-7">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="390" y="434" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="GZRp_enLugIMK-H5HnV--6" value="Configuration" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="GZRp_enLugIMK-H5HnV--5">
<mxGeometry x="0.1592" relative="1" as="geometry">
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="GZRp_enLugIMK-H5HnV--7" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;" edge="1" parent="1" source="gtuDRXqGYE2C-aJImSRh-17" target="gtuDRXqGYE2C-aJImSRh-1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="GZRp_enLugIMK-H5HnV--8" value="Reset" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="GZRp_enLugIMK-H5HnV--7">
<mxGeometry x="0.3574" relative="1" as="geometry">
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="GZRp_enLugIMK-H5HnV--30" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="gtuDRXqGYE2C-aJImSRh-17" target="GZRp_enLugIMK-H5HnV--9">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="500" y="464" />
<mxPoint x="500" y="160" />
<mxPoint x="300" y="160" />
<mxPoint x="300" y="60" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="GZRp_enLugIMK-H5HnV--35" value="Configuration" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="GZRp_enLugIMK-H5HnV--30">
<mxGeometry x="0.1717" y="-1" relative="1" as="geometry">
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="gtuDRXqGYE2C-aJImSRh-17" value="ot-sca&lt;br&gt;Fault Injection Evaluation Framework" style="rounded=0;whiteSpace=wrap;html=1;strokeWidth=2;" parent="1" vertex="1">
<mxGeometry x="260" y="434" width="220" height="60" as="geometry" />
</mxCell>
<mxCell id="GZRp_enLugIMK-H5HnV--13" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="1" source="GZRp_enLugIMK-H5HnV--9" target="gtuDRXqGYE2C-aJImSRh-1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="GZRp_enLugIMK-H5HnV--56" value="EMFI" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="GZRp_enLugIMK-H5HnV--13">
<mxGeometry x="-0.6356" relative="1" as="geometry">
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="GZRp_enLugIMK-H5HnV--9" value="ChipShouter" style="rounded=0;whiteSpace=wrap;html=1;strokeColor=#CCCCCC;fillColor=none;strokeWidth=2;" vertex="1" parent="1">
<mxGeometry x="120" y="-10" width="140" height="140" as="geometry" />
</mxCell>
<mxCell id="GZRp_enLugIMK-H5HnV--31" style="edgeStyle=none;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;startArrow=classic;startFill=1;endArrow=none;" edge="1" parent="1" source="GZRp_enLugIMK-H5HnV--10">
<mxGeometry relative="1" as="geometry">
<mxPoint x="390" y="160" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="GZRp_enLugIMK-H5HnV--32" style="edgeStyle=none;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.25;exitDx=0;exitDy=0;entryX=1;entryY=0.25;entryDx=0;entryDy=0;" edge="1" parent="1" source="GZRp_enLugIMK-H5HnV--10" target="GZRp_enLugIMK-H5HnV--9">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="GZRp_enLugIMK-H5HnV--33" value="XZY" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="GZRp_enLugIMK-H5HnV--32">
<mxGeometry x="0.1349" relative="1" as="geometry">
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="GZRp_enLugIMK-H5HnV--10" value="ChipShover" style="rounded=0;whiteSpace=wrap;html=1;strokeColor=#CCCCCC;fillColor=none;strokeWidth=2;" vertex="1" parent="1">
<mxGeometry x="320" y="-10" width="140" height="140" as="geometry" />
</mxCell>
<mxCell id="GZRp_enLugIMK-H5HnV--16" value="" style="shape=mxgraph.signs.safety.high_voltage_2;html=1;pointerEvents=1;fillColor=light-dark(#fff700, #281d00);strokeColor=none;verticalLabelPosition=bottom;verticalAlign=top;align=center;sketch=0;" vertex="1" parent="1">
<mxGeometry x="207" y="135" width="16.16" height="40" as="geometry" />
</mxCell>
<mxCell id="GZRp_enLugIMK-H5HnV--37" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#000000;" vertex="1" parent="1">
<mxGeometry x="389" y="158" width="3" height="3" as="geometry" />
</mxCell>
<mxCell id="GZRp_enLugIMK-H5HnV--39" value="" style="endArrow=none;html=1;rounded=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="270" y="195" as="sourcePoint" />
<mxPoint x="280" y="195" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="GZRp_enLugIMK-H5HnV--40" value="" style="endArrow=none;html=1;rounded=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="300" y="195" as="sourcePoint" />
<mxPoint x="310" y="195" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="GZRp_enLugIMK-H5HnV--41" value="" style="endArrow=none;html=1;rounded=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="280" y="175" as="sourcePoint" />
<mxPoint x="290" y="175" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="GZRp_enLugIMK-H5HnV--42" value="" style="endArrow=none;html=1;rounded=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="290" y="175" as="sourcePoint" />
<mxPoint x="300" y="175" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="GZRp_enLugIMK-H5HnV--43" value="" style="endArrow=none;html=1;rounded=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="280" y="195" as="sourcePoint" />
<mxPoint x="280" y="175" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="GZRp_enLugIMK-H5HnV--44" value="" style="endArrow=none;html=1;rounded=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="300" y="195" as="sourcePoint" />
<mxPoint x="300" y="175" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="GZRp_enLugIMK-H5HnV--48" value="" style="endArrow=none;html=1;rounded=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="170" y="174.86" as="sourcePoint" />
<mxPoint x="180" y="174.86" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="GZRp_enLugIMK-H5HnV--49" value="" style="endArrow=none;html=1;rounded=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="200" y="174.86" as="sourcePoint" />
<mxPoint x="210" y="174.86" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="GZRp_enLugIMK-H5HnV--50" value="" style="endArrow=none;html=1;rounded=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="180" y="154.86" as="sourcePoint" />
<mxPoint x="190" y="154.86" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="GZRp_enLugIMK-H5HnV--51" value="" style="endArrow=none;html=1;rounded=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="190" y="154.86" as="sourcePoint" />
<mxPoint x="200" y="154.86" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="GZRp_enLugIMK-H5HnV--52" value="" style="endArrow=none;html=1;rounded=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="180" y="174.86" as="sourcePoint" />
<mxPoint x="180" y="154.86" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="GZRp_enLugIMK-H5HnV--53" value="" style="endArrow=none;html=1;rounded=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="200" y="174.86" as="sourcePoint" />
<mxPoint x="200" y="154.86" as="targetPoint" />
</mxGeometry>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
3 changes: 3 additions & 0 deletions doc/img/chipshouter_setup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions doc/img/chipshouter_trigger.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions doc/img/cs_setup.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading