diff options
author | MITSUNARI Shigeo <herumi@nifty.com> | 2017-07-11 13:25:23 +0800 |
---|---|---|
committer | MITSUNARI Shigeo <herumi@nifty.com> | 2017-07-11 13:25:23 +0800 |
commit | e04617b91c3a9c08c3ab9a0a84ee2525128d387c (patch) | |
tree | 0f7ffb4b8da3745e6ab3a9ff4147846af954009b | |
parent | 9b8765240be0f52e065c825d93ea043a16c22816 (diff) | |
download | dexon-mcl-e04617b91c3a9c08c3ab9a0a84ee2525128d387c.tar.gz dexon-mcl-e04617b91c3a9c08c3ab9a0a84ee2525128d387c.tar.zst dexon-mcl-e04617b91c3a9c08c3ab9a0a84ee2525128d387c.zip |
add error message
-rw-r--r-- | include/mcl/util.hpp | 1 | ||||
-rw-r--r-- | src/bn_c_impl.hpp | 6 | ||||
-rw-r--r-- | test/fp_util_test.cpp | 1 |
3 files changed, 7 insertions, 1 deletions
diff --git a/include/mcl/util.hpp b/include/mcl/util.hpp index 8b33599..eb16bb4 100644 --- a/include/mcl/util.hpp +++ b/include/mcl/util.hpp @@ -6,7 +6,6 @@ @license modified new BSD license http://opensource.org/licenses/BSD-3-Clause */ -#include <mcl/gmp_util.hpp> #include <cybozu/bit_operation.hpp> #ifdef _MSC_VER diff --git a/src/bn_c_impl.hpp b/src/bn_c_impl.hpp index 84f1900..fc8f499 100644 --- a/src/bn_c_impl.hpp +++ b/src/bn_c_impl.hpp @@ -534,6 +534,7 @@ int mclBn_FrLagrangeInterpolation(mclBnFr *out, const mclBnFr *xVec, const mclBn mcl::LagrangeInterpolation(*cast(out), cast(xVec), cast(yVec), k); return 0; } catch (std::exception& e) { + if (g_fp) fprintf(g_fp, "mclBn_FrLagrangeInterpolation %s\n", e.what()); return -1; } int mclBn_G1LagrangeInterpolation(mclBnG1 *out, const mclBnFr *xVec, const mclBnG1 *yVec, size_t k) @@ -542,6 +543,7 @@ int mclBn_G1LagrangeInterpolation(mclBnG1 *out, const mclBnFr *xVec, const mclBn mcl::LagrangeInterpolation(*cast(out), cast(xVec), cast(yVec), k); return 0; } catch (std::exception& e) { + if (g_fp) fprintf(g_fp, "mclBn_G1LagrangeInterpolation %s\n", e.what()); return -1; } int mclBn_G2LagrangeInterpolation(mclBnG2 *out, const mclBnFr *xVec, const mclBnG2 *yVec, size_t k) @@ -550,6 +552,7 @@ int mclBn_G2LagrangeInterpolation(mclBnG2 *out, const mclBnFr *xVec, const mclBn mcl::LagrangeInterpolation(*cast(out), cast(xVec), cast(yVec), k); return 0; } catch (std::exception& e) { + if (g_fp) fprintf(g_fp, "mclBn_G2LagrangeInterpolation %s\n", e.what()); return -1; } int mclBn_FrEvaluatePolynomial(mclBnFr *out, const mclBnFr *cVec, size_t cSize, const mclBnFr *x) @@ -558,6 +561,7 @@ int mclBn_FrEvaluatePolynomial(mclBnFr *out, const mclBnFr *cVec, size_t cSize, mcl::evaluatePolynomial(*cast(out), cast(cVec), cSize, *cast(x)); return 0; } catch (std::exception& e) { + if (g_fp) fprintf(g_fp, "mclBn_FrEvaluatePolynomial %s\n", e.what()); return -1; } int mclBn_G1EvaluatePolynomial(mclBnG1 *out, const mclBnG1 *cVec, size_t cSize, const mclBnFr *x) @@ -566,6 +570,7 @@ int mclBn_G1EvaluatePolynomial(mclBnG1 *out, const mclBnG1 *cVec, size_t cSize, mcl::evaluatePolynomial(*cast(out), cast(cVec), cSize, *cast(x)); return 0; } catch (std::exception& e) { + if (g_fp) fprintf(g_fp, "mclBn_G1EvaluatePolynomial %s\n", e.what()); return -1; } int mclBn_G2EvaluatePolynomial(mclBnG2 *out, const mclBnG2 *cVec, size_t cSize, const mclBnFr *x) @@ -574,5 +579,6 @@ int mclBn_G2EvaluatePolynomial(mclBnG2 *out, const mclBnG2 *cVec, size_t cSize, mcl::evaluatePolynomial(*cast(out), cast(cVec), cSize, *cast(x)); return 0; } catch (std::exception& e) { + if (g_fp) fprintf(g_fp, "mclBn_G2EvaluatePolynomial %s\n", e.what()); return -1; } diff --git a/test/fp_util_test.cpp b/test/fp_util_test.cpp index e476ccf..cb4fb4f 100644 --- a/test/fp_util_test.cpp +++ b/test/fp_util_test.cpp @@ -1,6 +1,7 @@ #define PUT(x) std::cout << #x "=" << (x) << std::endl #include "../src/conversion.hpp" #include <cybozu/test.hpp> +#include <mcl/gmp_util.hpp> CYBOZU_TEST_AUTO(toStr16) { |