diff --git a/WPI_SCA_LIBRARY/CWScope.py b/WPI_SCA_LIBRARY/CWScope.py index eb90e64..d6b7eb1 100644 --- a/WPI_SCA_LIBRARY/CWScope.py +++ b/WPI_SCA_LIBRARY/CWScope.py @@ -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() diff --git a/doc/cwscope.rst b/doc/cwscope.rst new file mode 100644 index 0000000..051bf1d --- /dev/null +++ b/doc/cwscope.rst @@ -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. diff --git a/doc/index.rst b/doc/index.rst index 09b1622..9091491 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -18,7 +18,7 @@ Library Features :maxdepth: 3 fileformat.rst - scope.rst + cwscope.rst metrics.rst leakagemodels.rst about_project.rst \ No newline at end of file diff --git a/doc/scope.rst b/doc/scope.rst deleted file mode 100644 index 4f08229..0000000 --- a/doc/scope.rst +++ /dev/null @@ -1,14 +0,0 @@ -Oscilloscope Interface -====================== - -The ChipWhisperer scope interface documentation - -.. class:: CWScope - - Initializes the scope object... - - .. method:: __init__ - - .. method:: disconnect(self) - - Disconnect from...