From 0324a955696d3235b5700046a487f8a2086baf1f Mon Sep 17 00:00:00 2001 From: Mike Hamburg Date: Sat, 10 Oct 2020 12:14:08 +0100 Subject: [PATCH] fix bug in ristretto elligator: it should be able to take improper field elements as input --- _aux/ristretto/ristretto.sage | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_aux/ristretto/ristretto.sage b/_aux/ristretto/ristretto.sage index 9aaeaae..8fd8fbb 100644 --- a/_aux/ristretto/ristretto.sage +++ b/_aux/ristretto/ristretto.sage @@ -126,7 +126,7 @@ class QuotientEdwardsPoint(object): @classmethod def bytesToGf(cls,bytes,mustBeProper=True,mustBePositive=False,maskHiBits=False): """Convert little-endian bytes to field element, sanity check length""" - if len(bytes) != cls.encLen: + if len(bytes) != cls.encLen and mustBeProper: raise InvalidEncodingException("wrong length %d" % len(bytes)) s = dec_le(bytes) if mustBeProper and s >= cls.F.order():