Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add bitwise ops to Integer trait #51

Merged
merged 1 commit into from
Nov 17, 2021

Conversation

tarcieri
Copy link
Member

Adds the following bitwise operations:

  • BitAnd
  • BitOr
  • BitXor
  • Shl
  • Shr

Additionally adds impls of the Bit* traits on UInt<LIMBS> directly, in addition to the existing impls on Wrapping<UInt<LIMBS>>.

This is safe because there is no difference between the "wrapping" or "checked" versions of these operations: they always succeed and there is no "wrapping" behavior to worry about.

This is debatably a breaking change but one that is extremely unlikely to cause any problems in practice, especially since crypto-bigint v0.3 was just released. To be on the safe side though, these changes will immediately be published in a v0.3.1 release, and the current v0.3.0 yanked so as to prevent any potential incompatibilities.

Adds the following bitwise operations:

- `BitAnd`
- `BitOr`
- `BitXor`
- `Shl`
- `Shr`

Additionally adds impls of the `Bit*` traits on `UInt<LIMBS>` directly,
in addition to the existing impls on `Wrapping<UInt<LIMBS>>`.

This is safe because there is no difference between the "wrapping" or
"checked" versions of these operations: they always succeed and there is
no "wrapping" behavior to worry about.

This is debatably a breaking change but one that is extremely unlikely
to cause any problems in practice, especially since `crypto-bigint` v0.3
was just released. To be on the safe side though, these changes will
immediately be published in a v0.3.1 release, and the current v0.3.0
yanked so as to prevent any potential incompatibilities.
@tarcieri tarcieri merged commit 2fca3e1 into master Nov 17, 2021
@tarcieri tarcieri deleted the add-bitwise-ops-to-integer-trait branch November 17, 2021 20:02
@tarcieri tarcieri mentioned this pull request Nov 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant