diff --git a/include/mcl/she.hpp b/include/mcl/she.hpp index ccfcaf81..bd66058b 100644 --- a/include/mcl/she.hpp +++ b/include/mcl/she.hpp @@ -832,7 +832,7 @@ struct SHET { #endif int64_t dec(const CipherTextG1& c, bool *pok = 0) const { - if (useDecG1ViaGT_) return decViaGT(c); + if (useDecG1ViaGT_) return decViaGT(c, pok); /* S = mP + rxP T = rP @@ -845,7 +845,7 @@ struct SHET { } int64_t dec(const CipherTextG2& c, bool *pok = 0) const { - if (useDecG2ViaGT_) return decViaGT(c); + if (useDecG2ViaGT_) return decViaGT(c, pok); G2 R; G2::mul(R, c.T_, y_); G2::sub(R, c.S_, R); diff --git a/src/she_c_impl.hpp b/src/she_c_impl.hpp index d07dcfcd..9f9fa707 100644 --- a/src/she_c_impl.hpp +++ b/src/she_c_impl.hpp @@ -440,12 +440,10 @@ int shePrecomputedPublicKeyEncWithZkpBinEq(sheCipherTextG1 *c1, sheCipherTextG2 template int decT(mclInt *m, const sheSecretKey *sec, const CT *c) - try { - *m = (cast(sec)->dec)(*cast(c)); - return 0; -} catch (std::exception&) { - return -1; + bool b; + *m = (cast(sec)->dec)(*cast(c), &b); + return b ? 0 : -1; } int sheDecG1(mclInt *m, const sheSecretKey *sec, const sheCipherTextG1 *c)