aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/bls/bls.h6
-rw-r--r--test/bls_c384_test.cpp8
2 files changed, 10 insertions, 4 deletions
diff --git a/include/bls/bls.h b/include/bls/bls.h
index 98d05d5..3e2e719 100644
--- a/include/bls/bls.h
+++ b/include/bls/bls.h
@@ -118,6 +118,12 @@ BLS_DLL_API mclSize blsGetOpUnitSize(void);
BLS_DLL_API int blsGetCurveOrder(char *buf, mclSize maxBufSize);
BLS_DLL_API int blsGetFieldOrder(char *buf, mclSize maxBufSize);
+// return bytes for serialized G1(=Fp)
+BLS_DLL_API int blsGetG1ByteSize(void);
+
+// return bytes for serialized Fr
+BLS_DLL_API int blsGetFrByteSize(void);
+
// get a generator of G2
BLS_DLL_API void blsGetGeneratorOfG2(blsPublicKey *pub);
diff --git a/test/bls_c384_test.cpp b/test/bls_c384_test.cpp
index 79b9c54..6202697 100644
--- a/test/bls_c384_test.cpp
+++ b/test/bls_c384_test.cpp
@@ -24,8 +24,8 @@ void blsDataTest()
{
const char *msg = "test test";
const size_t msgSize = strlen(msg);
- const size_t FrSize = mclBn_getFrByteSize();
- const size_t FpSize = mclBn_getG1ByteSize();
+ const size_t FrSize = blsGetFrByteSize();
+ const size_t FpSize = blsGetG1ByteSize();
blsSecretKey sec1, sec2;
blsSecretKeySetByCSPRNG(&sec1);
char buf[1024];
@@ -117,8 +117,8 @@ CYBOZU_TEST_AUTO(multipleInit)
void blsSerializeTest()
{
- const size_t FrSize = mclBn_getFrByteSize();
- const size_t FpSize = mclBn_getG1ByteSize();
+ const size_t FrSize = blsGetFrByteSize();
+ const size_t FpSize = blsGetG1ByteSize();
printf("FrSize=%d, FpSize=%d\n", (int)FrSize, (int)FpSize);
blsId id1, id2;
blsSecretKey sec1, sec2;