algorand / pairing-plus

This is a fork of pairing library with additional efficiency functionality improvement.
Other
20 stars 21 forks source link

Is it v7 compatible ? #15

Open nikkolasg opened 4 years ago

nikkolasg commented 4 years ago

Hi,

Is the master compatible with the latest v7 of the RFC ? If not, do you know what is there to be done to make it v7 compatible ?

webmaster128 commented 3 years ago

To elaborate @nikkolasg's question: Does this crate implement draft-irtf-cfrg-hash-to-curve-07, which is the hash to curve agorithm used by drand as well as Ethereum1.

1 "Mapping functions are implemented according to IEFT specification version v7(!) using an simplified SWU method." EIP-2537

mratsim commented 3 years ago

The main non-compatible change of v7 was how to determine the sign on Fp2 IIRC, I think this commit https://github.com/algorand/pairing-plus/commit/9132ad21cd9aba1f740766c4cad042db78c98d81#diff-c5ae276591fdbf59b5683796886f2974a01a5044c375a5355d4f83f7ffbe62f2R504 made the code compatible with v7

You can check the changes directly on the IETF website using their diff tool: https://tools.ietf.org/rfcdiff?url1=https://tools.ietf.org/id/draft-irtf-cfrg-hash-to-curve-06.txt&url2=https://tools.ietf.org/id/draft-irtf-cfrg-hash-to-curve-07.txt

webmaster128 commented 3 years ago

Ah nice. If the crate is (or aims to be) v7 compatible, it can be tested with the v8 test vectors, which are the same. I did this before in https://github.com/filecoin-project/paired/pull/22.