Compilation warnings on Windows

This commit is contained in:
Olivier Chéron 2017-04-03 19:38:28 +02:00
parent 8be9856402
commit 8ecde60853
4 changed files with 24 additions and 4 deletions

View File

@ -1530,13 +1530,13 @@ prepare_wnaf_table(
extern const gf API_NS(precomputed_wnaf_as_fe)[];
static const niels_t *API_NS(wnaf_base) = (const niels_t *)API_NS(precomputed_wnaf_as_fe);
const size_t API_NS(sizeof_precomputed_wnafs) __attribute((visibility("hidden")))
const size_t API_NS(sizeof_precomputed_wnafs)
= sizeof(niels_t)<<CRYPTONITE_DECAF_WNAF_FIXED_TABLE_BITS;
void API_NS(precompute_wnafs) (
niels_t out[1<<CRYPTONITE_DECAF_WNAF_FIXED_TABLE_BITS],
const point_t base
) __attribute__ ((visibility ("hidden")));
);
void API_NS(precompute_wnafs) (
niels_t out[1<<CRYPTONITE_DECAF_WNAF_FIXED_TABLE_BITS],

View File

@ -11,7 +11,7 @@ const API_NS(point_t) API_NS(point_base) = {{
{FIELD_LITERAL(0x008f205b70660415,0x00881c60cfd3824f,0x00377a638d08500d,0x008c66d5d4672615,0x00e52fa558e08e13,0x0087770ae1b6983d,0x004388f55a0aa7ff,0x00b4d9a785cf1a91)}
}};
const gf API_NS(precomputed_base_as_fe)[240]
VECTOR_ALIGNED __attribute__((visibility("hidden"))) = {
VECTOR_ALIGNED = {
{FIELD_LITERAL(0x00e614a9f7278dc5,0x002e454ad04c5124,0x00d8f58cee1436f3,0x00c83ed46e4180ec,0x00a41e93274a38fa,0x00c1e7e53257771e,0x0043e0ff03c0392f,0x002c7c6405ce61df)},
{FIELD_LITERAL(0x0033c4f9dc990b33,0x00c291cb1ceb55c3,0x002ae3f58ade88b2,0x006b1f9f11395474,0x002ded6e4b27ff7c,0x0041012ed4aa10e1,0x003c22d20a36bae7,0x001f584eed472b19)},
{FIELD_LITERAL(0x00c3514779ee6f60,0x001574c873b20c2b,0x004cd6a46a5a5e65,0x0059a068aeb4204a,0x004c610458bc354d,0x00e94567479d02d2,0x00feaf77ed118e28,0x00f58a8bf115eeb5)},
@ -254,7 +254,7 @@ VECTOR_ALIGNED __attribute__((visibility("hidden"))) = {
{FIELD_LITERAL(0x00bba0ed9c67c41f,0x00b30c8e225ba195,0x008bb5762a5cef18,0x00e0df31b06fb7cc,0x0018b912141991d5,0x00f6ed54e093eac2,0x0009e288264dbbb3,0x00feb663299b89ef)}
};
const gf API_NS(precomputed_wnaf_as_fe)[96]
VECTOR_ALIGNED __attribute__((visibility("hidden"))) = {
VECTOR_ALIGNED = {
{FIELD_LITERAL(0x00cfc32590115acd,0x0079f0e2a5c7af1b,0x00dd94605b8d7332,0x0097dd6c75f5f3f3,0x00d9c59e36156de9,0x00edfbfd6cde47d7,0x0095b97c9f67c39a,0x007d7b90f587debc)},
{FIELD_LITERAL(0x00cfc32590115acd,0x0079f0e2a5c7af1b,0x00dd94605b8d7332,0x0017dd6c75f5f3f3,0x00d9c59e36156de8,0x00edfbfd6cde47d7,0x0095b97c9f67c39a,0x00fd7b90f587debc)},
{FIELD_LITERAL(0x001071dd4d8ae672,0x004f14ebe5f4f174,0x00e0987625c34c73,0x0092d00712c6f8c1,0x009ef424965e980b,0x00a8e0cf9369764b,0x000aa81907b4d207,0x00d5002c74d37924)},

View File

@ -1 +1,6 @@
/* portable_endian.h not used */
#if defined(__MINGW32__)
// does not exist on MinGW, but unused anyway
extern int posix_memalign(void **, size_t, size_t);
#endif

View File

@ -26,6 +26,13 @@
# aligned(16). This removes warnings on OpenBSD with GCC 4.2.1, and makes
# sure we get at least 16-byte alignment. 32-byte alignment is necessary
# only for AVX2 and arch_x86_64, which we don't have.
#
# * visibility("hidden") attributes are removed, as this is not supported
# on Windows/MinGW, and we have name mangling instead
#
# * function posix_memalign is defined in order to avoid a warning on
# Windows/MinGW. Hopefully it is not called. This definition is put
# inside portable_endian.h because this file is already included.
SRC_DIR="$1/src"
DEST_DIR="`dirname "$0"`"/..
@ -47,6 +54,9 @@ convert() {
fi
sed <"$1" >"$2/$FILE_NAME" \
-e 's/ __attribute((visibility("hidden")))//g' \
-e 's/ __attribute__((visibility("hidden")))//g' \
-e 's/ __attribute__ ((visibility ("hidden")))//g' \
-e "s/__attribute__((aligned(32)))/$REPL/g" \
-e 's/decaf_/cryptonite_decaf_/g' \
-e 's/DECAF_/CRYPTONITE_DECAF_/g' \
@ -103,4 +113,9 @@ done
cat >"$DEST_DIR"/include/portable_endian.h <<EOF
/* portable_endian.h not used */
#if defined(__MINGW32__)
// does not exist on MinGW, but unused anyway
extern int posix_memalign(void **, size_t, size_t);
#endif
EOF