diff options
author | MITSUNARI Shigeo <herumi@nifty.com> | 2017-06-13 04:37:10 +0800 |
---|---|---|
committer | MITSUNARI Shigeo <herumi@nifty.com> | 2017-06-13 04:37:10 +0800 |
commit | eb273023ea16d139ba227662d8c29adf20bb23af (patch) | |
tree | a9aaf17deb328bd0e09331f2c3e699b2c9cc3880 /include/bls/bls.h | |
parent | 8960a3bfc70931637b79ec53ab5645f56cc7d1a3 (diff) | |
download | dexon-bls-eb273023ea16d139ba227662d8c29adf20bb23af.tar dexon-bls-eb273023ea16d139ba227662d8c29adf20bb23af.tar.gz dexon-bls-eb273023ea16d139ba227662d8c29adf20bb23af.tar.bz2 dexon-bls-eb273023ea16d139ba227662d8c29adf20bb23af.tar.lz dexon-bls-eb273023ea16d139ba227662d8c29adf20bb23af.tar.xz dexon-bls-eb273023ea16d139ba227662d8c29adf20bb23af.tar.zst dexon-bls-eb273023ea16d139ba227662d8c29adf20bb23af.zip |
end of refactoring
Diffstat (limited to 'include/bls/bls.h')
-rw-r--r-- | include/bls/bls.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/include/bls/bls.h b/include/bls/bls.h index ef5f24f..e15a82b 100644 --- a/include/bls/bls.h +++ b/include/bls/bls.h @@ -118,17 +118,28 @@ BLS_DLL_API int blsSignatureRecover(blsSignature *sig, const blsSignature *sigVe BLS_DLL_API void blsSign(blsSignature *sig, const blsSecretKey *sec, const char *m, size_t size); // return 1 if valid -BLS_DLL_API int blsVerify(const blsSignature *sig, const blsPublicKey *pub, const char *m, size_t size); +BLS_DLL_API int blsVerify(const blsSignature *sig, const blsPublicKey *pub, const void *m, size_t size); BLS_DLL_API int blsVerifyPop(const blsSignature *sig, const blsPublicKey *pub); /* + Lagrange interpolation recover out = y(0) by { (xVec[i], yVec[i]) } return 0 if success else -1 + @note k >= 2, xVec[i] != 0, xVec[i] != xVec[j] for i != j */ BLS_DLL_API int mclBn_FrLagrangeInterpolation(mclBnFr *out, const mclBnFr *yVec, const mclBnFr *xVec, size_t k); BLS_DLL_API int mclBn_G1LagrangeInterpolation(mclBnG1 *out, const mclBnG1 *yVec, const mclBnFr *xVec, size_t k); BLS_DLL_API int mclBn_G2LagrangeInterpolation(mclBnG2 *out, const mclBnG2 *yVec, const mclBnFr *xVec, size_t k); +/* + evaluate polynomial + out = f(x) = c[0] + c[1] * x + c[2] * x^2 + ... + c[cSize - 1] * x^(cSize - 1) + @note cSize >= 2 +*/ +BLS_DLL_API int mclBn_FrEvaluatePolynomial(mclBnFr *out, const mclBnFr *cVec, size_t cSize, const mclBnFr *x); +BLS_DLL_API int mclBn_G1EvaluatePolynomial(mclBnG1 *out, const mclBnG1 *cVec, size_t cSize, const mclBnFr *x); +BLS_DLL_API int mclBn_G2EvaluatePolynomial(mclBnG2 *out, const mclBnG2 *cVec, size_t cSize, const mclBnFr *x); + ////////////////////////////////////////////////////////////////////////// // the following apis will be removed |