From 28e75eebf3309ad4f582700aeef40ea4c4ef554a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Ates?= Date: Tue, 1 Feb 2011 10:28:01 +0100 Subject: [PATCH] Cleaning. --- cryptic/protocols/clsig/clsig_vrf.c | 16 +++++++++------- cryptic/utils.h | 1 - 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/cryptic/protocols/clsig/clsig_vrf.c b/cryptic/protocols/clsig/clsig_vrf.c index 138fc23..7eb6972 100755 --- a/cryptic/protocols/clsig/clsig_vrf.c +++ b/cryptic/protocols/clsig/clsig_vrf.c @@ -272,9 +272,10 @@ cryptic_clsig_load_certificate_with_committed_value(CrypticClsig *clsig, goto_cleanup_if_fail_with_rc_with_warning_openssl(BN_add(clsig->v,clsig->v,vprime)); - cryptic_check_good_rc(cryptic_clsig_verify_signature_not_randomized(clsig)); - - rc = CRYPTIC_NO_ERROR; + rc = cryptic_clsig_verify_signature_not_randomized(clsig); + if(rc == 1){ + rc = CRYPTIC_NO_ERROR; + } cleanup: cryptic_release_ctx(ctx); cryptic_release_bn(tmp); @@ -344,7 +345,7 @@ cryptic_clsig_load_certificate_with_index_with_committed_value(CrypticClsig *cls /* commitment = committed_dlrep * S^vprime */ /* commitment * S^-vprime = committed_dlrep */ /* clsig->dlrep := clsig->dlrep * committed_dlrep */ - /* clsig->v := clsig->v + vprime */ + /* clsig->v := clsig->v + vprime */ goto_cleanup_if_fail_with_rc_with_warning_openssl(BN_mod_inverse(tmp,clsig->S,clsig->modulus,ctx)); goto_cleanup_if_fail_with_rc_with_warning_openssl(BN_mod_exp(tmp,tmp,vprime,clsig->modulus,ctx) == 1); goto_cleanup_if_fail_with_rc_with_warning_openssl(BN_mod_mul(tmp,tmp,commitment,clsig->modulus,ctx) == 1); @@ -360,9 +361,10 @@ cryptic_clsig_load_certificate_with_index_with_committed_value(CrypticClsig *cls goto_cleanup_if_fail_with_rc_with_warning_openssl(BN_add(clsig->v,clsig->v,vprime)); - cryptic_check_good_rc(cryptic_clsig_verify_signature_not_randomized(clsig)); - - rc = CRYPTIC_NO_ERROR; + rc = cryptic_clsig_verify_signature_not_randomized(clsig); + if(rc == 1){ + rc = CRYPTIC_NO_ERROR; + } cleanup: cryptic_release_ctx(ctx); cryptic_release_bn(tmp); diff --git a/cryptic/utils.h b/cryptic/utils.h index b59e61c..3fae426 100644 --- a/cryptic/utils.h +++ b/cryptic/utils.h @@ -1,4 +1,3 @@ - /* Cryptic -- Cryptographic tools and protocols * Copyright (C) 2009 Mikaƫl Ates *