• Tianjia Zhang's avatar
    crypto: x86/sm3 - add AVX assembly implementation · 930ab34d
    Tianjia Zhang authored
    This patch adds AVX assembly accelerated implementation of SM3 secure
    hash algorithm. From the benchmark data, compared to pure software
    implementation sm3-generic, the performance increase is up to 38%.
    
    The main algorithm implementation based on SM3 AES/BMI2 accelerated
    work by libgcrypt at:
    https://gnupg.org/software/libgcrypt/index.html
    
    Benchmark on Intel i5-6200U 2.30GHz, performance data of two
    implementations, pure software sm3-generic and sm3-avx acceleration.
    The data comes from the 326 mode and 422 mode of tcrypt. The abscissas
    are different lengths of per update. The data is tabulated and the
    unit is Mb/s:
    
    update-size |     16      64     256    1024    2048    4096    8192
    ------------+-------------------------------------------------------
    sm3-generic | 105.97  129.60  182.12  189.62  188.06  193.66  194.88
    sm3-avx     | 119.87  163.05  244.44  260.92  257.60  264.87  265.88
    Signed-off-by: default avatarTianjia Zhang <tianjia.zhang@linux.alibaba.com>
    Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
    930ab34d
sm3_avx_glue.c 3.13 KB