提交 c431761d 编写于 作者: H Harald Freudenberger 提交者: Martin Schwidefsky

s390/crypto: fix stckf loop

The store-clock-fast loop in generate_entropy() mixes (exors)
only the first 64 bytes of the initial page before doing the
first SHA256. Fix the loop to mix the store-clock-fast values
all over the page.
Signed-off-by: NHarald Freudenberger <freude@linux.vnet.ibm.com>
Reported-by: NDavid Binderman <dcb314@hotmail.com>
Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
上级 f60b8d44
......@@ -125,7 +125,7 @@ static int generate_entropy(u8 *ebuf, size_t nbytes)
/* fill page with urandom bytes */
get_random_bytes(pg, PAGE_SIZE);
/* exor page with stckf values */
for (n = 0; n < sizeof(PAGE_SIZE/sizeof(u64)); n++) {
for (n = 0; n < PAGE_SIZE / sizeof(u64); n++) {
u64 *p = ((u64 *)pg) + n;
*p ^= get_tod_clock_fast();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册