diff options
Diffstat (limited to 'include/bls_if.h')
-rw-r--r-- | include/bls_if.h | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/include/bls_if.h b/include/bls_if.h new file mode 100644 index 0000000..479e535 --- /dev/null +++ b/include/bls_if.h @@ -0,0 +1,50 @@ +#pragma once +/** + @file + @brief C interface of bls.hpp + @author MITSUNARI Shigeo(@herumi) + @license modified new BSD license + http://opensource.org/licenses/BSD-3-Clause +*/ + +#include <stdint.h> // for uint64_t +#include <stdlib.h> // for size_t + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct blsSecretKey blsSecretKey; +typedef struct blsPublicKey blsPublicKey; +typedef struct blsSign blsSign; +typedef struct blsId blsId; + +void blsInit(void); + +blsId *blsIdCreate(void); +void blsIdDestroy(blsId *id); +void blsIdPut(const blsId *id); + +void blsIdSet(blsId *id, const uint64_t *p); + +blsSecretKey* blsSecretKeyCreate(void); +void blsSecretKeyDestroy(blsSecretKey *sec); +void blsSecretKeyPut(const blsSecretKey *sec); + +void blsSecretKeyInit(blsSecretKey *sec); +void blsSecretKeyGetPublicKey(const blsSecretKey *sec, blsPublicKey *pub); +void blsSecretKeySign(const blsSecretKey *sec, blsSign *sign, const char *m, size_t size); + +blsPublicKey *blsPublicKeyCreate(void); +void blsPublicKeyDestroy(blsPublicKey *pub); +void blsPublicKeyPut(const blsPublicKey *pub); + +blsSign *blsSignCreate(void); +void blsSignDestroy(blsSign *sign); +void blsSignPut(const blsSign *sign); + +int blsSignVerify(const blsSign *sign, const blsPublicKey *pub, const char *m, size_t size); + +#ifdef __cplusplus +} +#endif |