Exemplo n.º 1
0
    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)
Exemplo n.º 2
0
    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)
Exemplo n.º 3
0
    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)
Exemplo n.º 4
0
 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
Exemplo n.º 5
0
 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
Exemplo n.º 6
0
    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)