From 29c4bbf4fea75ff4fd904c2caaed5b033c0726be Mon Sep 17 00:00:00 2001 From: "Dmitriy A. Gerasimov" <dmitriy.gerasimov@demlabs.net> Date: Mon, 7 Jan 2019 15:37:50 +0700 Subject: [PATCH] [*] Fixes with LOG_TAG --- crypto/dap_enc_bliss.c | 1 + crypto/dap_enc_bliss.h | 8 +------- crypto/dap_enc_picnic.c | 4 +++- crypto/dap_enc_picnic.h | 32 +++++++++++++++++++++++++------- crypto/dap_enc_tesla.c | 2 ++ crypto/dap_enc_tesla.h | 2 -- test/libdap-test | 2 +- 7 files changed, 33 insertions(+), 18 deletions(-) diff --git a/crypto/dap_enc_bliss.c b/crypto/dap_enc_bliss.c index e7a1e0c..4610d36 100644 --- a/crypto/dap_enc_bliss.c +++ b/crypto/dap_enc_bliss.c @@ -5,6 +5,7 @@ #include "dap_enc_bliss.h" #include "dap_common.h" #include "dap_rand.h" +#define LOG_TAG "dap_enc_sig_bliss" static enum DAP_BLISS_SIGN_SECURITY _bliss_type = MAX_SECURITY; // by default diff --git a/crypto/dap_enc_bliss.h b/crypto/dap_enc_bliss.h index 9b4d031..73f2f25 100644 --- a/crypto/dap_enc_bliss.h +++ b/crypto/dap_enc_bliss.h @@ -1,12 +1,8 @@ - -#ifndef _DAP_ENC_BLISS_H_ -#define _DAP_ENC_BLISS_H_ +#pragma once #include "sig_bliss/bliss_b_params.h" #include "dap_enc_key.h" -#undef LOG_TAG -#define LOG_TAG "dap_enc_sig_bliss" enum DAP_BLISS_SIGN_SECURITY { TOY = 0, MAX_SPEED, MIN_SIZE, SPEED_AND_SECURITY, MAX_SECURITY @@ -28,5 +24,3 @@ size_t dap_enc_sig_bliss_verify_sign(struct dap_enc_key * key,const void * msg, void dap_enc_sig_bliss_key_delete(struct dap_enc_key *key); - -#endif diff --git a/crypto/dap_enc_picnic.c b/crypto/dap_enc_picnic.c index 902b124..b13116d 100755 --- a/crypto/dap_enc_picnic.c +++ b/crypto/dap_enc_picnic.c @@ -8,6 +8,8 @@ #include "picnic.h" #include "picnic_impl.h" +#define LOG_TAG "dap_enc_picnic_sig" + /** * Set the mark that valid keys are present */ @@ -74,7 +76,7 @@ void dap_enc_sig_picnic_key_new_generate(struct dap_enc_key * key, const void *k if(seed_size >= sizeof(unsigned char) && seed) parameters = (((unsigned char*) seed)[0] % (PARAMETER_SET_MAX_INDEX - 1)) + 1; else - parameters = DAP_PICNIC_SIGN_PARAMETR + parameters = DAP_PICNIC_SIGN_PARAMETR; key->priv_key_data_size = sizeof(picnic_privatekey_t); key->pub_key_data_size = sizeof(picnic_publickey_t); diff --git a/crypto/dap_enc_picnic.h b/crypto/dap_enc_picnic.h index 4b3522a..7338b6a 100755 --- a/crypto/dap_enc_picnic.h +++ b/crypto/dap_enc_picnic.h @@ -1,5 +1,27 @@ -#ifndef _DAP_ENC_PICNIC_H_ -#define _DAP_ENC_PICNIC_H_ +/* + * Authors: + * Dmitriy Gearasimov <gerasimov.dmitriy@demlabs.net> + * Anatoly Kurotych <anatoly.kurotych@demlabs.net> + * DeM Labs Inc. https://demlabs.net + * Copyright (c) 2019 + * All rights reserved. + + This file is part of DAP (Deus Applications Prototypes) the open source project + + DAP (Deus Applicaions Prototypes) is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + DAP is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with any DAP based project. If not, see <http://www.gnu.org/licenses/>. +*/ +#pragma once #ifdef __cplusplus extern "C" { @@ -8,10 +30,8 @@ extern "C" { //#include "../sig_picnic/picnic.h" #include "dap_enc_key.h" -#undef LOG_TAG -#define LOG_TAG "dap_enc_picnic_sig" -#define DAP_PICNIC_SIGN_PARAMETR 1;//determination of the scheme and level of resistance {1-6} +#define DAP_PICNIC_SIGN_PARAMETR 1//determination of the scheme and level of resistance {1-6} void dap_enc_sig_picnic_key_new(struct dap_enc_key *key); @@ -33,5 +53,3 @@ size_t dap_enc_picnic_calc_signature_size(struct dap_enc_key *key); } #endif -#endif - diff --git a/crypto/dap_enc_tesla.c b/crypto/dap_enc_tesla.c index 4aad699..3e23ed6 100755 --- a/crypto/dap_enc_tesla.c +++ b/crypto/dap_enc_tesla.c @@ -6,6 +6,8 @@ #include "dap_common.h" #include "dap_rand.h" +#define LOG_TAG "dap_enc_sig_tesla" + static enum DAP_TESLA_SIGN_SECURITY _tesla_type = HEURISTIC_MAX_SECURITY_AND_MAX_SPEED; // by default void dap_enc_sig_tesla_set_type(enum DAP_TESLA_SIGN_SECURITY type) diff --git a/crypto/dap_enc_tesla.h b/crypto/dap_enc_tesla.h index 50c9f03..a3e4c19 100755 --- a/crypto/dap_enc_tesla.h +++ b/crypto/dap_enc_tesla.h @@ -4,8 +4,6 @@ #include "sig_tesla/tesla_params.h" #include "dap_enc_key.h" -#undef LOG_TAG -#define LOG_TAG "dap_enc_sig_tesla" enum DAP_TESLA_SIGN_SECURITY { TESLA_TOY = 0, HEURISTIC_MAX_SECURITY_AND_MIN_SIZE, HEURISTIC_MAX_SECURITY_AND_MAX_SPEED, PROVABLY_SECURITY, PROVABLY_MAX_SECURITY diff --git a/test/libdap-test b/test/libdap-test index d40ba89..7b40a4c 160000 --- a/test/libdap-test +++ b/test/libdap-test @@ -1 +1 @@ -Subproject commit d40ba8973440b7c712d5a64df03a312adcf7c2fd +Subproject commit 7b40a4cdfae222f84ccedb11ecae471d01f5e33b -- GitLab