Earlier quoted context omitted.
Unless I misunderstood (which is entirely possible, not a crypto expert) that article is answering a different question: whether adding random delays can thwart timing attacks. The GP was asking about implementing a constant-time delay.
Ok, let's assume you know how long an operation is supposed to take, but want to stop it from leaking if it returns faster. To accomplish this, you would need a high-resolution timer that runs before the operation, after the operation, and then you can subtract the two and wait. And maybe that might work. But you're not running in kernel space. The resolution of timing information you'd get from this tactic would be…
Security Issues in Matrix's Olm Library
21–24 of 24 posts
Re: Security Issues in Matrix's Olm Library
#22Earlier quoted context omitted.
Ok, let's assume you know how long an operation is supposed to take, but want to stop it from leaking if it returns faster. To accomplish this, you would need a high-resolution timer that runs before the operation, after the operation, and then you can subtract the two and wait. And maybe that might work. But you're not running in kernel space. The resolution of timing information you'd get from this tactic would be…
is a constant-time algorithm just an algorithm that completes the entire calculation before returning even if it knows the correct answer sooner?
What matters is that the variance of execution time, which memory addresses are accessed, etc. is independent of any secret inputs.
Re: Security Issues in Matrix's Olm Library
#23Earlier quoted context omitted.
is a constant-time algorithm just an algorithm that completes the entire calculation before returning even if it knows the correct answer sooner?
"constant-time" isn't a literally technically correct descriptor, it's a short-hand What matters is that the variance of execution time, which memory addresses are accessed, etc. is independent of any secret inputs.
Re: Security Issues in Matrix's Olm Library
#24Earlier quoted context omitted.
"constant-time" isn't a literally technically correct descriptor, it's a short-hand What matters is that the variance of execution time, which memory addresses are accessed, etc. is independent of any secret inputs.
so theoretically using timers and adding sleeps could solve the problem but practically there are better ways to achieve the goal of no timing information leakage?
https://soatok.blog/2020/08/27/soatoks-guide-to-side-channel...