Skip to content

Commit

Permalink
document CWScope constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
SamKarkache committed Apr 12, 2024
1 parent 03f8b1d commit 0b30658
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 18 deletions.
17 changes: 14 additions & 3 deletions WPI_SCA_LIBRARY/CWScope.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,24 @@

class CWScope:

def __init__(self, firmware_path, gain=25, num_samples=5000, offset=0, target_type=cw.targets.SimpleSerial, target_programmer=cw.programmers.STM32FProgrammer):
def __init__(self, firmware_path: str, gain: int = 25, num_samples: int = 5000, offset: int = 0,
target_type: any = cw.targets.SimpleSerial, target_programmer: any = cw.programmers.STM32FProgrammer) -> None:
"""
Initializes a CW scope object
:param firmware_path: The name of the compiled firmware that will be loaded on the CW device.
:param firmware_path: The name of the compiled firmware that will be loaded on the CW target board
:type firmware_path: str
:param gain: The gain of the CW scope
:type gain: int
:param num_samples: The number of samples to collect for each trace on the CW scope
:param offset: The offset of the trace collection
:type num_samples: int
:param offset: The tine offset for CW scope trace collection
:type offset: int
:param target_type: The target type of the CW scope. This depends on the specific ChipWhisperer device that you are using.
:type target_type: any
:param target_programmer: The target programmer of the CW scope. This depends on the specific ChipWhisperer device that you are using.
:type target_programmer: any
:return: None
:Authors: Samuel Karkache (swkarkache@wpi.edu)
"""
# setup scope
self.scope = cw.scope()
Expand Down
41 changes: 41 additions & 0 deletions doc/cwscope.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
Oscilloscope Interface
======================

Researchers at WPI and across the country use ChipWhisperer devices to conduct
side-channel analysis research. ChipWhisperer has an existing library developed to
interface with their devices. However, this library was improved upon by providing
higher-level API calls

.. class:: CWScope

Initializes the scope object...

.. method:: __init__

Initializes a CW scope object

:param firmware_path: The name of the compiled firmware that will be loaded on the CW target board
:type firmware_path: str
:param gain: The gain of the CW scope
:type gain: int
:param num_samples: The number of samples to collect for each trace on the CW scope
:type num_samples: int
:param offset: The tine offset for CW scope trace collection
:type offset: int
:param target_type: The target type of the CW scope. This depends on the specific ChipWhisperer device that you are using.
:type target_type: any
:param target_programmer: The target programmer of the CW scope. This depends on the specific ChipWhisperer device that you are using.
:type target_programmer: any
:return: None
:Authors: Samuel Karkache (swkarkache@wpi.edu)



.. method:: disconnect(self)

Disconnect CW Scope and Target

.. method::

Capture procedure for ChipWhisperer devices. Will return a specified number
of traces and the data associated with the collection.
2 changes: 1 addition & 1 deletion doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Library Features
:maxdepth: 3

fileformat.rst
scope.rst
cwscope.rst
metrics.rst
leakagemodels.rst
about_project.rst
14 changes: 0 additions & 14 deletions doc/scope.rst

This file was deleted.

0 comments on commit 0b30658

Please sign in to comment.