We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e79b397 commit f789f22Copy full SHA for f789f22
1 file changed
src/flint/types/fq_default.pyx
@@ -362,15 +362,11 @@ cdef class fq_default_ctx:
362
if check is not NotImplemented:
363
return 0
364
365
- # Assumes that the modulus of the polynomial matches
366
- # the context for the fq_default
367
- if typecheck(obj, fmpz_mod_poly):
+ if typecheck(obj, fmpz_mod_poly) and self.prime() == (<fmpz_mod_poly>obj).ctx.mod.modulus():
368
fq_default_set_fmpz_mod_poly(fq_ele, (<fmpz_mod_poly>obj).val, self.val)
369
370
371
372
373
- if typecheck(obj, nmod_poly):
+ if typecheck(obj, nmod_poly) and self.prime() == obj.modulus():
374
fq_default_set_nmod_poly(fq_ele, (<nmod_poly>obj).val, self.val)
375
376
0 commit comments