2 ms·
error in the paper, chapter 4.1, deferred return: transformed code, but insecure secret mut uint32 rval = 0; secret mut bool notRet = true; if (se
by rurban 4y ago
error in the paper, chapter 4.1, deferred return:
transformed code, but insecure
secret mut uint32 rval = 0;
secret mut bool notRet = true;
if (sec) { rval = 1; notRet = false; }
if (notRet) {
// long-running computation ...
}
return rval;
the long running block depends on the secret, thus leaks it.
- djrenren 4y agoHey, one of the paper authors here. If the compiler stopped here, yes this would be an error, but subsequent transformations (described in section 4.2) eliminate the branch ensuring that timing is equivalent regardless of the value of notRet.