summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--auto_tests/crypto_test.c7
-rw-r--r--other/travis/autotools-linux-install11
-rwxr-xr-xother/travis/autotools-script5
-rw-r--r--toxencryptsave/toxencryptsave.c2
4 files changed, 21 insertions, 4 deletions
diff --git a/auto_tests/crypto_test.c b/auto_tests/crypto_test.c
index 57a2a43b..7c5338e2 100644
--- a/auto_tests/crypto_test.c
+++ b/auto_tests/crypto_test.c
@@ -338,8 +338,8 @@ START_TEST(test_memzero)
338} 338}
339END_TEST 339END_TEST
340 340
341#define CRYPTO_TEST_MEMCMP_SIZE 1024*32 341#define CRYPTO_TEST_MEMCMP_SIZE 1024*256
342#define CRYPTO_TEST_MEMCMP_COUNT 500 342#define CRYPTO_TEST_MEMCMP_COUNT 1000
343#define CRYPTO_TEST_MEMCMP_EPS 10 343#define CRYPTO_TEST_MEMCMP_EPS 10
344 344
345static int cmp(const void *a, const void *b) 345static int cmp(const void *a, const void *b)
@@ -389,8 +389,11 @@ START_TEST(test_memcmp)
389 uint8_t not_same[sizeof(src)]; 389 uint8_t not_same[sizeof(src)];
390 rand_bytes(not_same, sizeof(not_same)); 390 rand_bytes(not_same, sizeof(not_same));
391 391
392 printf("timing memcmp (equal arrays)\n");
392 clock_t same_median = memcmp_median(src, same, sizeof(src)); 393 clock_t same_median = memcmp_median(src, same, sizeof(src));
394 printf("timing memcmp (non-equal arrays)\n");
393 clock_t not_same_median = memcmp_median(src, not_same, sizeof(src)); 395 clock_t not_same_median = memcmp_median(src, not_same, sizeof(src));
396 printf("comparing times\n");
394 397
395 clock_t delta; 398 clock_t delta;
396 399
diff --git a/other/travis/autotools-linux-install b/other/travis/autotools-linux-install
index edc6a2dc..8633075f 100644
--- a/other/travis/autotools-linux-install
+++ b/other/travis/autotools-linux-install
@@ -1,3 +1,14 @@
1#!/bin/sh 1#!/bin/sh
2 2
3. other/travis/toxcore-linux-install 3. other/travis/toxcore-linux-install
4
5# Also install vanilla NaCl
6[ -f $CACHE_DIR/lib/amd64/libnacl.a ] || {
7 curl https://hyperelliptic.org/nacl/nacl-20110221.tar.bz2 | tar -jxf
8 cd nacl-20110221 # pushd
9 "./do"
10 # "make install"
11 mv build/*/include/* $CACHE_DIR/include
12 mv build/*/lib/* $CACHE_DIR/lib
13 cd - # popd
14}
diff --git a/other/travis/autotools-script b/other/travis/autotools-script
index 7d04c968..3ab598c0 100755
--- a/other/travis/autotools-script
+++ b/other/travis/autotools-script
@@ -3,8 +3,9 @@
3# Build toxcore and run tests. 3# Build toxcore and run tests.
4./autogen.sh 4./autogen.sh
5./configure \ 5./configure \
6 --with-libsodium-libs=$CACHE_DIR/lib \ 6 --with-nacl-libs=$CACHE_DIR/lib/amd64 \
7 --with-libsodium-headers=$CACHE_DIR/include \ 7 --with-nacl-headers=$CACHE_DIR/include/amd64 \
8 --enable-nacl \
8 --enable-daemon \ 9 --enable-daemon \
9 --enable-logging \ 10 --enable-logging \
10 --enable-ntox \ 11 --enable-ntox \
diff --git a/toxencryptsave/toxencryptsave.c b/toxencryptsave/toxencryptsave.c
index bd56e780..0c799bfb 100644
--- a/toxencryptsave/toxencryptsave.c
+++ b/toxencryptsave/toxencryptsave.c
@@ -31,8 +31,10 @@
31#define SET_ERROR_PARAMETER(param, x) {if(param) {*param = x;}} 31#define SET_ERROR_PARAMETER(param, x) {if(param) {*param = x;}}
32 32
33#ifdef VANILLA_NACL 33#ifdef VANILLA_NACL
34#include <crypto_box.h>
34#include <crypto_hash_sha256.h> 35#include <crypto_hash_sha256.h>
35#include "crypto_pwhash_scryptsalsa208sha256/crypto_pwhash_scryptsalsa208sha256.h" 36#include "crypto_pwhash_scryptsalsa208sha256/crypto_pwhash_scryptsalsa208sha256.h"
37#define crypto_box_MACBYTES (crypto_box_ZEROBYTES - crypto_box_BOXZEROBYTES)
36#else 38#else
37#include <sodium.h> 39#include <sodium.h>
38#endif 40#endif