pyecsca.sca.target.chipwhisperer module¶
Provides a ChipWhisperer target class.
ChipWhisperer is a side-channel analysis tool and framework. A ChipWhisperer target is one that uses the ChipWhisperer’s SimpleSerial communication protocol and is communicated with using ChipWhisperer-Lite or Pro.
- class ChipWhispererTarget(target, scope, programmer, **kwargs)[source]¶
Bases:
Flashable
,SimpleSerialTarget
ChipWhisperer-based target, using the SimpleSerial-ish protocol and communicating using ChipWhisperer-Lite/Pro.
- flash(fw_path)[source]¶
Flash the firmware at fw_path to the target.
- Parameters:
fw_path¶ (
str
) – The path to the firmware blob.- Return type:
bool
- Returns:
Whether the flashing was successful.
- write(data)[source]¶
Write the
data
bytes to the target’s serial input.- Parameters:
data¶ (
bytes
) – The data to write.- Return type:
None
- read(num=0, timeout=0)[source]¶
Read upto
num
bytes or untiltimeout
milliseconds from the target’s serial output.
- recv_msgs(timeout)[source]¶
Receive
SimpleSerialMessage
messages, while waiting uptotimeout
seconds.- Parameters:
timeout¶ (
int
) – How long to wait.- Return type:
Mapping
[str
,SimpleSerialMessage
]- Returns:
The received messages with their char.
- send_cmd(cmd, timeout)[source]¶
Send a
SimpleSerialMessage
and receive the response messages that the command produces, within atimeout
.- Parameters:
cmd¶ (
SimpleSerialMessage
) – The command message to send.timeout¶ (
int
) – The timeout value to wait for the responses.
- Return type:
Mapping
[str
,SimpleSerialMessage
]- Returns:
A mapping of the starting character of the message to the message.