]> asedeno.scripts.mit.edu Git - linux.git/commit
powerpc/crypto: Use cheaper random numbers for crc-vpmsum self-test
authorGeorge Spelvin <lkml@sdf.org>
Thu, 21 Mar 2019 10:42:22 +0000 (10:42 +0000)
committerMichael Ellerman <mpe@ellerman.id.au>
Sat, 20 Apr 2019 12:03:11 +0000 (22:03 +1000)
commit80d04b7fabe161a23d143b3bfcfca1b002c23da1
treec6e44382032d68519aa3975307fb0ece3c23d4b0
parent6917735e8f905da1f62ccdf62830b185524835c7
powerpc/crypto: Use cheaper random numbers for crc-vpmsum self-test

This code was filling a 64K buffer from /dev/urandom in order to
compute a CRC over (on average half of) it by two different methods,
comparing the CRCs, and repeating.

This is not a remotely security-critical application, so use the far
faster and cheaper prandom_u32() generator.

And, while we're at it, only fill as much of the buffer as we plan to use.

Signed-off-by: George Spelvin <lkml@sdf.org>
Acked-by: Daniel Axtens <dja@axtens.net>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/crypto/crc-vpmsum_test.c