diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2013-12-04 18:22:33 +0100 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2013-12-04 19:15:56 +0100 |
commit | 822c9e935a25a7590cd99b4c5407bb6596be41b7 (patch) | |
tree | bbb54a32dc204bd87174b6c444032a306f7e5c73 /src/crypto.h | |
parent | 35748654f39a99c226cd14f3b92822eb64bd7037 (diff) | |
download | fastd-822c9e935a25a7590cd99b4c5407bb6596be41b7.tar fastd-822c9e935a25a7590cd99b4c5407bb6596be41b7.zip |
Change xor and xor_a back to work on pointers
For some reason, this makes GCC generate much better code on MIPS with -Os
Diffstat (limited to 'src/crypto.h')
-rw-r--r-- | src/crypto.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/crypto.h b/src/crypto.h index 124d06d..af8547d 100644 --- a/src/crypto.h +++ b/src/crypto.h @@ -80,13 +80,13 @@ static inline void secure_memzero(void *s, size_t n) { __asm__ volatile("" : : "m"(s)); } -static inline void xor(fastd_block128_t *x, fastd_block128_t a, fastd_block128_t b) { - x->qw[0] = a.qw[0] ^ b.qw[0]; - x->qw[1] = a.qw[1] ^ b.qw[1]; +static inline void xor(fastd_block128_t *x, const fastd_block128_t *a, const fastd_block128_t *b) { + x->qw[0] = a->qw[0] ^ b->qw[0]; + x->qw[1] = a->qw[1] ^ b->qw[1]; } -static inline void xor_a(fastd_block128_t *x, fastd_block128_t a) { - xor(x, *x, a); +static inline void xor_a(fastd_block128_t *x, const fastd_block128_t *a) { + xor(x, x, a); } static inline bool fastd_true(void) { |