grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Imminent bugfix release (1.97.1)


From: Robert Millan
Subject: Re: Imminent bugfix release (1.97.1)
Date: Mon, 9 Nov 2009 19:25:18 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

On Mon, Nov 09, 2009 at 07:15:48PM +0100, Vladimir 'phcoder' Serbinenko wrote:
> Robert Millan wrote:
> >
> > Actually, modern CPUs are very complex and the number of operations (or
> > time taken by them) isn't easy to predict.
> >
> >   
> It's generally a good practice to do exactly same operations
> independently of result just store the result in a separate variable
> it's how RSA is correctly implemented
> 
>   for (n = grub_strlen (s1); n >= 0; n--)
>   {
>     if (*s1 != *s2)
>       ret |= 1;
>     else
>       ret |= 0;

Uhm I didn't check, but I'd suspect -Os would optimize this out.

Anyhow, if we move the fixed time wait to the outer loop, it should no
longer be a problem.

We could also check the approach taken by e.g. su from coreutils.

-- 
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."




reply via email to

[Prev in Thread] Current Thread [Next in Thread]