ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sat, 03 Mar 2018 16:55:47 +0100elliptic code of 112 bithttps://ask.sagemath.org/question/41373/elliptic-code-of-112-bit/i am working on the elliptic curve of 112 bit. and i want to generate a cyclotomic polynomial . i have written the code
but the following error is obtained.
p=(2^128-3)/76439;p
F = GF(p)
S.<a> = PolynomialRing( F )
K.<a> = GF( p^2);#K.modulus#, modulus=W^2+W+1 )
print "\n Modulus of K is =", K.modulus()
R.<z> = PolynomialRing( K, sparse=True )
i=9817501343317677957515279627338949795623675802414662483433914174328
f= cyclotomic_polynomial(i,'z');f
Error
OverflowError: Python int too large to convert to C longSat, 03 Mar 2018 07:18:23 +0100https://ask.sagemath.org/question/41373/elliptic-code-of-112-bit/Answer by dan_fulea for <p>i am working on the elliptic curve of 112 bit. and i want to generate a cyclotomic polynomial . i have written the code
but the following error is obtained.
p=(2^128-3)/76439;p
F = GF(p)</p>
<p>S.<a> = PolynomialRing( F )
K.</a><a> = GF( p^2);#K.modulus#, modulus=W^2+W+1 )
print "\n Modulus of K is =", K.modulus() </a></p><a>
<p>R.<z> = PolynomialRing( K, sparse=True )
i=9817501343317677957515279627338949795623675802414662483433914174328
f= cyclotomic_polynomial(i,'z');f
Error
OverflowError: Python int too large to convert to C long</p>
</a> https://ask.sagemath.org/question/41373/elliptic-code-of-112-bit/?answer=41381#post-id-41381Let us consider the "simpler" situation for the degree of the cyclotomic polynomial:
p = ZZ( (2^128-3)/76439 )
F = GF(p)
S.<W> = PolynomialRing( F )
K.<w> = GF( p^2 )
R.<z> = PolynomialRing( K, sparse=True )
# N = 9817501343317677957515279627338949795623675802414662483433914174328
N = 2^3 * 17 * (1000.next_prime())
f = cyclotomic_polynomial( N, 'z' )
len(f.monomials())
This code constructs $f$ having
4985
monomials. The value of $N$ is
sage: N
137224
and it is "small", when compared to the "bigger" number
sage: 9817501343317677957515279627338949795623675802414662483433914174328.factor()
2^3 * 17 * 72187509877335867334671173730433454379585851488343106495837604223
For this smaller $N$, the polynomial $f$ was computed *and stored*. It is of course no place to store the corresponding data for the "bigger" number instead. And the code for the computation of the cyclotomic polynomial was designed for such practical situations.
Sat, 03 Mar 2018 16:55:47 +0100https://ask.sagemath.org/question/41373/elliptic-code-of-112-bit/?answer=41381#post-id-41381