Re:A Rust-based TLS library outperformed OpenSSL in almost e...
by m463 on Friday July 19, 2019 @07:43PM
(#20483312)
I am unfamiliar with any of the code, so take my statement with a grain of salt.
Sometimes crypto code must be written in weird ways to fend off attacks.
For example, to prevent timing attacks, code must sometimes be written to take constant time. This basically means that some loops must not exit early (such as when a key is wrong). Instead they must note the failure, then continue looping and return failure afterwards.
This means some code has to be written to always take worst-case time.
But if worst-case time in one libraray is better than another library, there can definitely be improvements.
Sometimes crypto code must be written in weird ways to fend off attacks.
For example, to prevent timing attacks, code must sometimes be written to take constant time. This basically means that some loops must not exit early (such as when a key is wrong). Instead they must note the failure, then continue looping and return failure afterwards.
This means some code has to be written to always take worst-case time.
But if worst-case time in one libraray is better than another library, there can definitely be improvements.