Skip to content

Make poly_chknorm constant flow #153

@hanno-becker

Description

@hanno-becker

The current implementation of poly_chknorm,

  for (i = 0; i < MLDSA_N; ++i)
  {
    /* Absolute value */
    t = a->coeffs[i] >> 31;
    t = a->coeffs[i] - (t & 2 * a->coeffs[i]);

    if (t >= B)
    {
      return 1;
    }
  }

aborts upon the first entry which exceeds the given norm.

While there is a comment indicating why this does not leak anything sensitive, the input data is sensitive (from what I understand), so it seems safer to use a constant-flow implementation here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions