• Michael Munday's avatar
    crypto/sha256: add s390x assembly implementation · 525ae3f8
    Michael Munday authored
    Renames block to blockGeneric so that it can be called when the
    assembly feature check fails. This means making block a var on
    platforms without an assembly implementation (similar to the sha1
    package).
    
    Also adds a test to check that the fallback path works correctly
    when the feature check fails.
    
    name        old speed      new speed       delta
    Hash8Bytes  6.42MB/s ± 1%  27.14MB/s ± 0%  +323.01%  (p=0.000 n=10+10)
    Hash1K      53.9MB/s ± 0%  511.1MB/s ± 0%  +847.57%   (p=0.000 n=10+9)
    Hash8K      57.1MB/s ± 1%  609.7MB/s ± 0%  +967.04%  (p=0.000 n=10+10)
    
    Change-Id: If962b2a5c9160b3a0b76ccee53b2fd809468ed3d
    Reviewed-on: https://go-review.googlesource.com/22460
    Run-TryBot: Michael Munday <munday@ca.ibm.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarBill O'Farrell <billotosyr@gmail.com>
    Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
    525ae3f8
sha256block.go 2.36 KB