• David S. Miller's avatar
    sparc64: Fix bugs in unrolled 256-bit loops. · 699871bc
    David S. Miller authored
    Some dm-crypt testing revealed several bugs in the 256-bit unrolled
    loops.
    
    The DECRYPT_256_2() macro had two errors:
    
    1) Missing reload of KEY registers %f60 and %f62
    
    2) Missing "\" in penultimate line of definition.
    
    In aes_sparc64_ecb_decrypt_256, we were storing the second half of the
    encryption result from the wrong source registers.
    
    In aes_sparc64_ctr_crypt_256 we have to be careful when we fall out of
    the 32-byte-at-a-time loop and handle a trailing 16-byte chunk.  In
    that case we've clobbered the final key holding registers and have to
    restore them before executing the ENCRYPT_256() macro.  Inside of the
    32-byte-at-a-time loop things are OK, because we do this key register
    restoring during the first few rounds of the ENCRYPT_256_2() macro.
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    699871bc
aes_asm.S 38 KB