diff options
author | MITSUNARI Shigeo <herumi@nifty.com> | 2017-03-15 05:07:20 +0800 |
---|---|---|
committer | MITSUNARI Shigeo <herumi@nifty.com> | 2017-03-15 05:07:20 +0800 |
commit | d085930d574264ae30c1091a9948c21b3160feb8 (patch) | |
tree | ce192c0cd0bcc7e3e9a8402a3147409392159277 /include/bls_if.h | |
parent | a148e716c06551b5ac143477c919548c9a682a03 (diff) | |
download | dexon-bls-d085930d574264ae30c1091a9948c21b3160feb8.tar dexon-bls-d085930d574264ae30c1091a9948c21b3160feb8.tar.gz dexon-bls-d085930d574264ae30c1091a9948c21b3160feb8.tar.bz2 dexon-bls-d085930d574264ae30c1091a9948c21b3160feb8.tar.lz dexon-bls-d085930d574264ae30c1091a9948c21b3160feb8.tar.xz dexon-bls-d085930d574264ae30c1091a9948c21b3160feb8.tar.zst dexon-bls-d085930d574264ae30c1091a9948c21b3160feb8.zip |
add UNIT option to select bn256 or bn384
Diffstat (limited to 'include/bls_if.h')
-rw-r--r-- | include/bls_if.h | 13 |
1 files changed, 8 insertions, 5 deletions
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 <stdint.h> // for uint64_t, uint8_t #include <stdlib.h> // 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); |