Don't align NEWPOLY_POLY.

The alignas in NEWPOLY_POLY told the compiler that it could assume a
certain alignment. However, values were allocated with malloc with no
specific alignment.

We could try and allocate aligned memory but the alignment doesn't have
a performance impact (on x86-64) so this is the simpler change. (Also,
Windows doesn't have |posix_memalign|. The cloest thing is
_alligned_alloc but then one has to use a special free function.)

Change-Id: I53955a88862160c02aa5436d991b1b797c3c17db
Reviewed-on: https://boringssl-review.googlesource.com/8315
Reviewed-by: David Benjamin <davidben@google.com>
This commit is contained in:
Adam Langley 2016-06-16 10:43:39 -07:00 committed by David Benjamin
parent 13603a8399
commit 3cab5572b1

View File

@ -32,7 +32,7 @@
/* Polynomial coefficients in unpacked form. */ /* Polynomial coefficients in unpacked form. */
struct newhope_poly_st { struct newhope_poly_st {
alignas(32) uint16_t coeffs[PARAM_N]; uint16_t coeffs[PARAM_N];
}; };
/* SEED_LENGTH is the length of the AES-CTR seed used to derive a polynomial. */ /* SEED_LENGTH is the length of the AES-CTR seed used to derive a polynomial. */