Browse Source

fix bug in ristretto elligator: it should be able to take improper field elements as input

master
Mike Hamburg 3 years ago
parent
commit
0324a95569
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      _aux/ristretto/ristretto.sage

+ 1
- 1
_aux/ristretto/ristretto.sage View File

@@ -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():


Loading…
Cancel
Save