Skip to content
  • Eric Biggers's avatar
    crypto: salsa20-generic - cleanup and convert to skcipher API · b62b3db7
    Eric Biggers authored
    
    
    Convert salsa20-generic from the deprecated "blkcipher" API to the
    "skcipher" API, in the process fixing it up to be thread-safe (as the
    crypto API expects) by maintaining each request's state separately from
    the transform context.
    
    Also remove the unnecessary cra_alignmask and tighten validation of the
    key size by accepting only 16 or 32 bytes, not anything in between.
    
    These changes bring the code close to the way chacha20-generic does
    things, so hopefully it will be easier to maintain in the future.
    
    However, the way Salsa20 interprets the IV is still slightly different;
    that was not changed.
    
    Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
    Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
    b62b3db7