News for hackers. Stuff that matters.
Re:A Cryptographic Near Miss by dan-robertson on Wednesday April 12, 2023 @07:06AM (#35537755)
Was the asm for performance or constantish time?
Re:A Cryptographic Near Miss by eptcyka on Wednesday April 12, 2023 @07:18AM (#35537856)
Constant time.
Re:A Cryptographic Near Miss by WakoMan12 on Wednesday April 12, 2023 @07:34AM (#35538009)
O(nlogn)
Re:A Cryptographic Near Miss by eptcyka on Wednesday April 12, 2023 @07:52AM (#35538193)
Yes, but it ensures that for all inputs of a given size, runtime will be the same.
Re:A Cryptographic Near Miss by consp on Wednesday April 12, 2023 @10:07AM (#35539885)
That would more likely be a tight bound, not an upper bound.
Re:A Cryptographic Near Miss by FiloSottile on Wednesday April 12, 2023 @08:05AM (#35538321)
The assembly is there for performance. Other curves are implemented in constant time pure Go. (It's actually more robust than constant time C, because the Go compiler is less creative in "optimizing" things into branches.)
Re:A Cryptographic Near Miss by twic on Wednesday April 12, 2023 @08:57AM (#35538903)
> It's actually more robust than constant time C, because the Go compiler is less creative in "optimizing" things into branches.

Today's Go compiler. This feels like a belief with a lot of potential for generating near misses of its own.

Re:A Cryptographic Near Miss by FiloSottile on Wednesday April 12, 2023 @12:15PM (#35542126)
Heh, I used to joke that in Go it's safer because I know where the compiler team sits, but I think there's also a fundamental design reason: the Go compiler has speed as a primary goal. I don't know if that's still true, but there used to be a rule of thumb that a new optimization had to speed up the compiler enough to make up for its cost to be added. It's unlikely that unwinding bit masks into branches would be worth adding.

Anyway, we're not moving all cryptography to assembly anytime soon, and I'm positive that would not be a net increase in security, even if it would mitigate the hypothetical risk of compiler-introduced side-channels.