boringssl/crypto/curve25519
Adam Langley 772a5bed7d Reorder the X25519 ladderstep stack frame on x86-64.
The current X25519 assembly has a 352-byte stack frame and saves the
regsiters at the bottom. This means that the CFI information cannot be
represented in the “compact” form that MacOS seems to want to use (see
linked bug).

The stack frame looked like:

 360 CFA
 352 return address
 ⋮
 56  (296 bytes of scratch space)
 48  saved RBP
 40  saved RBX
 32  saved R15
 24  saved R14
 16  saved R13
 8   saved R12
 0   (hole left from 3f38d80b dropping the superfluous saving of R11)

Now it looks like:

 352 CFA
 344 return address
 336 saved RBP
 328 saved RBX
 320 saved R15
 312 saved R14
 304 saved R13
 296 saved R12
 ⋮
 0   (296 bytes of scratch space)

The bulk of the changes involve subtracting 56 from all the offsets to
RSP when working in the scratch space. This was done in Vim with:
  '<,'>s/\([1-9][0-9]*\)(%rsp)/\=submatch(1)-56."(%rsp)"/

BUG=176

Change-Id: I022830e8f896fe2d877015fa3ecfa1d073207679
Reviewed-on: https://boringssl-review.googlesource.com/13580
Commit-Queue: Adam Langley <agl@google.com>
Commit-Queue: David Benjamin <davidben@google.com>
Reviewed-by: David Benjamin <davidben@google.com>
CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
2017-02-02 22:47:05 +00:00
..
asm Reorder the X25519 ladderstep stack frame on x86-64. 2017-02-02 22:47:05 +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
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