Skip to content

Infinite loop in prover stage with large modulus p #19

@keewoolee

Description

@keewoolee

Hi, I’m testing the LaZer library with kyber1024-demo.c using custom parameters. The program runs successfully with a 29-bit prime modulus (e.g., p = 2^29). However, starting from a 30-bit modulus, it enters an apparent infinite loop. This happens with any prime modulus of this size or larger (e.g., p = 2^30 + 2^25 + 1).

The program seems to get stuck in a while (1) loop during the rejection sampling phase. With larger moduli, the generated polynomial coefficients appear to fall outside the acceptable range, leading to continuous rejections. It seems that some of the library’s internal functions may implicitly assume a modulus within a certain bit-size range.

Could you clarify which function imposes the restriction that p must be smaller than 30 bits? Any guidance on how to enable support for larger moduli would be greatly appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions