Re: Caches in embedded systems



On Thu, 04 May 2006 11:14:01 +0300, Paul Keinanen wrote:

On 3 May 2006 18:04:17 -0700, "shrey" <shreyas76@xxxxxxxxx> wrote:

I know caches are avoided in real time applications

Unless the cache is very badly implemented, the worst case timing
occurs when the cache is disabled.

Independent of your cache implementation, the software *can*
cause really bad timing in some cases, especially for data accesses.
When the software hits in (almost) random access patterns a large amount
of memory, i.e. larger than the cache size, each access causes a cache
line load, instead of reading a single word needed by your program. When
that data word is also changed it will furthermore mean that a whole
updated cache line must be written back to memory when a new access is
done.
Of course this behaviour will not happen in general, but it can
happen.
Instruction cache behaviour in general will be good, unless your
compiler is really broken.

Rob
.



Relevant Pages

  • Re: Whats wrong with AES?
    ... part of djb's attack is successful because of the pattern of memory accesses with respect to cache causes timing patterns that can eventually be correlated to recover key bits. ...
    (sci.crypt)
  • [TEST] LTTng relay-alloc cache tests
    ... to keep the buffer pages as write-back than to set them to ... LTTng trace buffer memory cache behavior comparison ... [timing 1, cache cold] ... sys 0m48.943s ...
    (Linux-Kernel)
  • Re: Dont use S-boxes!
    ... That brings me back to my original concern, how the timing attack works ... S-Box table should be in cache after a very few encryption trials. ... Does it work with or without tables for the xtime function? ...
    (sci.crypt)
  • Re: Dont use S-boxes!
    ... > The normal AES implementations use large tables of 4096 bytes each ... > pressure on the cache in some machines and it is this that the timing ...
    (sci.crypt)
  • Re: Public disclosure of discovered vulnerabilities (was: Hyper-Threading Considered Harmful)
    ... > wouldn't have to worry about AES timing attacks today. ... then we wouldn't have to worry about RSA ... unless the code was some how spread across the cache lines so any path ...
    (sci.crypt)