本文整理汇总了Python中openadc.ExtendedParameter.ExtendedParameter类的典型用法代码示例。如果您正苦于以下问题:Python ExtendedParameter类的具体用法?Python ExtendedParameter怎么用?Python ExtendedParameter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ExtendedParameter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self):
super(ResultsPlotting, self).__init__()
self.override = None
#ResultsTable manages class
self.table = ResultsTable()
self.table.setKeyOverride(self.processKnownKey)
self.graphoutput = OutputVsTime()
self.GraphOutputDock = QDockWidget(self.graphoutput.name)
self.GraphOutputDock.setObjectName(self.graphoutput.name)
self.GraphOutputDock.setAllowedAreas(Qt.BottomDockWidgetArea | Qt.RightDockWidgetArea| Qt.LeftDockWidgetArea)
self.GraphOutputDock.setWidget(self.graphoutput)
self.graphoutput.setDock(self.GraphOutputDock)
self.graphoutput.setKeyOverride(self.processKnownKey)
self.pgegraph = PGEVsTrace()
self.PGEGraphDock = QDockWidget(self.pgegraph.name)
self.PGEGraphDock.setObjectName(self.pgegraph.name)
self.PGEGraphDock.setAllowedAreas(Qt.BottomDockWidgetArea | Qt.RightDockWidgetArea| Qt.LeftDockWidgetArea)
self.PGEGraphDock.setWidget(self.pgegraph)
self.pgegraph.setDock(self.PGEGraphDock)
self.pgegraph.setKeyOverride(self.processKnownKey)
self.saveresults = ResultsSave()
resultsParams = [{'name':'Knownkey Source', 'type':'list', 'values':{'Attack Module':'attack', 'GUI Override':'gui'},
'value':'attack', 'set':self.setKnownKeySrc},
{'name':'Override Key', 'type':'str', 'key':'knownkey', 'value':'', 'set':self.setKnownKeyStr, 'readonly':True},
{'name':'Save Raw Results', 'type':'bool', 'value':False, 'set':self.saveresults.setEnabled}
]
self.params = Parameter.create(name="General Parameters", type='group', children=resultsParams)
ExtendedParameter.setupExtended(self.params, self)
示例2: __init__
def __init__(self, parent, showScriptParameter=None, tmanager=None, console=None):
super(ProfilingTemplate, self).__init__()
if console:
self.console = console
self.setParent(parent)
self._tmanager = None
self._project = None
resultsParams = [{'name':'Load Template', 'type':'group', 'children':[
]},
{'name':'Generate New Template', 'type':'group', 'children':[
{'name':'Trace Start', 'key':'tgenstart', 'value':0, 'type':'int', 'set':self.updateScript},
{'name':'Trace End', 'key':'tgenstop', 'value':self.parent().traceMax, 'type':'int', 'set':self.updateScript},
{'name':'POI Selection', 'key':'poimode', 'type':'list', 'values':{'TraceExplorer Table':0, 'Read from Project File':1}, 'value':0, 'set':self.updateScript},
{'name':'Read POI', 'type':'action', 'action':self.updateScript},
{'name':'Generate Templates', 'type':'action', 'action': lambda:self.runScriptFunction.emit("generateTemplates")}
]},
]
self.params = Parameter.create(name='Template Attack', type='group', children=resultsParams)
if showScriptParameter is not None:
self.showScriptParameter = showScriptParameter
# print self.showScriptParameter
ExtendedParameter.setupExtended(self.params, self)
self.addGroup("generateTemplates")
self.sr = None
self.stats = DataTypeDiffs()
self.setProfileAlgorithm(TemplateBasic)
示例3: setupParameters
def setupParameters(self):
self.hdev = HIDSPI()
ssParams = [{'name':'Jump to Bootloader', 'type':'action', 'action':self.hdev.jumpBootloader}
]
self.params = Parameter.create(name='Target Connection', type='group', children=ssParams)
ExtendedParameter.setupExtended(self.params, self)
self.keylength = 16
示例4: setupParameters
def setupParameters(self):
cpaalgos = {'Progressive':CPAProgressive,
'Simple':CPASimpleLoop}
#if CPACython is not None:
# cpaalgos['Progressive-Cython'] = CPACython.AttackCPA_Progressive
attackParams = [{'name':'CPA Algorithm', 'key':'CPA_algo', 'type':'list', 'values':cpaalgos, 'value':CPAProgressive, 'set':self.updateAlgorithm},
{'name':'Hardware Model', 'type':'group', 'children':[
{'name':'Crypto Algorithm', 'key':'hw_algo', 'type':'list', 'values':{'AES-128 (8-bit)':models_AES128_8bit, 'AES-256 (8-bit)':models_AES256_8bit}, 'value':'AES-128', 'set':self.updateScript},
{'name':'Key Round', 'key':'hw_round', 'type':'list', 'values':{'first':0, 'last':-1}, 'value':0, 'set':self.updateScript},
{'name':'Power Model', 'key':'hw_pwrmodel', 'type':'list', 'values':{'Hamming Weight':'HypHW', 'Hamming Distance':'HypHD'}, 'value':'Hamming Weight', 'set':self.updateScript},
{'name':'Direction', 'key':'aes_dir', 'type':'list', 'values':{'Encryption (PT=Input)':'enc', 'Decryption (PT=Input)':'dec'}, 'value':'enc', 'set':self.updateScript},
]},
#TODO: Should be called from the AES module to figure out # of bytes
{'name':'Attacked Bytes', 'type':'group', 'children':
self.getByteList()
},
]
self.params = Parameter.create(name='Attack', type='group', children=attackParams)
ExtendedParameter.setupExtended(self.params, self)
self.setAnalysisAlgorithm(CPAProgressive, None, None)
self.updateBytesVisible()
self.updateScript()
示例5: setupParameters
def setupParameters(self):
"""Setup parameters specific to preprocessing module"""
ssParams = [{'name':'Enabled', 'type':'bool', 'value':True, 'set':self.setEnabled},
# PUT YOUR PARAMETERS HERE
{'name':'Desc', 'type':'text', 'value':self.descrString}]
self.params = Parameter.create(name='Name of Module', type='group', children=ssParams)
ExtendedParameter.setupExtended(self.params, self)
示例6: setupParameters
def setupParameters(self):
cpaalgos = {'Progressive':CPAProgressive,
'Simple':CPASimpleLoop}
#if CPACython is not None:
# cpaalgos['Progressive-Cython'] = CPACython.AttackCPA_Progressive
if CPAProgressive_CAccel is not None:
cpaalgos['Progressive-C Accel'] = CPAProgressive_CAccel
attackParams = [{'name':'CPA Algorithm', 'key':'CPA_algo', 'type':'list', 'values':cpaalgos, 'value':CPAProgressive, 'set':self.updateAlgorithm},
{'name':'Hardware Model', 'type':'group', 'children':[
{'name':'Crypto Algorithm', 'key':'hw_algo', 'type':'list', 'values':{'AES-128 (8-bit)':models_AES128_8bit}, 'value':'AES-128', 'set':self.updateScript},
{'name':'Leakage Model', 'key':'hw_leak', 'type':'list', 'values':models_AES128_8bit.leakagemodels, 'value':1, 'set':self.updateScript},
]},
#TODO: Should be called from the AES module to figure out # of bytes
{'name':'Attacked Bytes', 'type':'group', 'children':
self.getByteList()
},
]
self.params = Parameter.create(name='Attack', type='group', children=attackParams)
ExtendedParameter.setupExtended(self.params, self)
self.setAnalysisAlgorithm(CPAProgressive, None, None)
self.updateBytesVisible()
self.updateScript()
示例7: setupParameters
def setupParameters(self):
ssParams = [{'name':'Interface', 'type':'list', 'key':'target', 'values':['xmega (PDI)', 'avr (ISP)'], 'value':'xmega (PDI)'},
{'name':'Post-Reset Delay', 'type':'int', 'key':'toggledelay', 'limits':(0, 10E3), 'value':0, 'suffix':'mS'},
{'name':'Test Reset', 'type':'action', 'action':self.testReset}
]
self.params = Parameter.create(name='Reset AVR/XMEGA via CW-Lite', type='group', children=ssParams)
ExtendedParameter.setupExtended(self.params, self)
示例8: __init__
def __init__(self,console=None,showScriptParameter=None):
super(VisaScope, self).__init__()
self.showScriptParameter = showScriptParameter
self.console = console
self.visaInst = None
scopeParams = [
{'name':'X-Scale', 'key':'xscale', 'type':'list', 'values':self.xScales},
{'name':'Y-Scale', 'key':'yscale', 'type':'list', 'values':self.yScales},
{'name':'Y-Offset', 'key':'yoffset', 'type':'float', 'step':1E-3, 'siPrefix': True, 'suffix': 'V'},
{'name':'X-Offset', 'key':'xoffset', 'type':'float', 'step':1E-6, 'siPrefix': True, 'suffix': 'S'},
{'name':'Download Offset', 'key':'xdisporigin', 'type':'int', 'limits':(0,1E9)},
{'name':'Download Size', 'key':'xdisprange', 'type':'int', 'limits':(0,1E9)},
]
for t in self.getAdditionalParams():
scopeParams.append(t)
self.params = Parameter.create(name='Scope Settings', type='group', children=scopeParams)
ExtendedParameter.setupExtended(self.params, self)
示例9: __init__
def __init__(self, subkeys=16, permPerSubkey=256):
super(ResultsPlotData, self).__init__()
self.numKeys = subkeys
self.numPerms = permPerSubkey
self._knownkey = None
self.enabledbytes = [False] * subkeys
self.doRedraw = True
self.orfunction = None
self.byteNumAct = []
for i in range(0, self.numKeys):
self.byteNumAct.append(QAction("%d" % i, self))
self.byteNumAct[i].triggered[bool].connect(partial(self.setBytePlot, i))
self.byteNumAct[i].setCheckable(True)
byteNumAllOn = QAction("All On", self)
byteNumAllOff = QAction("All Off", self)
byteNumAllOn.triggered.connect(partial(self.setByteAll, False))
byteNumAllOff.triggered.connect(partial(self.setByteAll, True))
self.bselection = QToolBar()
for i in range(0, self.numKeys):
self.bselection.addAction(self.byteNumAct[i])
self.bselection.addAction(byteNumAllOn)
self.bselection.addAction(byteNumAllOff)
self.layout().addWidget(self.bselection)
self.highlightTop = True
resultsParams = self.genericParameters()
self.params = Parameter.create(name=self.name, type="group", children=resultsParams)
ExtendedParameter.setupExtended(self.params, self)
示例10: setupParameters
def setupParameters(self):
ssParams = [{'name':'baud', 'type':'int', 'key':'baud', 'value':38400, 'limits':(500, 2000000), 'get':self.baud, 'set':self.setBaud}]
self.params = Parameter.create(name='Serial Port Settings', type='group', children=ssParams)
ExtendedParameter.setupExtended(self.params, self)
self.cwlite_usart = None
self.oa = None
示例11: __init__
def __init__(self, showScriptParameter=None, CWMainWindow=None):
self.cwAdv = CWAdvTrigger()
paramSS = [
{'name':'Serial Settings', 'type':'group', 'children':[
{'name':'Baud', 'key':'baud', 'type':'int', 'limits':(100, 500000), 'value':38400, 'step':100, 'set':self.updateSampleRate},
{'name':'Start Bits', 'key':'startbits', 'type':'int', 'limits':(1, 10), 'value':1},
{'name':'Stop Bits', 'key':'stopbits', 'type':'int', 'limits':(1, 10), 'value':1},
{'name':'Parity', 'key':'parity', 'type':'list', 'values':['none', 'even'], 'value':'none'},
]},
# TODO: Need to confirm oversample rate stuff
{'name':'Oversample Rate', 'key':'osrate', 'type':'int', 'limits':(2, 5), 'value':3, 'set':self.updateSampleRate},
{'name':'Calculated Clkdiv', 'key':'calcclkdiv', 'type':'int', 'readonly':True},
{'name':'Calculated Error', 'key':'calcerror', 'type':'int', 'suffix':'%', 'readonly':True},
{'name':'Trigger Character', 'key':'trigpatt', 'type':'str', 'value':'""', 'set':self.setPattern},
{'name':'Binary Pattern', 'key':'binarypatt', 'type':'str', 'value':''},
{'name':'Reset Module', 'type':'action', 'action':self.reset},
{'name':'Advanced Settings', 'type':'group', 'children':[
{'name':'Threshold', 'key':'threshold', 'type':'int', 'value':1, 'limits':(1, 10), 'set':self.reset},
{'name':'Initial Bit Correction', 'key':'initialcorrect', 'type':'int', 'value':3, 'limits':(0, 10), 'set':self.reset},
]}
]
self.oa = None
self.params = Parameter.create(name='Digital Pattern Trigger Module', type='group', children=paramSS)
ExtendedParameter.setupExtended(self.params, self)
self.showScriptParameter = showScriptParameter
示例12: setupParameters
def setupParameters(self):
self.oa=None
self.driver = None
supported_readers = dicttype()
supported_readers["Select Reader"] = None
supported_readers["ChipWhisperer-SER"] = ReaderChipWhispererSER()
supported_readers["ChipWhisperer-USI"] = ReaderChipWhispererUSI()
supported_readers["ChipWhisperer-SCARD"] = ReaderChipWhispererSCard()
supported_readers["System Serial (SASEBO-W)"] = ReaderSystemSER()
try:
supported_readers["PC/SC Reader"] = ReaderPCSC()
except ImportError:
pass
ssParams = [{'name':'Reader Hardware', 'type':'list', 'values':supported_readers, 'value':None, 'set':self.setConnection},
#"BasicCard v7.5 (INCOMPLETE"):None,
#"Custom (INCOMPLETE)":None, "DPAContestv4 (INCOMPLETE)":None
{'name':'SmartCard Protocol', 'type':'list', 'values':{"SASEBO-W SmartCard OS":ProtocolSASEBOWCardOS(),
"ChipWhisperer-Dumb":None,
"JCard Test":ProtocolJCardTest(),
"DPA Contest 4.2":ProtocolDPAv42(),
}, 'value':None, 'set':self.setProtocol}
]
self.params = Parameter.create(name='Target Connection', type='group', children=ssParams)
ExtendedParameter.setupExtended(self.params, self)
示例13: setupParameters
def setupParameters(self):
ssParams = [{'name':'STK500.exe Path', 'type':'str', 'key':'stk500path', 'value':r'C:\Program Files (x86)\Atmel\AVR Tools\STK500\Stk500.exe'},
{'name':'AVR Part', 'type':'list', 'key':'part', 'values':['atmega328p'], 'value':'atmega328p'},
{'name':'Test Reset', 'type':'action', 'action':self.testReset}
]
self.params = Parameter.create(name='Reset AVR via STK500', type='group', children=ssParams)
ExtendedParameter.setupExtended(self.params, self)
示例14: updateGenericScript
def updateGenericScript(self, ignored=None):
runs = ExtendedParameter.findParam(ExtendedParameter, 'runs', self.traceParams)
atraces = ExtendedParameter.findParam(ExtendedParameter, 'atraces', self.traceParams)
strace = ExtendedParameter.findParam(ExtendedParameter, 'strace', self.traceParams)
ri = ExtendedParameter.findParam(ExtendedParameter, 'reportinterval', self.traceParams)
#print "runs = %d\natraces= %d\nstrace = %d\n"%(runs.value(), atraces.value(), strace.value())
if (runs.value() * atraces.value() + strace.value()) > (self.traceMax):
solv = (self.traceMax - strace.value()) / runs.value()
solv = int(solv)
atraces.setValue(solv)
atraces.setLimits((1, solv))
self.singleEmit = True
else:
lim = (1, self.traceMax)
#WORK-AROUND: need to emit an extra sigLimitsChanged???
if atraces.setLimits(lim) is None and self.singleEmit:
self.singleEmit = False
atraces.sigLimitsChanged.emit(atraces, lim)
pointrng = (self.findParam('startpoint', self.pointsParams).value(), self.findParam('endpoint', self.pointsParams).value())
self.addFunction("init", "setTraceStart", "%d" % strace.value())
self.addFunction("init", "setTracesPerAttack", "%d" % atraces.value())
self.addFunction("init", "setIterations", "%d" % runs.value())
self.addFunction("init", "setReportingInterval", "%d" % ri.value())
self.addFunction("init", "setPointRange", "(%d,%d)" % (pointrng[0], pointrng[1]))
示例15: setupParameters
def setupParameters(self):
ssParams = [ {'name':'Get ATR (Reset Card)', 'type':'action', 'action':self.reset},
{'name':'ATR', 'key':'atr', 'type':'str'},
]
self.params = Parameter.create(name='Target Connection', type='group', children=ssParams)
ExtendedParameter.setupExtended(self.params, self)
self.protocol = 0