diff options
author | MITSUNARI Shigeo <herumi@nifty.com> | 2018-09-18 06:12:50 +0800 |
---|---|---|
committer | MITSUNARI Shigeo <herumi@nifty.com> | 2018-09-18 06:12:50 +0800 |
commit | e73db26ea1d0526dbbea4f46870ae61e117b7f00 (patch) | |
tree | 075bb29de07276c4033f4da4c4e16411e4f780ae | |
parent | bad0d52d6549aa0ff4e1dfdfeec9046fb6174ea7 (diff) | |
download | dexon-bls-e73db26ea1d0526dbbea4f46870ae61e117b7f00.tar dexon-bls-e73db26ea1d0526dbbea4f46870ae61e117b7f00.tar.gz dexon-bls-e73db26ea1d0526dbbea4f46870ae61e117b7f00.tar.bz2 dexon-bls-e73db26ea1d0526dbbea4f46870ae61e117b7f00.tar.lz dexon-bls-e73db26ea1d0526dbbea4f46870ae61e117b7f00.tar.xz dexon-bls-e73db26ea1d0526dbbea4f46870ae61e117b7f00.tar.zst dexon-bls-e73db26ea1d0526dbbea4f46870ae61e117b7f00.zip |
Revert "insert zero byte into low bit of h for BLS12-381"
This is dirty hack.
-rw-r--r-- | src/bls_c_impl.hpp | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/src/bls_c_impl.hpp b/src/bls_c_impl.hpp index 1540d94..ad52cf7 100644 --- a/src/bls_c_impl.hpp +++ b/src/bls_c_impl.hpp @@ -270,19 +270,7 @@ int blsPublicKeyIsValidOrder(const blsPublicKey *pub) inline bool toG1(G1& Hm, const void *h, mclSize size) { Fp t; - if (BN::param.cp.curveType == MCL_BLS12_381) { - /* - the current mapToG1 for BLS12_381 uses an algorithm to search x++ while y exsits, - so almost same h values return same point unless there exists margine in low bit. - */ - char buf[48]; - buf[0] = 0; - size = (std::min)(size, sizeof(buf) - 1); - memcpy(&buf[1], h, size); - t.setArrayMask(buf, size + 1); - } else { - t.setArrayMask((const char *)h, size); - } + t.setArrayMask((const char *)h, size); bool b; BN::mapToG1(&b, Hm, t); return b; |