From 830679e5a44065cb402322c43d4821da0b42330f Mon Sep 17 00:00:00 2001 From: Max Lv Date: Mon, 20 Feb 2017 16:22:46 +0800 Subject: [PATCH] Refine the parameters of bloom filter --- src/crypto.c | 4 ++-- src/crypto.h | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/crypto.c b/src/crypto.c index ba8f433d..58e583d0 100644 --- a/src/crypto.c +++ b/src/crypto.c @@ -111,9 +111,9 @@ crypto_init(const char *password, const char *key, const char *method) // Initialize NONCE bloom filter #ifdef MODULE_REMOTE - ppbloom_init(NUM_NONCE_ENTRIES_FOR_SERVER, ERROR_RATE_FOR_SERVER); + ppbloom_init(BF_NUM_ENTRIES_FOR_SERVER, BF_ERROR_RATE_FOR_SERVER); #else - ppbloom_init(NUM_NONCE_ENTRIES_FOR_CLIENT, ERROR_RATE_FOR_CLIENT); + ppbloom_init(BF_NUM_ENTRIES_FOR_CLIENT, BF_ERROR_RATE_FOR_CLIENT); #endif if (method != NULL) { diff --git a/src/crypto.h b/src/crypto.h index 06ae7b79..e3c1f63a 100644 --- a/src/crypto.h +++ b/src/crypto.h @@ -66,20 +66,20 @@ typedef mbedtls_md_info_t digest_type_t; #define SUBKEY_INFO "ss-subkey" #define IV_INFO "ss-iv" -#ifndef NUM_NONCE_ENTRIES_FOR_CLIENT -#define NUM_NONCE_ENTRIES_FOR_SERVER 1e6 +#ifndef BF_NUM_ENTRIES_FOR_SERVER +#define BF_NUM_ENTRIES_FOR_SERVER 1e6 #endif -#ifndef NUM_NONCE_ENTRIES_FOR_CLIENT -#define NUM_NONCE_ENTRIES_FOR_CLIENT 1e4 +#ifndef BF_NUM_ENTRIES_FOR_CLIENT +#define BF_NUM_ENTRIES_FOR_CLIENT 1e4 #endif -#ifndef ERROR_RATE_FOR_SERVER -#define ERROR_RATE_FOR_SERVER 1e-6 +#ifndef BF_ERROR_RATE_FOR_SERVER +#define BF_ERROR_RATE_FOR_SERVER 1e-6 #endif -#ifndef ERROR_RATE_FOR_CLIENT -#define ERROR_RATE_FOR_CLIENT 1e-15 +#ifndef BF_ERROR_RATE_FOR_CLIENT +#define BF_ERROR_RATE_FOR_CLIENT 1e-15 #endif typedef struct buffer {