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

13 Коммитов

Автор SHA1 Сообщение Дата
Andreas Auernhammer 568507f56e x/crypto/poly1305: optimize amd64 assembly performance
Improve performance on amd64 through faster assembly.

name 		old time/op 	new time/op 	delta
64-8 		101ns ± 4% 	42ns ± 3% 	-58.31% (p=0.002 n=6+6)
1K-8 		887ns ± 1% 	456ns ± 1% 	-48.53% (p=0.002 n=6+6)
64Unaligned-8 	98.1ns ± 1% 	41.1ns ± 1% 	-58.06% (p=0.002 n=6+6)
1KUnaligned-8 	885ns ± 2% 	460ns ± 3% 	-48.04% (p=0.002 n=6+6)

name 		old speed 	new speed 	delta
64-8 		635MB/s ± 4% 	1525MB/s ± 3% 	+140.15% (p=0.002 n=6+6)
1K-8 		1.15GB/s ± 1% 	2.24GB/s ± 1% 	+94.22%  (p=0.002 n=6+6)
64Unaligned-8 	653MB/s ± 1% 	1557MB/s ± 1% 	+138.58% (p=0.002 n=6+6)
1KUnaligned-8  	1.16GB/s ± 2%  	2.23GB/s ± 3%	+92.46%  (p=0.002 n=6+6)

Change-Id: Ia3be8e7ff012f8a9b451d728a646f29f809ba665
Reviewed-on: https://go-review.googlesource.com/29993
Reviewed-by: Adam Langley <agl@golang.org>
2016-09-30 20:23:06 +00:00
Jungho Ahn 81bf7719a6 x/crypto/poly1305: fix memory alignment fault in ARM
The current ARM implementation assumes that the input message
  is memory aligned and so it can cause alignment fault when it
  is not enabled. Also it may generate incorrect outputs in ARMv5.

  This change fixes this issue by temporarily copying the input
  to a local aligned space. Although there may be a better way
  to handle unaligned access, this would be a safe way in all
  ARM versions.

  This change also added a test and benchmarks with unaligned
  data. The benchmark result on RasberryPI 2 is

  Benchmark64  2000000         812 ns/op    78.81 MB/s
  Benchmark1K   200000        7809 ns/op   131.12 MB/s
  Benchmark64Unaligned   2000000         967 ns/op    66.13 MB/s
  Benchmark1KUnaligned    200000       10316 ns/op    99.26 MB/s

Change-Id: I189cc1b7bb6c67a04c9877271fb27326f2896e82
Reviewed-on: https://go-review.googlesource.com/12797
Reviewed-by: Adam Langley <agl@golang.org>
2015-08-19 00:13:40 +00:00
Alexander Neumann f6a608df62 poly1305/arm: allow building with Go 1.3
This is the same as https://golang.org/cl/154120043

Since the file textflag.h is not available on Go 1.3, the macros defined
in textflag.h are replaced with their respective value.

Fixes golang/go#11448

Change-Id: I0d4aed67b7afe50d8e4e88915edd2cefeac4cc96
Reviewed-on: https://go-review.googlesource.com/12033
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-07-11 23:27:05 +00:00
Joel Sing 644910e6da poly1305: fix compilation on arm with go tip
Fix compilation of poly1305 using go tip - it currently fails with:

./poly1305_arm.s:124: cannot reference SP without a symbol
./poly1305_arm.s:161: cannot reference SP without a symbol
./poly1305_arm.s:162: cannot reference SP without a symbol
asm: asm: assembly of ./poly1305_arm.s failed

Change-Id: I797dcf3641cc881b6cc192034b693ccf58317987
Reviewed-on: https://go-review.googlesource.com/10307
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Adam Langley <agl@golang.org>
2015-05-21 15:47:07 +00:00
Jungho Ahn 4d48e5fa3d x/crypto/poly1305: add ARM assembly
This change adds ARMv6 assembly implementation. The referenced assembly code was
  the public domain source by Andrew Moon in https://github.com/floodyberry/poly1305-opt/blob/master/app/extensions/poly1305/poly1305_armv6-32.inc.
  The author has confirmed that it's ok to put it under the Go license.

  Benchmark results on Raspberry Pi (ARMv6-compatible processor rev 7),
   o Without ARMv6 assembly
     Benchmark1K      5000      287177 ns/op     3.57 MB/s
     Benchmark64     50000       38880 ns/op     1.65 MB/s

   o With ARMv6 assembly
     Benchmark1K    100000       15964 ns/op    64.14 MB/s
     Benchmark64   1000000        1472 ns/op    43.46 MB/s

Change-Id: Iea5b0b831ac097cc6d477a8fccbf0ddb4819724c
Reviewed-on: https://go-review.googlesource.com/9765
Reviewed-by: Adam Langley <agl@golang.org>
Run-TryBot: Adam Langley <agl@golang.org>
2015-05-14 21:10:51 +00:00
Marga Manterola c57d4a7191 poly1305, curve25519: add build constraints for appengine
Updates: golang/go#9845

Change-Id: I78ce460d2a188ee13dd3f80015919a14eba03d07
Reviewed-on: https://go-review.googlesource.com/8100
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-03-27 05:11:19 +00:00
David Symonds 1fbbd62cfe crypto: add import comments.
Change-Id: I33240faf1b8620d0cd600de661928d8e422ebdbc
Reviewed-on: https://go-review.googlesource.com/1235
Reviewed-by: Andrew Gerrand <adg@golang.org>
2014-12-09 23:26:36 +00:00
Ian Lance Taylor 902e2dcb72 curve25519, poly1305: change last CL to build with Go 1.3
It also still works with Go 1.4.

LGTM=agl
R=agl
CC=golang-codereviews
https://golang.org/cl/154120043
2014-10-07 18:09:31 -07:00
Ian Lance Taylor 20b2ab3f62 curve25519, poly1305: mark constants as RODATA
Fixes tests when using Go tip.  Without this the link steps
fails with errors like:

missing Go type information for global symbol: google3/third_party/golang/go_crypto/curve25519/curve25519.REDMASK51 size 8

LGTM=agl
R=agl
CC=golang-codereviews
https://golang.org/cl/156810043
2014-10-07 16:59:07 -07:00
Shenghou Ma bf5456312c go.crypto/{curve25519,poly1305,salsa20/salsa}: add //go:noescape annotation
R=golang-dev, rsc, agl
CC=golang-dev
https://golang.org/cl/7319045
2013-02-19 19:15:01 +08:00
Ian Lance Taylor 6779fad1d0 go.crypto: add and adjust +build lines for 386 and gccgo
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6827061
2012-11-07 22:50:39 -08:00
Adam Langley 9c0a3ae199 go.crypto/poly1305: enable AMD64 assembly
This change alters the assembly to use FSUBD instructions such that
6l will actually emit the correct FSUBRD instructions and enables
the assembly code.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6514044
2012-09-14 17:00:38 -04:00
Adam Langley 6814ed3bb5 go.crypto/poly1305: add package.
(Reference implementation by dchest. amd64 disabled pending 6l fix.)

R=golang-dev, dchest
CC=golang-dev
https://golang.org/cl/6494105
2012-09-08 14:24:19 -04:00