File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -362,15 +362,11 @@ cdef class fq_default_ctx:
362362 if check is not NotImplemented :
363363 return 0
364364
365- # Assumes that the modulus of the polynomial matches
366- # the context for the fq_default
367- if typecheck(obj, fmpz_mod_poly):
365+ if typecheck(obj, fmpz_mod_poly) and self .prime() == (< fmpz_mod_poly> obj).ctx.mod.modulus():
368366 fq_default_set_fmpz_mod_poly(fq_ele, (< fmpz_mod_poly> obj).val, self .val)
369367 return 0
370368
371- # Assumes that the modulus of the polynomial matches
372- # the context for the fq_default
373- if typecheck(obj, nmod_poly):
369+ if typecheck(obj, nmod_poly) and self .prime() == obj.modulus():
374370 fq_default_set_nmod_poly(fq_ele, (< nmod_poly> obj).val, self .val)
375371 return 0
376372
You can’t perform that action at this time.
0 commit comments