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

crypto-bigint: add initial proptests for equivalence with num-bigint #563

Merged
merged 1 commit into from
Jul 29, 2021

Conversation

tarcieri
Copy link
Member

@tarcieri tarcieri commented Jul 29, 2021

Adds an initial set of property-based tests to check equivalence between crypto_bigint::U256 and num_bigint::BigUint.

I mostly want these for #561, but I figured I could push up an initial integration separately.

@tarcieri tarcieri changed the title crypto-bigint: add init proptests for equivalence with num-bigint crypto-bigint: add initial proptests for equivalence with num-bigint Jul 29, 2021
@@ -44,7 +44,7 @@ impl<const LIMBS: usize> UInt<LIMBS> {

/// Perform wrapping multiplication, discarding overflow.
pub const fn wrapping_mul(&self, rhs: &Self) -> Self {
self.mul_wide(rhs).0
self.mul_wide(rhs).1
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As it were, these tests uncovered a bug

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably should cut a release with this fix and yank the versions with this bug. Even though I've seen this comment, I recently hit this bug and it took me some time to uncover this bug.

@tarcieri
Copy link
Member Author

Ugh, looks like it's breaking due to resolver = "1"-style feature unification

Copy link
Member

@dignifiedquire dignifiedquire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

@tarcieri
Copy link
Member Author

Will need to factor it into a pseudo-crate for now to avoid breaking no_std CI

Adds an initial set of property-based tests to check equivalence between
`crypto_bigint::U256` and `num_bigint::BigUint`.
@tarcieri tarcieri merged commit 0f4dae9 into master Jul 29, 2021
@tarcieri tarcieri deleted the equivalence-proptests branch July 29, 2021 21:37
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.

None yet

3 participants