Skip to content

Commit

Permalink
Show which among lm,hm,nm,low,high,new are not of same length
Browse files Browse the repository at this point in the history
  • Loading branch information
Bhargavasomu committed Jan 25, 2019
1 parent ae2e221 commit 8429ec7
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions py_ecc/fields/field_elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,19 @@ def inv(self) -> "FQP":
r += [0] * (self.degree + 1 - len(r))
nm = [x for x in hm]
new = [x for x in high]
if len(set(
[len(lm), len(hm), len(low), len(high), len(nm), len(new), self.degree + 1]
)) != 1:
raise Exception("Mismatch between the lengths of lm, hm, low, high, nm, new")

if len(lm) != self.degree + 1:
raise Exception("Length of lm is not {}".format(self.degree + 1))
elif len(hm) != self.degree + 1:
raise Exception("Length of hm is not {}".format(self.degree + 1))
elif len(nm) != self.degree + 1:
raise Exception("Length of nm is not {}".format(self.degree + 1))
elif len(low) != self.degree + 1:
raise Exception("Length of low is not {}".format(self.degree + 1))
elif len(high) != self.degree + 1:
raise Exception("Length of high is not {}".format(self.degree + 1))
elif len(new) != self.degree + 1:
raise Exception("Length of new is not {}".format(self.degree + 1))

for i in range(self.degree + 1):
for j in range(self.degree + 1 - i):
Expand Down

0 comments on commit 8429ec7

Please sign in to comment.