From d085930d574264ae30c1091a9948c21b3160feb8 Mon Sep 17 00:00:00 2001 From: MITSUNARI Shigeo Date: Wed, 15 Mar 2017 06:07:20 +0900 Subject: add UNIT option to select bn256 or bn384 --- include/bls_if.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'include/bls_if.h') diff --git a/include/bls_if.h b/include/bls_if.h index d02d325..194d14f 100644 --- a/include/bls_if.h +++ b/include/bls_if.h @@ -6,6 +6,9 @@ @license modified new BSD license http://opensource.org/licenses/BSD-3-Clause */ +#ifndef BLS_MAX_OP_UNIT_SIZE + #error "define BLS_MAX_OP_UNIT_SIZE 4(or 6)" +#endif #include // for uint64_t, uint8_t #include // for size_t @@ -25,22 +28,22 @@ enum { }; typedef struct { - uint64_t buf[6]; + uint64_t buf[BLS_MAX_OP_UNIT_SIZE]; } blsId; typedef struct { - uint64_t buf[6]; + uint64_t buf[BLS_MAX_OP_UNIT_SIZE]; } blsSecretKey; typedef struct { - uint64_t buf[6 * 2 * 3]; + uint64_t buf[BLS_MAX_OP_UNIT_SIZE * 2 * 3]; } blsPublicKey; typedef struct { - uint64_t buf[6 * 3]; + uint64_t buf[BLS_MAX_OP_UNIT_SIZE * 3]; } blsSign; -void blsInit(int curve); +void blsInit(int curve, int maxUnitSize); blsId *blsIdCreate(void); void blsIdDestroy(blsId *id); -- cgit v1.2.3