RustCrypto / RustCrypto/KEMs

ml-kem: Don't use FieldElement for compressed values

Open
#26 25 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
111
Forks
53
Avg merge
5d 29m
Merged PRs (30d)
2

Description

FieldElement should specifically represent a member of $Z_q$ (can't figure out how to get GitHub to do \mathbb). Right now, it is also used as the output of the compress() method as well, even though these are elements of $Z_{2^d}$. We should define a separate type for this latter type of number, something like CompressedValue<D: CompressionFactor>

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Search the Rust codebase for FieldElement and compress() to map where compressed values are produced and consumed. Read the compression-related types and call sites first; done means compressed Z_{2^d} values use a distinct type while FieldElement remains specific to Z_q, with affected uses updated consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cryptography
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.