aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMITSUNARI Shigeo <herumi@nifty.com>2017-05-31 19:18:23 +0800
committerMITSUNARI Shigeo <herumi@nifty.com>2017-05-31 19:18:23 +0800
commitab79d0e270196c9e1f0aa5bceab74a528c04b380 (patch)
tree4fa2aee3fc4ef33ae688a0ce74a94ac985c45c7a /include
parentd480d44fc0ef00324b2ec7e71510552924757dd8 (diff)
downloadtangerine-mcl-ab79d0e270196c9e1f0aa5bceab74a528c04b380.tar.gz
tangerine-mcl-ab79d0e270196c9e1f0aa5bceab74a528c04b380.tar.zst
tangerine-mcl-ab79d0e270196c9e1f0aa5bceab74a528c04b380.zip
add bufSize for SetStr functions
Diffstat (limited to 'include')
-rw-r--r--include/mcl/bn_if.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/include/mcl/bn_if.h b/include/mcl/bn_if.h
index 948910c..b03e5f7 100644
--- a/include/mcl/bn_if.h
+++ b/include/mcl/bn_if.h
@@ -95,8 +95,8 @@ BN_DLL_API void BN_Fr_clear(BN_Fr *x);
BN_DLL_API void BN_Fr_setInt(BN_Fr *y, int x);
// return 0 if success
-BN_DLL_API int BN_Fr_setDecStr(BN_Fr *x, const char *s);
-BN_DLL_API int BN_Fr_setHexStr(BN_Fr *x, const char *s);
+BN_DLL_API int BN_Fr_setDecStr(BN_Fr *x, const char *buf, size_t bufSize);
+BN_DLL_API int BN_Fr_setHexStr(BN_Fr *x, const char *buf, size_t bufSize);
// mask buf with (1 << (bitLen(r) - 1)) - 1 if buf >= r
BN_DLL_API int BN_Fr_setLittleEndian(BN_Fr *x, const void *buf, size_t bufSize);
@@ -129,7 +129,7 @@ BN_DLL_API void BN_Fr_div(BN_Fr *z, const BN_Fr *x, const BN_Fr *y);
BN_DLL_API void BN_G1_clear(BN_G1 *x);
// return 0 if success
-BN_DLL_API int BN_G1_setHexStr(BN_G1 *x, const char *s);
+BN_DLL_API int BN_G1_setHexStr(BN_G1 *x, const char *buf, size_t bufSize);
BN_DLL_API int BN_G1_deserialize(BN_G1 *x, const char *buf, size_t bufSize);
// return 1 if true and 0 otherwise
@@ -155,7 +155,7 @@ BN_DLL_API void BN_G1_mul(BN_G1 *z, const BN_G1 *x, const BN_Fr *y);
BN_DLL_API void BN_G2_clear(BN_G2 *x);
// return 0 if success
-BN_DLL_API int BN_G2_setHexStr(BN_G2 *x, const char *s);
+BN_DLL_API int BN_G2_setHexStr(BN_G2 *x, const char *buf, size_t bufSize);
BN_DLL_API int BN_G2_deserialize(BN_G2 *x, const char *buf, size_t bufSize);
// return 1 if true and 0 otherwise
@@ -181,8 +181,8 @@ BN_DLL_API void BN_G2_mul(BN_G2 *z, const BN_G2 *x, const BN_Fr *y);
BN_DLL_API void BN_GT_clear(BN_GT *x);
// return 0 if success
-BN_DLL_API int BN_GT_setDecStr(BN_GT *x, const char *s);
-BN_DLL_API int BN_GT_setHexStr(BN_GT *x, const char *s);
+BN_DLL_API int BN_GT_setDecStr(BN_GT *x, const char *buf, size_t bufSize);
+BN_DLL_API int BN_GT_setHexStr(BN_GT *x, const char *buf, size_t bufSize);
BN_DLL_API int BN_GT_deserialize(BN_GT *x, const char *buf, size_t bufSize);
// return 1 if true and 0 otherwise