Skip to content

Commit

Permalink
Fix recursive bug in fq_default_ctx_init_modulus_*
Browse files Browse the repository at this point in the history
  • Loading branch information
albinahlback committed Apr 25, 2024
1 parent c29a090 commit e2cc686
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/fq_default/ctx.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ void fq_default_ctx_init_modulus_type(fq_default_ctx_t ctx,
if (type == FQ_DEFAULT_FQ_ZECH || (type == 0 && d > 1 && bits*d <= 16))
{
if (gr_ctx_init_fq_zech_modulus_fmpz_mod_poly(FQ_DEFAULT_GR_CTX(ctx), modulus, mod_ctx, var) != GR_SUCCESS)
fq_default_ctx_init_modulus_type(ctx, modulus, mod_ctx, var, _FQ_DEFAULT_FQ_NMOD);
fq_default_ctx_init_modulus_type(ctx, modulus, mod_ctx, var, FQ_DEFAULT_FQ_NMOD);
}
else if (type == FQ_DEFAULT_FQ_NMOD || (type == 0 && d > 1 && fmpz_abs_fits_ui(p)))
{
Expand Down Expand Up @@ -118,7 +118,7 @@ void fq_default_ctx_init_modulus_nmod_type(fq_default_ctx_t ctx,
if (type == FQ_DEFAULT_FQ_ZECH || (type == 0 && d > 1 && bits*d <= 16))
{
if (gr_ctx_init_fq_zech_modulus_nmod_poly(FQ_DEFAULT_GR_CTX(ctx), modulus, var) != GR_SUCCESS)
fq_default_ctx_init_modulus_nmod_type(ctx, modulus, var, _FQ_DEFAULT_FQ_NMOD);
fq_default_ctx_init_modulus_nmod_type(ctx, modulus, var, FQ_DEFAULT_FQ_NMOD);
}
else if (type == FQ_DEFAULT_FQ_NMOD || (type == 0 && d > 1))
{
Expand Down

0 comments on commit e2cc686

Please sign in to comment.