aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMITSUNARI Shigeo <herumi@nifty.com>2018-10-22 16:36:00 +0800
committerMITSUNARI Shigeo <herumi@nifty.com>2018-10-22 16:36:00 +0800
commitc4ba9961024a76f7357b9ab19344c5e776245d84 (patch)
tree42dba519a2faec63169710d777cb298309a0fd32 /include
parentae27eb0267ff59f562bcf0cefa45db23c7374467 (diff)
downloaddexon-bls-c4ba9961024a76f7357b9ab19344c5e776245d84.tar
dexon-bls-c4ba9961024a76f7357b9ab19344c5e776245d84.tar.gz
dexon-bls-c4ba9961024a76f7357b9ab19344c5e776245d84.tar.bz2
dexon-bls-c4ba9961024a76f7357b9ab19344c5e776245d84.tar.lz
dexon-bls-c4ba9961024a76f7357b9ab19344c5e776245d84.tar.xz
dexon-bls-c4ba9961024a76f7357b9ab19344c5e776245d84.tar.zst
dexon-bls-c4ba9961024a76f7357b9ab19344c5e776245d84.zip
update new api of mclBn_init
Diffstat (limited to 'include')
-rw-r--r--include/bls/bls.h10
-rw-r--r--include/bls/bls.hpp6
2 files changed, 9 insertions, 7 deletions
diff --git a/include/bls/bls.h b/include/bls/bls.h
index 45bd839..6b7cbdd 100644
--- a/include/bls/bls.h
+++ b/include/bls/bls.h
@@ -57,12 +57,14 @@ typedef struct {
initialize this library
call this once before using the other functions
@param curve [in] enum value defined in mcl/bn.h
- @param maxUnitSize [in] MCLBN_FP_UNIT_SIZE (fixed)
- return 0 if success
+ @param compiledTimeVar [in] specify MCLBN_COMPILED_TIME_VAR,
+ which macro is used to make sure that the values
+ are the same when the library is built and used
+ @return 0 if success
@note blsInit() is thread safe and serialized if it is called simultaneously
but don't call it while using other functions.
*/
-BLS_DLL_API int blsInit(int curve, int maxUnitSize);
+BLS_DLL_API int blsInit(int curve, int compiledTimeVar);
BLS_DLL_API void blsIdSetInt(blsId *id, int x);
@@ -147,7 +149,7 @@ BLS_DLL_API void blsPublicKeySub(blsPublicKey *pub, const blsPublicKey *rhs);
BLS_DLL_API void blsSignatureSub(blsSignature *sig, const blsSignature *rhs);
// not thread safe version (old blsInit)
-BLS_DLL_API int blsInitNotThreadSafe(int curve, int maxUnitSize);
+BLS_DLL_API int blsInitNotThreadSafe(int curve, int compiledTimeVar);
BLS_DLL_API mclSize blsGetOpUnitSize(void);
// return strlen(buf) if success else 0
diff --git a/include/bls/bls.hpp b/include/bls/bls.hpp
index 722e4e2..b32b7e1 100644
--- a/include/bls/bls.hpp
+++ b/include/bls/bls.hpp
@@ -40,12 +40,12 @@ enum {
initialize this library
call this once before using the other method
@param curve [in] type of curve
- @param maxUnitSize [in] 4 or 6 (specify same value used in compiling for validation)
+ @param compiledTimevar [in] use the default value
@note init() is not thread safe
*/
-inline void init(int curve = mclBn_CurveFp254BNb, int maxUnitSize = MCLBN_FP_UNIT_SIZE)
+inline void init(int curve = mclBn_CurveFp254BNb, int compiledTimeVar = MCLBN_COMPILED_TIME_VAR)
{
- if (blsInit(curve, maxUnitSize) != 0) throw std::invalid_argument("blsInit");
+ if (blsInit(curve, compiledTimeVar) != 0) throw std::invalid_argument("blsInit");
}
inline size_t getOpUnitSize() { return blsGetOpUnitSize(); }