Re: [OpenWrt-Devel] getting more randomness by improving MIPS get_cycles()

2013-09-08 Thread John Crispin

On 08/09/13 21:04, Dave Taht wrote:

So, what blocks having a working get_cycles in common mips architectures?



Dave,

wrong mailing list. please post this on lmo

John
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] getting more randomness by improving MIPS get_cycles()

2013-09-08 Thread Dave Taht
In light of the whole nsa hoo-ra (stuff like this)

https://plus.google.com/u/0/117091380454742934025/posts/SDcoemc9V3J

Ted Tso has pointed out to me that apparently mips' does not have a working 
generic get_cycles() call,  but instead returns 0 in all cases.

e.g: In arch/mips/include/asm/timex.h:

typedef unsigned int cycles_t;

static inline cycles_t get_cycles(void)
{
return 0;
}

Um.

get_cycles() is used in innumerable places in random.c.

This is double plus ungood... I am REALLY hoping I'm merely misreading 
the code...

An example:

(see drivers/char/random.c for how often it is used)

/*
 * Add device- or boot-specific data to the input and nonblocking
 * pools to help initialize them to unique values.
 *
 * None of this adds any entropy, it is meant to avoid the
 * problem of the nonblocking pool having similar initial state
 * across largely identical devices.
 */

void add_device_randomness(const void *buf, unsigned int size)
{
unsigned long time = get_cycles() ^ jiffies;

...

So, what blocks having a working get_cycles in common mips architectures?
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel