diff options
author | Niels Möller <nisse@lysator.liu.se> | 2020-06-25 21:17:36 +0200 |
---|---|---|
committer | Niels Möller <nisse@lysator.liu.se> | 2020-06-25 21:17:36 +0200 |
commit | db9b66e047a47d5070d99de8a6ccb6ddd79efce6 (patch) | |
tree | 4588979d9b687ba00b07426be0f33f36a79ed1ac /x86_64 | |
parent | f0055d490d48804471a532c4d066082d740d5f6b (diff) | |
download | nettle-db9b66e047a47d5070d99de8a6ccb6ddd79efce6.tar.gz |
x86_64: Fix use of macro arguments in chacha QROUND macro.
Diffstat (limited to 'x86_64')
-rw-r--r-- | x86_64/chacha-core-internal.asm | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/x86_64/chacha-core-internal.asm b/x86_64/chacha-core-internal.asm index 9e5dc394..0c6f7424 100644 --- a/x86_64/chacha-core-internal.asm +++ b/x86_64/chacha-core-internal.asm @@ -54,33 +54,33 @@ define(<ROTL_BY_16>, < por $2, $1 >) >) -C QROUND +C QROUND(x0, x1, x2, x3) define(<QROUND>, < - paddd X1, X0 - pxor X0, X3 - movaps X3, T0 - ROTL_BY_16(X3, T0) - - paddd X3, X2 - pxor X2, X1 - movaps X1, T0 - pslld <$>12, X1 + paddd $2, $1 + pxor $1, $4 + movaps $4, T0 + ROTL_BY_16($4, T0) + + paddd $4, $3 + pxor $3, $2 + movaps $2, T0 + pslld <$>12, $2 psrld <$>20, T0 - por T0, X1 + por T0, $2 - paddd X1, X0 - pxor X0, X3 - movaps X3, T0 - pslld <$>8, X3 + paddd $2, $1 + pxor $1, $4 + movaps $4, T0 + pslld <$>8, $4 psrld <$>24, T0 - por T0, X3 + por T0, $4 - paddd X3, X2 - pxor X2, X1 - movaps X1, T0 - pslld <$>7, X1 + paddd $4, $3 + pxor $3, $2 + movaps $2, T0 + pslld <$>7, $2 psrld <$>25, T0 - por T0, X1 + por T0, $2 >) C _chacha_core(uint32_t *dst, const uint32_t *src, unsigned rounds) |