Граф коммитов

4 Коммитов

Автор SHA1 Сообщение Дата
Bryan C. Mills c7e5f84aec sha3: align (*state).storage
Even on platforms that allow unaligned reads, the Go runtime assumes
that a pointer to a given type has the alignment required by that
type.

Fixes golang/go#35173
Updates golang/go#34972
Updates golang/go#34964

Change-Id: I90361e096e59162e42ebde2914985af92f777ece
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/203837
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
2019-11-05 03:41:35 +00:00
Lynn Boger fbbbdbdd6f sha3: revert alignment optimization on ppc64
A previous fix to improve performance based on alignment
to sha3 was made in both ppc64le and ppc64, when it should
have only applied to ppc64le.  This changes the build tags
so it is only done for ppc64le.

Fixes golang/go#15392

Change-Id: Idf32a0370f3c76fc2b54a2897a668acbae5d43c5
Reviewed-on: https://go-review.googlesource.com/22323
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-04-20 21:40:36 +00:00
Lynn Boger c197bcf24c golang/x/crypto/sha3: use better alignment
Change the build tags for xor.go and xor_unaligned.go
to perform better on ppc64/ppc64le.

This improves performance for these sha3 benchmarks:

benchmark                        old MB/s     new MB/s     speedup
BenchmarkSha3_512_MTU            68.42        76.03        1.11x
BenchmarkSha3_384_MTU            91.12        105.38       1.16x
BenchmarkSha3_256_MTU            110.19       132.63       1.20x
BenchmarkSha3_224_MTU            114.46       139.12       1.22x
BenchmarkShake128_MTU            129.77       163.14       1.26x
BenchmarkShake256_MTU            125.01       151.93       1.22x
BenchmarkShake256_16x            110.60       129.44       1.17x
BenchmarkShake256_1MiB           128.51       154.23       1.20x
BenchmarkSha3_512_1MiB           74.18        82.39        1.11x

Fixes golang/go#14847

Change-Id: I59ba763b4eaf3e567399b132ad820fb2dcbbf129
Reviewed-on: https://go-review.googlesource.com/20821
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-03-17 20:21:02 +00:00
David Leon Gil 4ed45ec682 sha3: use unaligned reads and xors on x86 and x64
Speedup of about 1.4x on x64. Added benchmarks that use the
ShakeHash interface, which doesn't require copying the state.

Unaligned or generic xorIn and copyOut functions chosen via
buildline, but both are tested.

Substantial contributions from Eric Eisner.

See golang.org/cl/151630044 for the previous CR.

(There are also some minor edits/additions to the documentation.)

Change-Id: I9500c25682457c82487512b9b8c66df7d75bff5d
Reviewed-on: https://go-review.googlesource.com/2132
Reviewed-by: Adam Langley <agl@golang.org>
2015-01-12 22:01:33 +00:00