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

Field should return size #56

Open
jon-chuang opened this issue Oct 14, 2020 · 3 comments
Open

Field should return size #56

jon-chuang opened this issue Oct 14, 2020 · 3 comments

Comments

@jon-chuang
Copy link
Contributor

Field should return extension degree + characteristic (already impl) so that one can easily determine its order.

@jon-chuang
Copy link
Contributor Author

jon-chuang commented Oct 14, 2020

One can determine the extension degree recursively. So for any extension of degree > 1, it returns d * Self::BaseField::extension_degree(), and primefield returns 1.

@jon-chuang
Copy link
Contributor Author

Unfortunately, representing this modulus is a problem. Since, one usually has a modulus that is just shy of setting all the bits in the BigInteger representation. So for a field extension like Fp12 or higher, one is not guaranteed that one can represent the modulus.

@Pratyush Pratyush transferred this issue from arkworks-rs/snark Nov 20, 2020
@ValarDragon
Copy link
Member

I don't think we need the field to return the size (due to the representation problem), I view providing the extension degree and characteristic as sufficient.

Maybe we could add a floor_field_size_in_bits, by calculating floor(extension_degree * log_2(characteristic)) with a logarithm method that returns a decimal. (Don't want to return float, due to non-determinism across arch's)

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

No branches or pull requests

2 participants