Simplify bn_mont.c
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 30.8k
- Forks
- 11.5k
- Avg merge
- 10m
- Merged PRs (30d)
- 1
Description
Grepping seems to suggest we never undefine MONT_WORD in the Configuration system. In that case not only do we have ample amounts of dead code to remove, but can shrink the montgomery context structure by storing merely mu, N, and RR. (I'm not quite sure if ri is what it is claimed to be in the comment: it doesn't look it)
More generally I think the arithmetic might need to be reevaluated for a 2020's range of used architectures and compilers: quite a bit of implementation complexity could be removed, but I've only taken a cursory look so far.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in bn_mont.c and inspect the Configuration system for any paths that undefine MONT_WORD, then trace the Montgomery context fields and the comments about ri. Done is not yet narrowly defined: the issue suggests removing dead code and simplifying the context, while the broader arithmetic reevaluation needs a concrete scope before implementation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- cryptography
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100