boringssl/crypto/curve25519
Adam Langley 3f38d80b2f Add CFI information to the x86-64 X25519 asm.
This change serves to check that all our consumers can process assembly
with CFI directives in it.

For the first change I picked a file that's not perlasm to keep things
slightly simplier, but that might have been a mistake:

DJB's tooling always aligns the stack to 32 bytes and it's not possible
to express this in DWARF format (without using a register to store the
old stack pointer).

Since none of the functions here appear to care about that alignment, I
removed it from each of them. I also trimmed the set of saved registers
where possible and used the redzone for functions that didn't need much
stack.

Overall, this appears to have slightly improved the performance (by
about 0.7%):

Before:

Did 46000 Curve25519 base-point multiplication operations in 3023288us (15215.2 ops/sec)
Did 46000 Curve25519 arbitrary point multiplication operations in 3017315us (15245.3 ops/sec)
Did 46000 Curve25519 base-point multiplication operations in 3015346us (15255.3 ops/sec)
Did 46000 Curve25519 arbitrary point multiplication operations in 3018609us (15238.8 ops/sec)
Did 46000 Curve25519 base-point multiplication operations in 3019004us (15236.8 ops/sec)
Did 46000 Curve25519 arbitrary point multiplication operations in 3013135us (15266.5 ops/sec)

After:

Did 46000 Curve25519 base-point multiplication operations in 3007659us (15294.3 ops/sec)
Did 47000 Curve25519 arbitrary point multiplication operations in 3054202us (15388.6 ops/sec)
Did 46000 Curve25519 base-point multiplication operations in 3008714us (15288.9 ops/sec)
Did 46000 Curve25519 arbitrary point multiplication operations in 3004740us (15309.1 ops/sec)
Did 46000 Curve25519 base-point multiplication operations in 3009140us (15286.8 ops/sec)
Did 47000 Curve25519 arbitrary point multiplication operations in 3057518us (15371.9 ops/sec)

Change-Id: I31df11c45b2ea0bf44dde861d52c27f848331691
Reviewed-on: https://boringssl-review.googlesource.com/13200
CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
Reviewed-by: David Benjamin <davidben@google.com>
Reviewed-by: Adam Langley <agl@google.com>
Commit-Queue: Adam Langley <agl@google.com>
2017-01-31 17:55:19 +00:00
..
asm Add CFI information to the x86-64 X25519 asm. 2017-01-31 17:55:19 +00:00
CMakeLists.txt Add SPAKE2 over Ed25519. 2016-03-01 19:34:10 +00:00
curve25519.c Work around language and compiler bug in memcpy, etc. 2016-12-21 20:34:47 +00:00
ed25519_test.cc Work around language and compiler bug in memcpy, etc. 2016-12-21 20:34:47 +00:00
ed25519_tests.txt Add X25519 and Ed25519 support. 2015-11-17 21:56:12 +00:00
internal.h Add SPAKE2 over Ed25519. 2016-03-01 19:34:10 +00:00
spake25519_test.cc Work around language and compiler bug in memcpy, etc. 2016-12-21 20:34:47 +00:00
spake25519.c Work around language and compiler bug in memcpy, etc. 2016-12-21 20:34:47 +00:00
x25519_test.cc Work around language and compiler bug in memcpy, etc. 2016-12-21 20:34:47 +00:00
x25519-x86_64.c Work around language and compiler bug in memcpy, etc. 2016-12-21 20:34:47 +00:00