From b96acf6e867479304f0e9246e8cdb966752e368b Mon Sep 17 00:00:00 2001 From: MITSUNARI Shigeo Date: Thu, 26 Mar 2020 14:02:04 +0900 Subject: [PATCH] DST for hash-to-curve is changed --- include/mcl/mapto_wb19.hpp | 7 ++++++- include/mcl/op.hpp | 2 +- readme.md | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/include/mcl/mapto_wb19.hpp b/include/mcl/mapto_wb19.hpp index 364c0a0..b77810f 100644 --- a/include/mcl/mapto_wb19.hpp +++ b/include/mcl/mapto_wb19.hpp @@ -701,7 +701,12 @@ struct MapToG2_WB19 { } void msgToG2(G2& out, const void *msg, size_t msgSize) const { - const char *dst = "BLS_SIG_BLS12381G2-SHA256-SSWU-RO-_POP_"; + const char *dst; + if (draftVersion_ == 5) { + dst = "BLS_SIG_BLS12381G2-SHA256-SSWU-RO-_POP_"; + } else { + dst = "BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_POP_"; + } map2curve_osswu2(out, msg, msgSize, dst, strlen(dst)); } }; diff --git a/include/mcl/op.hpp b/include/mcl/op.hpp index 3f8476b..f6e64e6 100644 --- a/include/mcl/op.hpp +++ b/include/mcl/op.hpp @@ -23,7 +23,7 @@ namespace mcl { -static const int version = 0x106; /* 0xABC = A.BC */ +static const int version = 0x107; /* 0xABC = A.BC */ /* specifies available string format mode for X::setIoMode() diff --git a/readme.md b/readme.md index ace5483..f755abf 100644 --- a/readme.md +++ b/readme.md @@ -10,6 +10,7 @@ mcl is a library for pairing-based cryptography, which supports the optimal Ate pairing over BN curves and BLS12-381 curves. # News +- change DST of hash-to-curve for `MCL_MAP_TO_MODE_HASH_TO_CURVE_06`. - add new hash-to-curve function of [draft-irtf-cfrg-hash-to-curve](https://cfrg.github.io/draft-irtf-cfrg-hash-to-curve/draft-irtf-cfrg-hash-to-curve.txt) at March 2020. - call `setETHmode(MCL_MAP_TO_MODE_HASH_TO_CURVE_06);` - The older `MAP_TO_MODE` will be removed after the draft is fixed. @@ -295,6 +296,7 @@ If `MCL_USE_OLD_MAPTO_FOR_BLS12` is defined, then the old function is used, but # History +- 2020/Mar/26 v1.07 change DST for hash-to-curve-06 - 2020/Mar/15 v1.06 support hash-to-curve-06 - 2020/Jan/31 v1.05 mclBn_ethMsgToFp2 has changed to append zero byte at the end of msg - 2020/Jan/25 v1.04 add new hash functions