• Ayush Sawal's avatar
    Crypto/chcr: Fixes compilations warnings · f3b140ad
    Ayush Sawal authored
    This patch fixes the compilation warnings displayed by sparse tool for
    chcr driver.
    
    V1->V2
    
    Avoid type casting by using get_unaligned_be32() and
    put_unaligned_be16/32() functions.
    
    The key which comes from stack is an u8 byte stream so we store it in
    an unsigned char array(ablkctx->key). The function get_aes_decrypt_key()
    is a used to calculate  the reverse round key for decryption, for this
    operation the key has to be divided into 4 bytes, so to extract 4 bytes
    from an u8 byte stream and store it in an u32 variable, get_aligned_be32()
    is used. Similarly for copying back the key from u32 variable to the
    original u8 key stream, put_aligned_be32() is used.
    Signed-off-by: default avatarAyush Sawal <ayush.sawal@chelsio.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    f3b140ad
chcr_ipsec.c 20 KB