Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to use different prime field element implementations #4

Merged
merged 1 commit into from
Jan 15, 2023

Conversation

vadorovsky
Copy link
Contributor

Before this change, even though the F: PrimeField was generic in Poseidon struct and traits it implements, Poseidon parameters were still defined as Fq.

To allow usage of different prime field element types (i.e. Fr), the parameters have to be generic as well.

However, since the new() method is not a part of PrimeField trait, functions returining parameters can't be generic, so they are handled with a macro instead.

Signed-off-by: Michal Rostecki [email protected]

Before this change, even though the `F: PrimeField` was generic in
`Poseidon` struct and traits it implements, Poseidon parameters were
still defined as `Fq`.

To allow usage of different prime field element types (i.e. `Fr`), the
parameters have to be generic as well.

However, since the `new()` method is not a part of `PrimeField` trait,
functions returining parameters can't be generic, so they are handled
with a macro instead.

Signed-off-by: Michal Rostecki <[email protected]>
@vadorovsky vadorovsky merged commit aee3541 into main Jan 15, 2023
@vadorovsky vadorovsky deleted the generic-prime-field-element branch January 15, 2023 11:27
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.

1 participant