From e8561eb0fba1826900cb76747b52d3a0182436b8 Mon Sep 17 00:00:00 2001 From: Michael Hamburg Date: Tue, 26 Jan 2016 14:38:32 -0800 Subject: [PATCH] pniels_t is now aligned to sizeof(big_register_t), clearing a MAGIC --- src/decaf.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/decaf.c b/src/decaf.c index 4529f67..5594282 100644 --- a/src/decaf.c +++ b/src/decaf.c @@ -47,7 +47,8 @@ extern const point_t API_NS(point_base); /* Projective Niels coordinates */ typedef struct { gf a, b, c; } niels_s, niels_t[1]; -typedef struct { niels_t n; gf z; } __attribute__((aligned(32))) pniels_s, pniels_t[1]; /* MAGIC alignment */ +typedef struct { niels_t n; gf z; } __attribute__((aligned(sizeof(big_register_t)))) + pniels_s, pniels_t[1]; /* Precomputed base */ struct precomputed_s { niels_t table [DECAF_COMBS_N<<(DECAF_COMBS_T-1)]; }; @@ -57,7 +58,7 @@ const precomputed_s *API_NS(precomputed_base) = (const precomputed_s *) &API_NS(precomputed_base_as_fe); const size_t API_NS2(sizeof,precomputed_s) = sizeof(precomputed_s); -const size_t API_NS2(alignof,precomputed_s) = 32; +const size_t API_NS2(alignof,precomputed_s) = sizeof(big_register_t); #define FOR_LIMB(i,op) { unsigned int i=0; for (i=0; i