Hacker News new | ask | show | jobs
by xxs 4300 days ago
not like that: Not exactly like that: I didn't mean simple that way, more like hash alike. The 1st example is not optimal but shows the idea.

I disagree about "pointlessCopy". Of course it's permitted by the standard but it's not an optimization. Using such a broken compiler is beyond help.

------- volatileVar *= random(); for (int i=0;i<len;i++){ volatileVar+=buf[random()%len]+0x61c88647; buf[i]=volatileVar; } ===== static volatile uint volitileVar;

  for (int i=0; i<len; i++){
    sensitiveBuffer[i]=random();
  }

  for (int i=0; i<len; i++){
    volitileVar+=sensitiveBuffer[volatileVar%len];
  }