aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/crypto/chacha20poly1305.c
diff options
context:
space:
mode:
authorSamuel Neves <sneves@dei.uc.pt>2017-11-22 16:58:04 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2017-11-22 18:32:48 +0100
commit5700b6174988bd8b682c7301a11060ae76983027 (patch)
treebda7ff62cd19d34a79c91a41d4520305c3835eb0 /src/crypto/chacha20poly1305.c
parentglobal: switch from timeval to timespec (diff)
downloadwireguard-monolithic-historical-5700b6174988bd8b682c7301a11060ae76983027.tar.xz
wireguard-monolithic-historical-5700b6174988bd8b682c7301a11060ae76983027.zip
poly1305-x86_64: unclobber %rbp
OpenSSL's Poly1305 kernels use %rbp as a scratch register. However, the kernel expects rbp to be a valid frame pointer at any given time in order to do proper unwinding. Thus we need to alter the code in order to preserve it. The most straightforward manner in which this was accomplished was by replacing $d3 in poly1305-x86_64.pl -- formerly %r10 -- by %rdi, and replace %rbp by %r10. Because %rdi, a pointer to the context structure, does not change and is not used by poly1305_iteration, it is safe to use it here, and the overhead of saving and restoring it should be minimal. Signed-off-by: Samuel Neves <sneves@dei.uc.pt>
Diffstat (limited to 'src/crypto/chacha20poly1305.c')
0 files changed, 0 insertions, 0 deletions