Skip to content

feat: u252 implementation #8771

@bal7hazar

Description

@bal7hazar

Feature Request

Describe the Feature Request

Implement a u252 type
When I am doing bit packing on felt252 (which is the most optimal size) I cannot perform bitwise operations or a division (both are required for unpacking) due to the nature of the felt.
The only alternative right now is to infer into a u256 to performs such operations, but it comes with a trade off of efficiency related to the nature of u256.
Having a u252 would be the ideal solution for a such purpose, giving the ability to infer from and to felt252.
Note: I expect the Bounded::max() to be Prime - 1 and not 2**252 - 1 to ease the conversion.

Describe Preferred Solution

Similar to other unsigned integers

Additional Context

If the feature request is approved, would you be willing to submit a PR?
(Help can be provided if you need assistance submitting a PR)

  • Yes
  • No

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions