From 822c9e935a25a7590cd99b4c5407bb6596be41b7 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 4 Dec 2013 18:22:33 +0100 Subject: Change xor and xor_a back to work on pointers For some reason, this makes GCC generate much better code on MIPS with -Os --- src/crypto.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/crypto.h') 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) { -- cgit v1.2.3