algebra icon indicating copy to clipboard operation
algebra copied to clipboard

Field should return size

Open jon-chuang opened this issue 5 years ago • 3 comments

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

jon-chuang avatar Oct 14 '20 10:10 jon-chuang

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 avatar Oct 14 '20 10:10 jon-chuang

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.

jon-chuang avatar Oct 14 '20 11:10 jon-chuang

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)

ValarDragon avatar Dec 07 '20 18:12 ValarDragon