RustCrypto / RustCrypto/crypto-bigint
Publicly export a macro to define `Uint` and associated sizes
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 309
- Forks
- 95
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 3
Description
I have the edge-case of having to work with ~5k-bit unreduced numbers, taking their product (~10k bits), just to perform a division. While I was writing an issue discussing wrapping_div_wide (following the existence of rem_wide) to optimize this edge case of mine (and be more flexible with the allowed types), I think the most practical solution and one which resolves many historic issues (#1095 for the current iteration) would to be let users define their own Uint type with the sizes their application needs. This would be with the expectation that crypto-bigint provides the necessary glue via a mixture of traits, literal implementations re: UintRef, and literal implementations in the macro-generated code.
This would mean application-specific Uint type definitions and application-specific invoking of impl_uint_concat_split_mixed, shifting long compile times to the user, but also allowing them to tailor to just their subset (improving compile times).
Alternatively, we can continue to wait for the necessary const generics, or someone could probably write a third-party crate which is Uint around hybrid-array to achieve similar results for more flexible Uint types?
Contributor guide
No contributing guide indexed for this repository
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 by reading the existing impl_uint_concat_split_mixed macro and the related rem_wide and wrapping_div_wide APIs. The design discussion should establish the public macro surface and the required trait and literal implementations; done means applications can define Uint types for their needed sizes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cryptography
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100