diff --git a/src/libsodium/crypto_scalarmult/curve25519/sandy2x/consts_namespace.h b/src/libsodium/crypto_scalarmult/curve25519/sandy2x/consts_namespace.h index 42ef7421..f1bb13c7 100644 --- a/src/libsodium/crypto_scalarmult/curve25519/sandy2x/consts_namespace.h +++ b/src/libsodium/crypto_scalarmult/curve25519/sandy2x/consts_namespace.h @@ -1,5 +1,5 @@ -#ifndef CONSTS_NAMESPACE_H -#define CONSTS_NAMESPACE_H +#ifndef consts_namespace_H +#define consts_namespace_H #define v0_0 crypto_scalarmult_curve25519_sandy2x_v0_0 #define v1_0 crypto_scalarmult_curve25519_sandy2x_v1_0 @@ -18,5 +18,5 @@ #define subc2 crypto_scalarmult_curve25519_sandy2x_subc2 #define REDMASK51 crypto_scalarmult_curve25519_sandy2x_REDMASK51 -#endif //ifndef CONSTS_NAMESPACE_H +#endif //ifndef consts_namespace_H diff --git a/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe.h b/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe.h index fbca8867..a9a50e61 100644 --- a/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe.h +++ b/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe.h @@ -3,8 +3,8 @@ All the redundant functions are removed. */ -#ifndef FE_H -#define FE_H +#ifndef fe_H +#define fe_H #include "crypto_uint64.h" diff --git a/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51.h b/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51.h index a579f000..5ef8a439 100644 --- a/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51.h +++ b/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51.h @@ -5,8 +5,8 @@ New function fe51_nsquare is introduced. */ -#ifndef FE51_H -#define FE51_H +#ifndef fe51_H +#define fe51_H #include "crypto_uint64.h" #include "fe51_namespace.h" diff --git a/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_invert.c b/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_invert.c index 364eb355..149054ee 100644 --- a/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_invert.c +++ b/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_invert.c @@ -5,6 +5,8 @@ #include "fe51.h" +#ifdef HAVE_AMD64_ASM + #define fe51_square(x, y) fe51_nsquare(x, y, 1) void fe51_invert(fe51 *r, const fe51 *x) @@ -51,3 +53,5 @@ void fe51_invert(fe51 *r, const fe51 *x) /* 2^255 - 2^5 */ fe51_nsquare(&t,&t,5); /* 2^255 - 21 */ fe51_mul(r,&t,&z11); } + +#endif diff --git a/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_namespace.h b/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_namespace.h index 1eee4b61..9d8f942b 100644 --- a/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_namespace.h +++ b/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_namespace.h @@ -1,5 +1,5 @@ -#ifndef FE51_NAMESPACE_H -#define FE51_NAMESPACE_H +#ifndef fe51_namespace_H +#define fe51_namespace_H #define fe51 crypto_scalarmult_curve25519_sandy2x_fe51 #define _fe51 _crypto_scalarmult_curve25519_sandy2x_fe51 @@ -12,5 +12,5 @@ #define fe51_invert crypto_scalarmult_curve25519_sandy2x_fe51_invert -#endif //ifndef FE51_NAMESPACE_H +#endif //ifndef fe51_namespace_H diff --git a/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe_frombytes_sandy2x.c b/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe_frombytes_sandy2x.c index 45f4036a..208f7df7 100644 --- a/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe_frombytes_sandy2x.c +++ b/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe_frombytes_sandy2x.c @@ -5,6 +5,8 @@ #include "fe.h" #include "crypto_uint64.h" +#ifdef HAVE_AMD64_ASM + static crypto_uint64 load_3(const unsigned char *in) { crypto_uint64 result; @@ -70,3 +72,5 @@ void fe_frombytes(fe h,const unsigned char *s) h[8] = h8; h[9] = h9; } + +#endif diff --git a/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder.h b/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder.h index afd22350..cacfabbe 100644 --- a/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder.h +++ b/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder.h @@ -1,10 +1,10 @@ -#ifndef LADDER_H -#define LADDER_H +#ifndef ladder_H +#define ladder_H #include "fe.h" #include "ladder_namespace.h" extern void ladder(fe *, const unsigned char *); -#endif //ifndef LADDER_H +#endif //ifndef ladder_H diff --git a/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_base.h b/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_base.h index 1d6a84c1..88b168de 100644 --- a/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_base.h +++ b/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_base.h @@ -1,10 +1,10 @@ -#ifndef LADDER_BASE_H -#define LADDER_BASE_H +#ifndef ladder_base_H +#define ladder_base_H #include "fe.h" #include "ladder_base_namespace.h" extern void ladder_base(fe *, const unsigned char *); -#endif //ifndef LADDER_BASE_H +#endif //ifndef ladder_base_H diff --git a/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_base_namespace.h b/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_base_namespace.h index 332fd98c..af5fa569 100644 --- a/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_base_namespace.h +++ b/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_base_namespace.h @@ -1,8 +1,8 @@ -#ifndef LADDER_BASE_NAMESPACE_H -#define LADDER_BASE_NAMESPACE_H +#ifndef ladder_base_namespace_H +#define ladder_base_namespace_H #define ladder_base crypto_scalarmult_curve25519_sandy2x_ladder_base #define _ladder_base _crypto_scalarmult_curve25519_sandy2x_ladder_base -#endif //ifndef LADDER_BASE_NAMESPACE_H +#endif //ifndef ladder_base_namespace_H diff --git a/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_namespace.h b/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_namespace.h index 26c76297..8481ff4a 100644 --- a/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_namespace.h +++ b/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_namespace.h @@ -1,8 +1,8 @@ -#ifndef LADDER_NAMESPACE_H -#define LADDER_NAMESPACE_H +#ifndef ladder_namespace_H +#define ladder_namespace_H #define ladder crypto_scalarmult_curve25519_sandy2x_ladder #define _ladder _crypto_scalarmult_curve25519_sandy2x_ladder -#endif //ifndef LADDER_NAMESPACE_H +#endif //ifndef ladder_namespace_H