Commit Graph

11 Commits

Author SHA1 Message Date
Daira Hopwood 3523aee87f hashtocurve.sage: fix a bug due to inadvertently relying on values calculated by debug code.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-01-02 02:22:01 +00:00
Daira Hopwood fd7283a979 Make map_to_curve_simple_swu take a single input again (since we no longer need batch inversion).
Also make it clearer that we don't depend on Sage's elliptic curve impl except for debugging.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-01-02 00:50:42 +00:00
Daira Hopwood c0f2b2d8b6 Correct a comment.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-01-02 00:20:36 +00:00
Daira Hopwood 4a3a34feea Improve comments and cost accounting.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-01-01 19:44:32 +00:00
Daira Hopwood 50d3e83467 Implement the optimization from [WB2019, section 4.2] that removes the remaining inversion.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-01-01 03:37:41 +00:00
Daira Hopwood 391e67f250 hashtocurve.sage: correct a comment.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-12-31 15:26:20 +00:00
Daira Hopwood 112983e667 hashtocurve: allow use of the sqrt optimization with the Z recommended by the Internet Draft.
This also makes the sqrt and hash-to-curve implementations depend on each other less strongly.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-12-31 13:45:35 +00:00
Daira Hopwood ef3405dd20 Add an optimization from [WB2019, section 4.2] that saves a square root for each map_to_curve.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-12-31 03:35:50 +00:00
Daira Hopwood 71afc68f7d hashtocurve.sage: add Jacobian coordinate implementation that avoids two of the three inversions.
Do not base production code on this yet!

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-12-30 16:09:25 +00:00
Daira Hopwood 7df33f4ce4 hashtocurve.sage: more realistic use of Montgomery's trick.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-12-29 17:58:50 +00:00
Daira Hopwood 96fd2c794e [WIP] Add a prototype implementation of hash-to-curve. This intends to implement the Internet Draft but has not been checked.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-12-29 17:58:50 +00:00