emse-sas / sca_framework

Demonstration application for RO and TDC based SCA attack on the AES 128
MIT License
1 stars 0 forks source link

Improve auto-calibration of TDC #8

Closed samiBendou closed 3 years ago

samiBendou commented 3 years ago

TESTED CONFIGURATION 3 COARSES - 1 FINE - 32 BIT DATA PATH - 200 MHz

current calibration :

possible calibration :

note it is impossible to calibrate the sensor in order to have a data register containing 0x00000000 it seems that at least the first bits are ones (eg . 0x0000000ff)

A reason can be because the clock signal still crosses part of the sampling line whatever the delay tuning is.

samiBendou commented 3 years ago

When switching to 4 coarse delays, the TDC cannot be calibrated and always outputs zeros 0x00000000

samiBendou commented 3 years ago

Calibration in d6ccb4bb9201d607753f02083365e59cd7244548

if (OP_hamming_distance(0xffff, value) < OP_hamming_distance(0xffff, best_value))
{
    best_delay = delay;
    best_value = value;
}
samiBendou commented 3 years ago

Working on multiple TDC simultaneous calibration :

samiBendou commented 3 years ago

Chosen calibration to be reviewed

if (abs(16 * iterations - value) < abs(16 * iterations - best_value))
{
    best_value = value;
    best_fine = fine;
    best_coarse = coarse;
}