mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
parent
bec03de2ba
commit
8f1dbaa2c5
|
@ -338,8 +338,8 @@ START_TEST(test_memzero)
|
|||
}
|
||||
END_TEST
|
||||
|
||||
#define CRYPTO_TEST_MEMCMP_SIZE 1024*32
|
||||
#define CRYPTO_TEST_MEMCMP_COUNT 500
|
||||
#define CRYPTO_TEST_MEMCMP_SIZE 1024*256
|
||||
#define CRYPTO_TEST_MEMCMP_COUNT 1000
|
||||
#define CRYPTO_TEST_MEMCMP_EPS 10
|
||||
|
||||
static int cmp(const void *a, const void *b)
|
||||
|
@ -389,8 +389,11 @@ START_TEST(test_memcmp)
|
|||
uint8_t not_same[sizeof(src)];
|
||||
rand_bytes(not_same, sizeof(not_same));
|
||||
|
||||
printf("timing memcmp (equal arrays)\n");
|
||||
clock_t same_median = memcmp_median(src, same, sizeof(src));
|
||||
printf("timing memcmp (non-equal arrays)\n");
|
||||
clock_t not_same_median = memcmp_median(src, not_same, sizeof(src));
|
||||
printf("comparing times\n");
|
||||
|
||||
clock_t delta;
|
||||
|
||||
|
|
|
@ -1,3 +1,14 @@
|
|||
#!/bin/sh
|
||||
|
||||
. other/travis/toxcore-linux-install
|
||||
|
||||
# Also install vanilla NaCl
|
||||
[ -f $CACHE_DIR/lib/amd64/libnacl.a ] || {
|
||||
curl https://hyperelliptic.org/nacl/nacl-20110221.tar.bz2 | tar -jxf
|
||||
cd nacl-20110221 # pushd
|
||||
"./do"
|
||||
# "make install"
|
||||
mv build/*/include/* $CACHE_DIR/include
|
||||
mv build/*/lib/* $CACHE_DIR/lib
|
||||
cd - # popd
|
||||
}
|
||||
|
|
|
@ -3,8 +3,9 @@
|
|||
# Build toxcore and run tests.
|
||||
./autogen.sh
|
||||
./configure \
|
||||
--with-libsodium-libs=$CACHE_DIR/lib \
|
||||
--with-libsodium-headers=$CACHE_DIR/include \
|
||||
--with-nacl-libs=$CACHE_DIR/lib/amd64 \
|
||||
--with-nacl-headers=$CACHE_DIR/include/amd64 \
|
||||
--enable-nacl \
|
||||
--enable-daemon \
|
||||
--enable-logging \
|
||||
--enable-ntox \
|
||||
|
|
|
@ -31,8 +31,10 @@
|
|||
#define SET_ERROR_PARAMETER(param, x) {if(param) {*param = x;}}
|
||||
|
||||
#ifdef VANILLA_NACL
|
||||
#include <crypto_box.h>
|
||||
#include <crypto_hash_sha256.h>
|
||||
#include "crypto_pwhash_scryptsalsa208sha256/crypto_pwhash_scryptsalsa208sha256.h"
|
||||
#define crypto_box_MACBYTES (crypto_box_ZEROBYTES - crypto_box_BOXZEROBYTES)
|
||||
#else
|
||||
#include <sodium.h>
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue
Block a user