mirror of
https://github.com/jedisct1/libsodium.git
synced 2026-08-25 08:37:13 +09:00
Stop hiding function names with macros in salsa20
This commit is contained in:
@@ -27,10 +27,8 @@ libsodium_la_SOURCES = \
|
||||
crypto_box/curve25519xsalsa20poly1305/ref/keypair_curve25519xsalsa20poly1305.c \
|
||||
crypto_core/hsalsa20/ref2/core_hsalsa20.c \
|
||||
crypto_core/hsalsa20/core_hsalsa20_api.c \
|
||||
crypto_core/hsalsa20/ref2/api.h \
|
||||
crypto_core/salsa20/ref/core_salsa20.c \
|
||||
crypto_core/salsa20/core_salsa20_api.c \
|
||||
crypto_core/salsa20/ref/api.h \
|
||||
crypto_generichash/crypto_generichash.c \
|
||||
crypto_generichash/blake2/generichash_blake2_api.c \
|
||||
crypto_generichash/blake2/ref/api.h \
|
||||
@@ -139,7 +137,6 @@ libsodium_la_SOURCES = \
|
||||
crypto_stream/chacha20/ref/stream_chacha20_ref.c \
|
||||
crypto_stream/salsa20/stream_salsa20_api.c \
|
||||
crypto_stream/xsalsa20/stream_xsalsa20_api.c \
|
||||
crypto_stream/xsalsa20/ref/api.h \
|
||||
crypto_stream/xsalsa20/ref/stream_xsalsa20.c \
|
||||
crypto_stream/xsalsa20/ref/xor_xsalsa20.c \
|
||||
crypto_verify/16/verify_16_api.c \
|
||||
@@ -223,11 +220,9 @@ endif
|
||||
|
||||
if HAVE_AMD64_ASM
|
||||
libsodium_la_SOURCES += \
|
||||
crypto_stream/salsa20/amd64_xmm6/api.h \
|
||||
crypto_stream/salsa20/amd64_xmm6/stream_salsa20_amd64_xmm6.S
|
||||
else
|
||||
libsodium_la_SOURCES += \
|
||||
crypto_stream/salsa20/ref/api.h \
|
||||
crypto_stream/salsa20/ref/stream_salsa20_ref.c \
|
||||
crypto_stream/salsa20/ref/xor_salsa20_ref.c
|
||||
endif
|
||||
@@ -236,10 +231,8 @@ if !MINIMAL
|
||||
libsodium_la_SOURCES += \
|
||||
crypto_core/salsa2012/ref/core_salsa2012.c \
|
||||
crypto_core/salsa2012/core_salsa2012_api.c \
|
||||
crypto_core/salsa2012/ref/api.h \
|
||||
crypto_core/salsa208/ref/core_salsa208.c \
|
||||
crypto_core/salsa208/core_salsa208_api.c \
|
||||
crypto_core/salsa208/ref/api.h \
|
||||
crypto_sign/ed25519/ref10/obsolete.c \
|
||||
crypto_stream/aes128ctr/portable/afternm_aes128ctr.c \
|
||||
crypto_stream/aes128ctr/stream_aes128ctr_api.c \
|
||||
@@ -255,11 +248,9 @@ libsodium_la_SOURCES += \
|
||||
crypto_stream/aes128ctr/portable/types.h \
|
||||
crypto_stream/aes128ctr/portable/xor_afternm_aes128ctr.c \
|
||||
crypto_stream/salsa2012/stream_salsa2012_api.c \
|
||||
crypto_stream/salsa2012/ref/api.h \
|
||||
crypto_stream/salsa2012/ref/stream_salsa2012.c \
|
||||
crypto_stream/salsa2012/ref/xor_salsa2012.c \
|
||||
crypto_stream/salsa208/stream_salsa208_api.c \
|
||||
crypto_stream/salsa208/ref/api.h \
|
||||
crypto_stream/salsa208/ref/stream_salsa208.c \
|
||||
crypto_stream/salsa208/ref/xor_salsa208.c
|
||||
endif
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
|
||||
#include "crypto_core_hsalsa20.h"
|
||||
|
||||
#define crypto_core crypto_core_hsalsa20
|
||||
#define crypto_core_OUTPUTBYTES crypto_core_hsalsa20_OUTPUTBYTES
|
||||
#define crypto_core_INPUTBYTES crypto_core_hsalsa20_INPUTBYTES
|
||||
#define crypto_core_KEYBYTES crypto_core_hsalsa20_KEYBYTES
|
||||
#define crypto_core_CONSTBYTES crypto_core_hsalsa20_CONSTBYTES
|
||||
#define crypto_core_IMPLEMENTATION crypto_core_hsalsa20_IMPLEMENTATION
|
||||
#define crypto_core_VERSION crypto_core_hsalsa20_VERSION
|
||||
@@ -4,7 +4,7 @@ D. J. Bernstein
|
||||
Public domain.
|
||||
*/
|
||||
|
||||
#include "api.h"
|
||||
#include "crypto_core_hsalsa20.h"
|
||||
|
||||
#define ROUNDS 20
|
||||
|
||||
@@ -33,7 +33,7 @@ static void store_littleendian(unsigned char *x,uint32 u)
|
||||
x[3] = u;
|
||||
}
|
||||
|
||||
int crypto_core(
|
||||
int crypto_core_hsalsa20(
|
||||
unsigned char *out,
|
||||
const unsigned char *in,
|
||||
const unsigned char *k,
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
|
||||
#include "crypto_core_salsa20.h"
|
||||
|
||||
#define crypto_core crypto_core_salsa20
|
||||
#define crypto_core_OUTPUTBYTES crypto_core_salsa20_OUTPUTBYTES
|
||||
#define crypto_core_INPUTBYTES crypto_core_salsa20_INPUTBYTES
|
||||
#define crypto_core_KEYBYTES crypto_core_salsa20_KEYBYTES
|
||||
#define crypto_core_CONSTBYTES crypto_core_salsa20_CONSTBYTES
|
||||
#define crypto_core_IMPLEMENTATION crypto_core_salsa20_IMPLEMENTATION
|
||||
#define crypto_core_VERSION crypto_core_salsa20_VERSION
|
||||
@@ -4,7 +4,7 @@ D. J. Bernstein
|
||||
Public domain.
|
||||
*/
|
||||
|
||||
#include "api.h"
|
||||
#include "crypto_core_salsa20.h"
|
||||
|
||||
#define ROUNDS 20
|
||||
|
||||
@@ -33,7 +33,7 @@ static void store_littleendian(unsigned char *x,uint32 u)
|
||||
x[3] = u;
|
||||
}
|
||||
|
||||
int crypto_core(
|
||||
int crypto_core_salsa20(
|
||||
unsigned char *out,
|
||||
const unsigned char *in,
|
||||
const unsigned char *k,
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
|
||||
#include "crypto_core_salsa2012.h"
|
||||
|
||||
#define crypto_core crypto_core_salsa2012
|
||||
#define crypto_core_OUTPUTBYTES crypto_core_salsa2012_OUTPUTBYTES
|
||||
#define crypto_core_INPUTBYTES crypto_core_salsa2012_INPUTBYTES
|
||||
#define crypto_core_KEYBYTES crypto_core_salsa2012_KEYBYTES
|
||||
#define crypto_core_CONSTBYTES crypto_core_salsa2012_CONSTBYTES
|
||||
#define crypto_core_IMPLEMENTATION crypto_core_salsa2012_IMPLEMENTATION
|
||||
#define crypto_core_VERSION crypto_core_salsa2012_VERSION
|
||||
@@ -4,7 +4,7 @@ D. J. Bernstein
|
||||
Public domain.
|
||||
*/
|
||||
|
||||
#include "api.h"
|
||||
#include "crypto_core_salsa2012.h"
|
||||
|
||||
#define ROUNDS 12
|
||||
|
||||
@@ -33,7 +33,7 @@ static void store_littleendian(unsigned char *x,uint32 u)
|
||||
x[3] = u;
|
||||
}
|
||||
|
||||
int crypto_core(
|
||||
int crypto_core_salsa2012(
|
||||
unsigned char *out,
|
||||
const unsigned char *in,
|
||||
const unsigned char *k,
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
|
||||
#include "crypto_core_salsa208.h"
|
||||
|
||||
#define crypto_core crypto_core_salsa208
|
||||
#define crypto_core_OUTPUTBYTES crypto_core_salsa208_OUTPUTBYTES
|
||||
#define crypto_core_INPUTBYTES crypto_core_salsa208_INPUTBYTES
|
||||
#define crypto_core_KEYBYTES crypto_core_salsa208_KEYBYTES
|
||||
#define crypto_core_CONSTBYTES crypto_core_salsa208_CONSTBYTES
|
||||
#define crypto_core_IMPLEMENTATION crypto_core_salsa208_IMPLEMENTATION
|
||||
#define crypto_core_VERSION crypto_core_salsa208_VERSION
|
||||
@@ -4,7 +4,7 @@ D. J. Bernstein
|
||||
Public domain.
|
||||
*/
|
||||
|
||||
#include "api.h"
|
||||
#include "crypto_core_salsa208.h"
|
||||
|
||||
#define ROUNDS 8
|
||||
|
||||
@@ -33,7 +33,7 @@ static void store_littleendian(unsigned char *x,uint32 u)
|
||||
x[3] = u;
|
||||
}
|
||||
|
||||
int crypto_core(
|
||||
int crypto_core_salsa208(
|
||||
unsigned char *out,
|
||||
const unsigned char *in,
|
||||
const unsigned char *k,
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
#include "crypto_stream_salsa20.h"
|
||||
@@ -1,5 +0,0 @@
|
||||
|
||||
#include "crypto_stream_salsa20.h"
|
||||
|
||||
#define crypto_stream crypto_stream_salsa20
|
||||
#define crypto_stream_xor crypto_stream_salsa20_xor
|
||||
@@ -4,7 +4,6 @@ D. J. Bernstein
|
||||
Public domain.
|
||||
*/
|
||||
|
||||
#include "api.h"
|
||||
#include "crypto_core_salsa20.h"
|
||||
#include "utils.h"
|
||||
|
||||
@@ -16,7 +15,7 @@ static const unsigned char sigma[16] = {
|
||||
'e', 'x', 'p', 'a', 'n', 'd', ' ', '3', '2', '-', 'b', 'y', 't', 'e', ' ', 'k'
|
||||
};
|
||||
|
||||
int crypto_stream(
|
||||
int crypto_stream_salsa20(
|
||||
unsigned char *c,unsigned long long clen,
|
||||
const unsigned char *n,
|
||||
const unsigned char *k
|
||||
|
||||
@@ -6,7 +6,6 @@ Public domain.
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "api.h"
|
||||
#include "crypto_core_salsa20.h"
|
||||
#include "utils.h"
|
||||
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
|
||||
#include "crypto_stream_salsa2012.h"
|
||||
|
||||
#define crypto_stream crypto_stream_salsa2012
|
||||
#define crypto_stream_xor crypto_stream_salsa2012_xor
|
||||
#define crypto_stream_KEYBYTES crypto_stream_salsa2012_KEYBYTES
|
||||
#define crypto_stream_NONCEBYTES crypto_stream_salsa2012_NONCEBYTES
|
||||
#define crypto_stream_IMPLEMENTATION crypto_stream_salsa2012_IMPLEMENTATION
|
||||
#define crypto_stream_VERSION crypto_stream_salsa2012_VERSION
|
||||
|
||||
@@ -4,7 +4,6 @@ D. J. Bernstein
|
||||
Public domain.
|
||||
*/
|
||||
|
||||
#include "api.h"
|
||||
#include "crypto_core_salsa2012.h"
|
||||
#include "utils.h"
|
||||
|
||||
@@ -14,7 +13,7 @@ static const unsigned char sigma[16] = {
|
||||
'e', 'x', 'p', 'a', 'n', 'd', ' ', '3', '2', '-', 'b', 'y', 't', 'e', ' ', 'k'
|
||||
};
|
||||
|
||||
int crypto_stream(
|
||||
int crypto_stream_salsa2012(
|
||||
unsigned char *c,unsigned long long clen,
|
||||
const unsigned char *n,
|
||||
const unsigned char *k
|
||||
|
||||
@@ -4,7 +4,6 @@ D. J. Bernstein
|
||||
Public domain.
|
||||
*/
|
||||
|
||||
#include "api.h"
|
||||
#include "crypto_core_salsa2012.h"
|
||||
#include "utils.h"
|
||||
|
||||
@@ -14,7 +13,7 @@ static const unsigned char sigma[16] = {
|
||||
'e', 'x', 'p', 'a', 'n', 'd', ' ', '3', '2', '-', 'b', 'y', 't', 'e', ' ', 'k'
|
||||
};
|
||||
|
||||
int crypto_stream_xor(
|
||||
int crypto_stream_salsa2012_xor(
|
||||
unsigned char *c,
|
||||
const unsigned char *m,unsigned long long mlen,
|
||||
const unsigned char *n,
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
|
||||
#include "crypto_stream_salsa208.h"
|
||||
|
||||
#define crypto_stream crypto_stream_salsa208
|
||||
#define crypto_stream_xor crypto_stream_salsa208_xor
|
||||
#define crypto_stream_KEYBYTES crypto_stream_salsa208_KEYBYTES
|
||||
#define crypto_stream_NONCEBYTES crypto_stream_salsa208_NONCEBYTES
|
||||
#define crypto_stream_IMPLEMENTATION crypto_stream_salsa208_IMPLEMENTATION
|
||||
#define crypto_stream_VERSION crypto_stream_salsa208_VERSION
|
||||
@@ -4,7 +4,6 @@ D. J. Bernstein
|
||||
Public domain.
|
||||
*/
|
||||
|
||||
#include "api.h"
|
||||
#include "crypto_core_salsa208.h"
|
||||
#include "utils.h"
|
||||
|
||||
@@ -14,7 +13,7 @@ static const unsigned char sigma[16] = {
|
||||
'e', 'x', 'p', 'a', 'n', 'd', ' ', '3', '2', '-', 'b', 'y', 't', 'e', ' ', 'k'
|
||||
};
|
||||
|
||||
int crypto_stream(
|
||||
int crypto_stream_salsa208(
|
||||
unsigned char *c,unsigned long long clen,
|
||||
const unsigned char *n,
|
||||
const unsigned char *k
|
||||
|
||||
@@ -4,7 +4,6 @@ D. J. Bernstein
|
||||
Public domain.
|
||||
*/
|
||||
|
||||
#include "api.h"
|
||||
#include "crypto_core_salsa208.h"
|
||||
#include "utils.h"
|
||||
|
||||
@@ -14,7 +13,7 @@ static const unsigned char sigma[16] = {
|
||||
'e', 'x', 'p', 'a', 'n', 'd', ' ', '3', '2', '-', 'b', 'y', 't', 'e', ' ', 'k'
|
||||
};
|
||||
|
||||
int crypto_stream_xor(
|
||||
int crypto_stream_salsa208_xor(
|
||||
unsigned char *c,
|
||||
const unsigned char *m,unsigned long long mlen,
|
||||
const unsigned char *n,
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
|
||||
#include "crypto_stream_xsalsa20.h"
|
||||
|
||||
#define crypto_stream crypto_stream_xsalsa20
|
||||
#define crypto_stream_xor_ic crypto_stream_xsalsa20_xor_ic
|
||||
#define crypto_stream_xor crypto_stream_xsalsa20_xor
|
||||
#define crypto_stream_KEYBYTES crypto_stream_xsalsa20_KEYBYTES
|
||||
#define crypto_stream_NONCEBYTES crypto_stream_xsalsa20_NONCEBYTES
|
||||
#define crypto_stream_IMPLEMENTATION crypto_stream_xsalsa20_IMPLEMENTATION
|
||||
#define crypto_stream_VERSION crypto_stream_xsalsa20_VERSION
|
||||
|
||||
@@ -4,16 +4,16 @@ D. J. Bernstein
|
||||
Public domain.
|
||||
*/
|
||||
|
||||
#include "api.h"
|
||||
#include "crypto_core_hsalsa20.h"
|
||||
#include "crypto_stream_salsa20.h"
|
||||
#include "crypto_stream_xsalsa20.h"
|
||||
#include "utils.h"
|
||||
|
||||
static const unsigned char sigma[16] = {
|
||||
'e', 'x', 'p', 'a', 'n', 'd', ' ', '3', '2', '-', 'b', 'y', 't', 'e', ' ', 'k'
|
||||
};
|
||||
|
||||
int crypto_stream(
|
||||
int crypto_stream_xsalsa20(
|
||||
unsigned char *c,unsigned long long clen,
|
||||
const unsigned char *n,
|
||||
const unsigned char *k
|
||||
|
||||
@@ -4,16 +4,16 @@ D. J. Bernstein
|
||||
Public domain.
|
||||
*/
|
||||
|
||||
#include "api.h"
|
||||
#include "crypto_core_hsalsa20.h"
|
||||
#include "crypto_stream_salsa20.h"
|
||||
#include "crypto_stream_xsalsa20.h"
|
||||
#include "utils.h"
|
||||
|
||||
static const unsigned char sigma[16] = {
|
||||
'e', 'x', 'p', 'a', 'n', 'd', ' ', '3', '2', '-', 'b', 'y', 't', 'e', ' ', 'k'
|
||||
};
|
||||
|
||||
int crypto_stream_xor_ic(
|
||||
int crypto_stream_xsalsa20_xor_ic(
|
||||
unsigned char *c,
|
||||
const unsigned char *m,unsigned long long mlen,
|
||||
const unsigned char *n,uint64_t ic,
|
||||
@@ -28,12 +28,12 @@ int crypto_stream_xor_ic(
|
||||
return ret;
|
||||
}
|
||||
|
||||
int crypto_stream_xor(
|
||||
int crypto_stream_xsalsa20_xor(
|
||||
unsigned char *c,
|
||||
const unsigned char *m,unsigned long long mlen,
|
||||
const unsigned char *n,
|
||||
const unsigned char *k
|
||||
)
|
||||
{
|
||||
return crypto_stream_xor_ic(c, m, mlen, n, 0ULL, k);
|
||||
return crypto_stream_xsalsa20_xor_ic(c, m, mlen, n, 0ULL, k);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user