• Ard Biesheuvel's avatar
    crypto: arm64/crct10dif - implement non-Crypto Extensions alternative · 2fffee53
    Ard Biesheuvel authored
    The arm64 implementation of the CRC-T10DIF algorithm uses the 64x64 bit
    polynomial multiplication instructions, which are optional in the
    architecture, and if these instructions are not available, we fall back
    to the C routine which is slow and inefficient.
    
    So let's reuse the 64x64 bit PMULL alternative from the GHASH driver that
    uses a sequence of ~40 instructions involving 8x8 bit PMULL and some
    shifting and masking. This is a lot slower than the original, but it is
    still twice as fast as the current [unoptimized] C code on Cortex-A53,
    and it is time invariant and much easier on the D-cache.
    Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
    Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
    2fffee53
crct10dif-ce-glue.c 2.61 KB