• Matt Mackall's avatar
    random: make mixing interface byte-oriented · e68e5b66
    Matt Mackall authored
    Switch add_entropy_words to a byte-oriented interface, eliminating numerous
    casts and byte/word size rounding issues.  This also reduces the overall
    bit/byte/word confusion in this code.
    
    We now mix a byte at a time into the word-based pool.  This takes four times
    as many iterations, but should be negligible compared to hashing overhead.
    This also increases our pool churn, which adds some depth against some
    theoretical failure modes.
    
    The function name is changed to emphasize pool mixing and deemphasize entropy
    (the samples mixed in may not contain any).  extract is added to the core
    function to make it clear that it extracts from the pool.
    Signed-off-by: default avatarMatt Mackall <mpm@selenic.com>
    Cc: Theodore Ts'o <tytso@mit.edu>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    e68e5b66
random.c 48.2 KB