Make crypto_scalarmult_curve25519.h architecture-independent

This commit is contained in:
Frank Denis 2013-12-11 20:17:09 -08:00
parent 5133638024
commit bf72ee931e
9 changed files with 22 additions and 25 deletions

1
.gitignore vendored
View File

@ -47,7 +47,6 @@ src/curvecp/curvecpmessage
src/curvecp/curvecpprintkey src/curvecp/curvecpprintkey
src/curvecp/curvecpserver src/curvecp/curvecpserver
src/libsodium/*.def src/libsodium/*.def
src/libsodium/include/sodium/crypto_scalarmult_curve25519.h
src/libsodium/include/sodium/version.h src/libsodium/include/sodium/version.h
stamp-* stamp-*
test/default/*.res test/default/*.res

View File

@ -397,7 +397,6 @@ AC_CONFIG_FILES([Makefile
src/libsodium/Makefile src/libsodium/Makefile
src/libsodium/include/Makefile src/libsodium/include/Makefile
src/libsodium/include/sodium/version.h src/libsodium/include/sodium/version.h
src/libsodium/include/sodium/crypto_scalarmult_curve25519.h
test/default/Makefile test/default/Makefile
test/Makefile test/Makefile
]) ])

View File

@ -1,5 +1,3 @@
cscript msvc-scripts/rep.vbs //Nologo s/@HAVE_TI_MODE_V@/0/ < src\libsodium\include\sodium\crypto_scalarmult_curve25519.h.in > src\libsodium\include\sodium\crypto_scalarmult_curve25519.h
cscript msvc-scripts/rep.vbs //Nologo s/@VERSION@/0.4.5/ < src\libsodium\include\sodium\version.h.in > tmp cscript msvc-scripts/rep.vbs //Nologo s/@VERSION@/0.4.5/ < src\libsodium\include\sodium\version.h.in > tmp
cscript msvc-scripts/rep.vbs //Nologo s/@SODIUM_LIBRARY_VERSION_MAJOR@/4/ < tmp > tmp2 cscript msvc-scripts/rep.vbs //Nologo s/@SODIUM_LIBRARY_VERSION_MAJOR@/4/ < tmp > tmp2
cscript msvc-scripts/rep.vbs //Nologo s/@SODIUM_LIBRARY_VERSION_MINOR@/4/ < tmp2 > src\libsodium\include\sodium\version.h cscript msvc-scripts/rep.vbs //Nologo s/@SODIUM_LIBRARY_VERSION_MINOR@/4/ < tmp2 > src\libsodium\include\sodium\version.h

View File

@ -4,6 +4,6 @@
#define crypto_scalarmult_curve25519_implementation_name \ #define crypto_scalarmult_curve25519_implementation_name \
crypto_scalarmult_curve25519_donna_c64_implementation_name crypto_scalarmult_curve25519_donna_c64_implementation_name
#define crypto_scalarmult crypto_scalarmult_curve25519_donna_c64 #define crypto_scalarmult crypto_scalarmult_curve25519
#define crypto_scalarmult_base crypto_scalarmult_curve25519_donna_c64_base #define crypto_scalarmult_base crypto_scalarmult_curve25519_base

View File

@ -4,5 +4,5 @@
#define crypto_scalarmult_curve25519_implementation_name \ #define crypto_scalarmult_curve25519_implementation_name \
crypto_scalarmult_curve25519_ref_implementation_name crypto_scalarmult_curve25519_ref_implementation_name
#define crypto_scalarmult crypto_scalarmult_curve25519_ref #define crypto_scalarmult crypto_scalarmult_curve25519
#define crypto_scalarmult_base crypto_scalarmult_curve25519_ref_base #define crypto_scalarmult_base crypto_scalarmult_curve25519_base

View File

@ -4,5 +4,5 @@
#define crypto_stream_salsa20_implementation_name \ #define crypto_stream_salsa20_implementation_name \
crypto_stream_salsa20_ref_implementation_name crypto_stream_salsa20_ref_implementation_name
#define crypto_stream crypto_stream_salsa20_ref #define crypto_stream crypto_stream_salsa20
#define crypto_stream_xor crypto_stream_salsa20_ref_xor #define crypto_stream_xor crypto_stream_salsa20_xor

View File

@ -23,6 +23,7 @@ SODIUM_EXPORT = \
sodium/crypto_onetimeauth_poly1305_53.h \ sodium/crypto_onetimeauth_poly1305_53.h \
sodium/crypto_onetimeauth_poly1305_donna.h \ sodium/crypto_onetimeauth_poly1305_donna.h \
sodium/crypto_scalarmult.h \ sodium/crypto_scalarmult.h \
sodium/crypto_scalarmult_curve25519.h \
sodium/crypto_secretbox.h \ sodium/crypto_secretbox.h \
sodium/crypto_secretbox_xsalsa20poly1305.h \ sodium/crypto_secretbox_xsalsa20poly1305.h \
sodium/crypto_shorthash.h \ sodium/crypto_shorthash.h \
@ -52,7 +53,6 @@ SODIUM_EXPORT = \
sodium/utils.h sodium/utils.h
EXTRA_SRC = $(SODIUM_EXPORT) \ EXTRA_SRC = $(SODIUM_EXPORT) \
sodium/crypto_scalarmult_curve25519.h.in \
sodium/version.h.in sodium/version.h.in
nobase_include_HEADERS = $(SODIUM_EXPORT) nobase_include_HEADERS = $(SODIUM_EXPORT)

View File

@ -1,12 +1,6 @@
#ifndef crypto_scalarmult_curve25519_H #ifndef crypto_scalarmult_curve25519_H
#define crypto_scalarmult_curve25519_H #define crypto_scalarmult_curve25519_H
#if @HAVE_TI_MODE_V@
# ifndef SODIUM_HAVE_TI_MODE
# define SODIUM_HAVE_TI_MODE
# endif
#endif
#include <stddef.h> #include <stddef.h>
#include "export.h" #include "export.h"
@ -29,14 +23,6 @@ int crypto_scalarmult_curve25519(unsigned char *,const unsigned char *,const uns
SODIUM_EXPORT SODIUM_EXPORT
int crypto_scalarmult_curve25519_base(unsigned char *,const unsigned char *); int crypto_scalarmult_curve25519_base(unsigned char *,const unsigned char *);
#ifdef SODIUM_HAVE_TI_MODE
# define crypto_scalarmult_curve25519_donna_c64 crypto_scalarmult_curve25519
# define crypto_scalarmult_curve25519_donna_c64_base crypto_scalarmult_curve25519_base
#else
# define crypto_scalarmult_curve25519_ref crypto_scalarmult_curve25519
# define crypto_scalarmult_curve25519_ref_base crypto_scalarmult_curve25519_base
#endif
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -148,6 +148,21 @@ crypto_scalarmult_curve25519_ref(unsigned char *q, const unsigned char *n,
return crypto_scalarmult_curve25519(q, n, p); return crypto_scalarmult_curve25519(q, n, p);
} }
#undef crypto_scalarmult_curve25519_donna_c64_base
SODIUM_EXPORT int
crypto_scalarmult_curve25519_donna_c64_base(unsigned char *q, const unsigned char *n)
{
return crypto_scalarmult_curve25519_base(q, n);
}
#undef crypto_scalarmult_curve25519_donna_c64
SODIUM_EXPORT int
crypto_scalarmult_curve25519_donna_c64(unsigned char *q, const unsigned char *n,
const unsigned char *p)
{
return crypto_scalarmult_curve25519(q, n, p);
}
#undef crypto_secretbox_xsalsa20poly1305_ref #undef crypto_secretbox_xsalsa20poly1305_ref
SODIUM_EXPORT int SODIUM_EXPORT int
crypto_secretbox_xsalsa20poly1305_ref(unsigned char *c, crypto_secretbox_xsalsa20poly1305_ref(unsigned char *c,