def __init__(self): AttackBaseClass.__init__(self) self._project = None self.attack = None algos = pluginmanager.getPluginsInDictFromPackage( "chipwhisperer.analyzer.attacks.profiling_algorithms", False, False, self) self.getParams().addChildren([ { 'name': 'Algorithm', 'key': 'Prof_algo', 'type': 'list', 'values': algos, 'value': algos['Template Attack'], 'action': self.updateAlgorithm }, #TODO: Should be called from the AES module to figure out # of bytes ]) AttackGenericParameters.__init__(self) # Do not use absolute self.useAbs = False self.updateAlgorithm() self.updateBytesVisible() self.setAbsoluteMode(False)
def updateScript(self, _=None): AttackBaseClass.updateScript(self) self.importsAppend("from chipwhisperer.analyzer.attacks.profiling import Profiling") analysAlgoStr = sys.modules[self._analysisAlgorithm.__class__.__module__].__name__ + '.' + self._analysisAlgorithm.__class__.__name__ model_path = sys.modules[self.findParam('Crypto Algorithm').getValue().__class__.__module__].__name__ cryptoalg = model_path + '.' + self.findParam('Crypto Algorithm').getValue().__class__.__name__ hwmodel = model_path + '.' + self.findParam('Crypto Algorithm').getValue().getHwModel().__name__ self.addVariable("init", "leakage_object", "%s(%s)" % (cryptoalg, hwmodel)) self.addFunction("init", "setAnalysisAlgorithm", "%s,leakage_object" % (analysAlgoStr), loc=1)
def updateScript(self, _=None): AttackBaseClass.updateScript(self) self.importsAppend( "from chipwhisperer.analyzer.attacks.profiling import Profiling") analysAlgoStr = sys.modules[ self._analysisAlgorithm.__class__. __module__].__name__ + '.' + self._analysisAlgorithm.__class__.__name__ model_path = sys.modules[self.findParam( 'Crypto Algorithm').getValue().__class__.__module__].__name__ cryptoalg = model_path + '.' + self.findParam( 'Crypto Algorithm').getValue().__class__.__name__ hwmodel = model_path + '.' + self.findParam( 'Crypto Algorithm').getValue().getHwModel().__name__ self.addVariable("init", "leakage_object", "%s(%s)" % (cryptoalg, hwmodel)) self.addFunction("init", "setAnalysisAlgorithm", "%s,leakage_object" % (analysAlgoStr), loc=1)
def __init__(self): self._algos = pluginmanager.getPluginsInDictFromPackage("chipwhisperer.analyzer.attacks.profiling_algorithms", True, False) self._analysisAlgorithm = self._algos["Template Attack"] AttackBaseClass.__init__(self) self.useAbs = False # Do not use absolute
def __init__(self): self._algos = pluginmanager.getPluginsInDictFromPackage( "chipwhisperer.analyzer.attacks.profiling_algorithms", True, False) self._analysisAlgorithm = self._algos["Template Attack"] AttackBaseClass.__init__(self) self.useAbs = False # Do not use absolute
def updateScript(self, _=None): AttackBaseClass.updateScript(self) self.importsAppend("from chipwhisperer.analyzer.attacks.profiling import Profiling") analysAlgoStr = sys.modules[self._analysisAlgorithm.__class__.__module__].__name__ + '.' + self._analysisAlgorithm.__class__.__name__ self.addFunction("init", "setAnalysisAlgorithm", "%s" % analysAlgoStr, loc=0)