How to use the chipwhisperer.common.utils.parameter.setupSetParam function in chipwhisperer

To help you get started, we’ve selected a few chipwhisperer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github newaetech / chipwhisperer / software / chipwhisperer / analyzer / attacks / models / base.py View on Github external
    @setupSetParam("Hardware Model")
    def setHwModel(self, model, kwargs=None):
        self.model = model
        self.model_kwargs = kwargs
        self._updateHwModel()
        self.sigParametersChanged.emit()
github newaetech / chipwhisperer / software / chipwhisperer / capture / scopes / _OpenADCInterface.py View on Github external
    @setupSetParam("Total Samples")
    def setMaxSamples(self, samples):
        self.maxsamples = samples
        self.oa.setMaxSamples(samples)
github newaetech / chipwhisperer / software / chipwhisperer / capture / scopes / openadc_interface / ftdi.py View on Github external
    @setupSetParam("Device Serial Number")
    def setSelectedDevice(self, snum):
        self.serialNumber = snum
github newaetech / chipwhisperer / software / chipwhisperer / capture / scopes / _OpenADCInterface.py View on Github external
    @setupSetParam("Stream Mode")
    def setStreamMode(self, enabled):
        self._stream_mode = enabled

        if enabled:
            self.findParam('Pre-Trigger Samples').setValue(0, ignoreReadonly=True)
            self.findParam('Pre-Trigger Samples').setReadonly(True)
            self.findParam('Total Samples').setLimits((0, 100E6))
        else:
            self.findParam('Pre-Trigger Samples').setReadonly(False)
            self.findParam('Total Samples').setLimits((0, self.oa.hwMaxSamples))

        #Write to FPGA
        base = self.oa.sendMessage(CODE_READ, ADDR_SETTINGS)[0]
        if enabled:
            val = base | (1<<4)
        else:
github newaetech / chipwhisperer / software / chipwhisperer / analyzer / attacks / _base.py View on Github external
    @setupSetParam("Traces per Attack")
    def set_traces_per_attack(self, trace):
        if trace < 0:
            #Get maximum traces from source
            ts = self.getTraceSource()
            if ts is None:
                raise ValueError("traceSource not yet set in attack - set TraceSource first to use automatic getTracesPerAttack")
            trace = self.getTraceSource().num_traces()
        self._tracePerAttack = trace
github newaetech / chipwhisperer / software / chipwhisperer / capture / scopes / _OpenADCInterface.py View on Github external
    @setupSetParam("Mode")
    def setMode(self,  mode):
        """ Input to trigger module options: 'rising edge', 'falling edge', 'high', 'low' """
        if mode == 'rising edge':
            trigmode = SETTINGS_TRIG_HIGH | SETTINGS_WAIT_YES

        elif mode == 'falling edge':
            trigmode = SETTINGS_TRIG_LOW | SETTINGS_WAIT_YES

        elif mode == 'high':
            trigmode = SETTINGS_TRIG_HIGH | SETTINGS_WAIT_NO

        elif mode == 'low':
            trigmode = SETTINGS_TRIG_LOW | SETTINGS_WAIT_NO

        else:
            raise ValueError,  "%s invalid trigger mode"%mode
github newaetech / chipwhisperer / software / chipwhisperer / common / utils / tracesource.py View on Github external
    @setupSetParam('Input')
    def setTraceSource(self, traceSource):
        #Avoid doing processing when set to same value
        if self._traceSource == traceSource:
            return

        if self._traceSource:
            self._traceSource.sigTracesChanged.disconnect(self.processTraces)
        if traceSource:
            traceSource.sigTracesChanged.connect(self.processTraces)
        self._traceSource = traceSource

        self.processTraces()
github newaetech / chipwhisperer / software / chipwhisperer / analyzer / preprocessing / decimation_fixed.py View on Github external
    @setupSetParam("Decimation = N:1")
    def _setDecFactor(self, dec=1):
        self._dec_factor = dec
github newaetech / chipwhisperer / software / chipwhisperer / common / api / ProjectFormat.py View on Github external
    @setupSetParam("Trace Format")
    def set_trace_format(self, trace_format):
        self._trace_format = trace_format
github newaetech / chipwhisperer / software / chipwhisperer / capture / targets / SmartCard.py View on Github external
    @setupSetParam("SmartCard Protocol")
    def setProtocol(self, con):
        self.protocol = con
        if self.protocol is not None:
            self.params.append(self.protocol.getParams())
            self.protocol.setReaderHardware(self.driver)