diff options
author | MITSUNARI Shigeo <herumi@nifty.com> | 2018-09-17 10:43:16 +0800 |
---|---|---|
committer | MITSUNARI Shigeo <herumi@nifty.com> | 2018-09-17 10:43:16 +0800 |
commit | af2e557d9eb824a0c8d5c42a8cf1c8f09c8d16a7 (patch) | |
tree | 920ea3ff57d5fe3dbacd7d4841394dcf25aeaa47 /include/bls/bls.h | |
parent | 5aac84e9ab6b14d6c6402389d28fc1d488766444 (diff) | |
download | dexon-bls-af2e557d9eb824a0c8d5c42a8cf1c8f09c8d16a7.tar dexon-bls-af2e557d9eb824a0c8d5c42a8cf1c8f09c8d16a7.tar.gz dexon-bls-af2e557d9eb824a0c8d5c42a8cf1c8f09c8d16a7.tar.bz2 dexon-bls-af2e557d9eb824a0c8d5c42a8cf1c8f09c8d16a7.tar.lz dexon-bls-af2e557d9eb824a0c8d5c42a8cf1c8f09c8d16a7.tar.xz dexon-bls-af2e557d9eb824a0c8d5c42a8cf1c8f09c8d16a7.tar.zst dexon-bls-af2e557d9eb824a0c8d5c42a8cf1c8f09c8d16a7.zip |
add signHash and verifyHash for hashed value
Diffstat (limited to 'include/bls/bls.h')
-rw-r--r-- | include/bls/bls.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/bls/bls.h b/include/bls/bls.h index 21cd5b0..b2b8604 100644 --- a/include/bls/bls.h +++ b/include/bls/bls.h @@ -72,6 +72,7 @@ BLS_DLL_API int blsSecretKeySetLittleEndian(blsSecretKey *sec, const void *buf, BLS_DLL_API void blsGetPublicKey(blsPublicKey *pub, const blsSecretKey *sec); +// calculate the has of m and sign the hash BLS_DLL_API void blsSign(blsSignature *sig, const blsSecretKey *sec, const void *m, mclSize size); // return 1 if valid @@ -122,6 +123,16 @@ BLS_DLL_API int blsPublicKeyIsValidOrder(const blsPublicKey *pub); #ifndef BLS_MINIMUM_API +/* + sign the hash + use the low (bitSize of r) - 1 bit of h + return 0 if success else -1 + NOTE : return false if h is zero or c1 or -c1 value for BN254. see hashTest() in test/bls_test.hpp +*/ +BLS_DLL_API int blsSignHash(blsSignature *sig, const blsSecretKey *sec, const void *h, mclSize size); +// return 1 if valid +BLS_DLL_API int blsVerifyHash(const blsSignature *sig, const blsPublicKey *pub, const void *h, mclSize size); + // sub BLS_DLL_API void blsSecretKeySub(blsSecretKey *sec, const blsSecretKey *rhs); BLS_DLL_API void blsPublicKeySub(blsPublicKey *pub, const blsPublicKey *rhs); |