Browse Source

pniels_t is now aligned to sizeof(big_register_t), clearing a MAGIC

master
Michael Hamburg 8 years ago
parent
commit
e8561eb0fb
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      src/decaf.c

+ 3
- 2
src/decaf.c View File

@@ -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<NLIMBS; i++) { op; }}
#define FOR_LIMB_U(i,op) { unsigned int i=0; UNROLL for (i=0; i<NLIMBS; i++) { op; }}


Loading…
Cancel
Save