Skip to content

copy coeffs in NTT#107

Open
GiacomoPope wants to merge 1 commit into
mainfrom
immutable_ntt
Open

copy coeffs in NTT#107
GiacomoPope wants to merge 1 commit into
mainfrom
immutable_ntt

Conversation

@GiacomoPope

Copy link
Copy Markdown
Owner

Fix in response to #105

]
elif isinstance(other, int):
new_coeffs = self.coeffs.copy()
new_coeffs = self.coeffs[:]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no...?

the issue is about this line:

and how they are then modified:

coeffs[j + l] = coeffs[j] - t
coeffs[j] = coeffs[j] + t
start = l + (j + 1)
l = l >> 1
for j in range(256):
coeffs[j] = coeffs[j] % 3329

so that the instance of a Polynomial on which you call .to_ntt() is mutated

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I just took the time to have [:] as consistent copy both here and in the new location?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants