• Harald Freudenberger's avatar
    s390/crypto: use TRNG for seeding/reseeding · 769f020b
    Harald Freudenberger authored
    With the z14 machine there came also a CPACF hardware extension
    which provides a True Random Number Generator. This TRNG can
    be accessed with a new subfunction code within the CPACF prno
    instruction and provides random data with very high entropy.
    
    So if there is a TRNG available, let's use it for initial seeding
    and reseeding instead of the current implementation which tries
    to generate entropy based on stckf (store clock fast) jitters.
    
    For details about the amount of data needed and pulled for
    seeding and reseeding there can be explaining comments in the
    code found.
    Signed-off-by: default avatarHarald Freudenberger <freude@linux.ibm.com>
    Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
    769f020b
prng.c 24.6 KB