Skip to content

Publicly export a macro to define Uint and associated sizes #1314

Description

@kayabaNerve

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions