News for hackers. Stuff that matters.
Re:Sliding right into disaster: Left-to-right sliding window... by 19eightyfour on Sunday July 02, 2017 @08:40PM (#14685120)
How can you compute modular exponentiation in a Time Safe way, regarding some pseudocode or a link?
Re:Sliding right into disaster: Left-to-right sliding window... by Retric on Sunday July 02, 2017 @09:13PM (#14685268)
They give a partial answer aka right-to-left vs. left-to-right, but at the high level.

Make sure you do fixed computation regardless of data involved. This involves slowing things down and making sure the CPU/compiler does not optimize anything so things become unbalanced.

Re:Sliding right into disaster: Left-to-right sliding window... by noobermin on Sunday July 02, 2017 @10:18PM (#14685471)
I am new about these things, but wouldn't just moving to fixed computation really fix this and a large number of forsee-able side-channel attacks? It sounds like the libgcrypt devs chose specifically not to do this because they thought it wasn't necessary.
Re:Sliding right into disaster: Left-to-right sliding window... by 19eightyfour on Sunday July 02, 2017 @10:26PM (#14685500)
Okay, I saw that, but thanks for saying it. What does right to left mean specifically? How would you compute it without a sliding window / or make it fixed time?
Re:Sliding right into disaster: Left-to-right sliding window... by dfox on Monday July 03, 2017 @06:28AM (#14687230)
Straightforward implementation involves taking exponent bits from the MSB on and multiplicating by the base for 1 bits and then squaring the intermediate result.

Straightforward way to make this constant time is to do the multiplication always and discard the result for 0 bits.

Motivation of the sliding window algoritms is that they are faster and also believed to be "more constant time" than the straightforward square and multiply.

Re:Sliding right into disaster: Left-to-right sliding window... by 19eightyfour on Monday July 03, 2017 @11:18AM (#14688849)
Thanks.