Skip to content

Instantly share code, notes, and snippets.

from lascar import *
from lascar.tools.aes import sbox
filename = "/home/johndoe/ASCAD_data/ASCAD_databases/ATMega8515_raw_traces.h5"
# poi = Points Of Interest.
# We use the SNRs computed before to extract time samples where both mask and masked sensitive variable are used.
snrs = DictOutputMethod.load('SNR.pickle') # we load the snr results computed at 02-snr.py
poi = []
poi = [snrs['SNR4: masked sbox output in linear parts'][5000].argmax()]
from lascar import *
container = NpyContainer('test_leakages','test_values') # load data
class Synchronization:
def __init__(self, lref):
self.ref_peak_offset = ref.argmax()
def __call__(self, leakage):
#We need to find the peak in each leakage,and roll it to match the ref_peak
peak_offset = leakage.argmax()
from lascar import *
container = NpyContainer('test_leakages','test_values') # load data