aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMITSUNARI Shigeo <herumi@nifty.com>2017-04-28 09:07:40 +0800
committerMITSUNARI Shigeo <herumi@nifty.com>2017-04-28 09:07:40 +0800
commit2d2d4a11b718932a17a9ea817f3f7ac115864c85 (patch)
tree68dfb88d2e7921f542751d9a8df16fd5ec5a75ab
parentae8342e9fdd14844606eb03ebe32fcf77f156b76 (diff)
downloaddexon-bls-2d2d4a11b718932a17a9ea817f3f7ac115864c85.tar
dexon-bls-2d2d4a11b718932a17a9ea817f3f7ac115864c85.tar.gz
dexon-bls-2d2d4a11b718932a17a9ea817f3f7ac115864c85.tar.bz2
dexon-bls-2d2d4a11b718932a17a9ea817f3f7ac115864c85.tar.lz
dexon-bls-2d2d4a11b718932a17a9ea817f3f7ac115864c85.tar.xz
dexon-bls-2d2d4a11b718932a17a9ea817f3f7ac115864c85.tar.zst
dexon-bls-2d2d4a11b718932a17a9ea817f3f7ac115864c85.zip
add comment to init function
-rw-r--r--go/bls/bls.go2
-rw-r--r--include/bls.hpp1
-rw-r--r--include/bls_if.h5
3 files changed, 8 insertions, 0 deletions
diff --git a/go/bls/bls.go b/go/bls/bls.go
index 6aba00b..f4faf92 100644
--- a/go/bls/bls.go
+++ b/go/bls/bls.go
@@ -21,6 +21,8 @@ const CurveFp382_1 = 1
const CurveFp382_2 = 2
// Init --
+// call this function before calling all the other operations
+// this function is not thread safe
func Init(curve int) {
C.blsInit(C.int(curve), C.BLS_MAX_OP_UNIT_SIZE)
}
diff --git a/include/bls.hpp b/include/bls.hpp
index 689d1c9..5cb4471 100644
--- a/include/bls.hpp
+++ b/include/bls.hpp
@@ -52,6 +52,7 @@ struct Id;
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)
+ @note init() is not thread safe
*/
void init(int curve = CurveFp254BNb, int maxUnitSize = BLS_MAX_OP_UNIT_SIZE);
size_t getOpUnitSize();
diff --git a/include/bls_if.h b/include/bls_if.h
index 37b755f..2eb8f1b 100644
--- a/include/bls_if.h
+++ b/include/bls_if.h
@@ -43,6 +43,11 @@ typedef struct {
uint64_t buf[BLS_MAX_OP_UNIT_SIZE * 3];
} blsSign;
+/*
+ initialize this library
+ call this once before using the other method
+ @note init() is not thread safe
+*/
void blsInit(int curve, int maxUnitSize);
size_t blsGetOpUnitSize(void);
// return strlen(buf) if success else 0