From d61e54c60e634fbe112d7cd1f1222ceb4d543cad Mon Sep 17 00:00:00 2001 From: Jacob Jackson Date: Wed, 5 Oct 2022 22:08:11 +0000 Subject: [PATCH] remove check that they say is unnecessary --- edwards_curve/eddsa25519.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/edwards_curve/eddsa25519.go b/edwards_curve/eddsa25519.go index daa1ab6..6d640a5 100644 --- a/edwards_curve/eddsa25519.go +++ b/edwards_curve/eddsa25519.go @@ -56,16 +56,16 @@ func bits_to_scalar(c *EdCurve, s []frontend.Variable) EdCoordinate { // } func bits_to_element(c *EdCurve, input []frontend.Variable) EdPoint { - L := emulated.NewElement[Ed25519Scalars](rEd25519) + // L := emulated.NewElement[Ed25519Scalars](rEd25519) unchecked_point := decodepoint(c, input) - // TODO: https://github.com/warner/python-pure25519 says this check is not necessary: - // - // > This library is conservative, and performs full subgroup-membership checks on decoded - // > points, which adds considerable overhead. The Curve25519/Ed25519 algorithms were - // > designed to not require these checks, so a careful application might be able to - // > improve on this slightly (Ed25519 verify down to 6.2ms, DH-finish to 3.2ms). - c.AssertIsZero(c.ScalarMul(unchecked_point, L)) + // // TODO: https://github.com/warner/python-pure25519 says this check is not necessary: + // // + // // > This library is conservative, and performs full subgroup-membership checks on decoded + // // > points, which adds considerable overhead. The Curve25519/Ed25519 algorithms were + // // > designed to not require these checks, so a careful application might be able to + // // > improve on this slightly (Ed25519 verify down to 6.2ms, DH-finish to 3.2ms). + // c.AssertIsZero(c.ScalarMul(unchecked_point, L)) return unchecked_point }