Closed levyfan closed 1 year ago
IRTF is for only BLS12-381. It should become an error if the value is set for CurveFp254BNb.
You can use a default HashAndMapTo without SetMapToMode
though it may not be what you want.
We can also apply simplified SWU for BN curves as stated in the irtf draft? https://datatracker.ietf.org/doc/draft-irtf-cfrg-hash-to-curve/
6.6.3. Simplified SWU for AB == 0
It is necessary to decide on some parameters for the algorithm. I think that only BLS12-381 is standardized. Why do you want to use Fp254BNb?
We are doing some latency critical applications and BN254 is much faster than BLS12-381.
The algorithm which is implemented in mcl for BN254 is https://github.com/herumi/mcl/blob/master/include/mcl/bn.hpp#L333-L338 , which is the basis for the IRTF scheme. How about using the hashmap at your own risk though I don't know the safety rating?
I modified setMapToMode to return false for mcl.IRTF in using BN254 at v1.76.
The following code will reproduce all zero results of g called after g.HashAndMapTo
The init is as follows:
The reason might be that struct MapTo_WB19::init is not called?