aboutsummaryrefslogtreecommitdiffstats
path: root/include/bls_if.h
diff options
context:
space:
mode:
authorMITSUNARI Shigeo <herumi@nifty.com>2016-09-06 11:19:44 +0800
committerMITSUNARI Shigeo <herumi@nifty.com>2016-09-06 11:19:44 +0800
commit2e59d4a1f514e0d4b3f856f29eda705c6e9d7ae4 (patch)
treeada6f270ddcbbde87155aec2228f10593541b814 /include/bls_if.h
parentc57810f1ce75c554597241fad92f219249b6e26f (diff)
downloaddexon-bls-2e59d4a1f514e0d4b3f856f29eda705c6e9d7ae4.tar
dexon-bls-2e59d4a1f514e0d4b3f856f29eda705c6e9d7ae4.tar.gz
dexon-bls-2e59d4a1f514e0d4b3f856f29eda705c6e9d7ae4.tar.bz2
dexon-bls-2e59d4a1f514e0d4b3f856f29eda705c6e9d7ae4.tar.lz
dexon-bls-2e59d4a1f514e0d4b3f856f29eda705c6e9d7ae4.tar.xz
dexon-bls-2e59d4a1f514e0d4b3f856f29eda705c6e9d7ae4.tar.zst
dexon-bls-2e59d4a1f514e0d4b3f856f29eda705c6e9d7ae4.zip
add C interface
Diffstat (limited to 'include/bls_if.h')
-rw-r--r--include/bls_if.h50
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