IS308 lab6 侧信道攻击,挖坑待补

Posted by chinaljr on June 1, 2018

新指令

for(i=0; i<10; i++) _mm_clflush(&array[i*4096]);

缓存线清除

for(i=0; i<10; i++) {
    addr = &array[i*4096];
    time1 = __rdtscp(&junk);
    junk = *addr;
    time2 = __rdtscp(&junk) - time1;
    time[i] = time2;
  }

rdtscp 能够获取时钟周期,并且避免乱序问题