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

Rename BigInteger::add_nocarry and sub_noborrow and add tests #383

Merged
merged 6 commits into from
Feb 1, 2022

Conversation

alexander-zw
Copy link
Collaborator

@alexander-zw alexander-zw commented Jan 31, 2022

Description

  • Rename BigInteger::add_nocarry to add_with_carry and sub_noborrow to sub_with_borrow.
  • Add assertions for the carry and borrow bits for biginteger addition and subtraction, as well as simple multiplication tests.
  • Run fmt.

I did not rename the functions in arithmetic.rs, because those functions seem to actually ignore the carry and borrow bits.

closes: #335, #336


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (master)
  • Linked to GitHub issue with discussion and accepted design OR have an explanation in the PR that describes this work.
  • Wrote unit tests
  • Updated relevant documentation in the code
  • Added a relevant changelog entry to the Pending section in CHANGELOG.md
  • Re-reviewed Files changed in the GitHub PR explorer

@alexander-zw alexander-zw self-assigned this Jan 31, 2022
@alexander-zw alexander-zw added breaking-change This PR contains a breaking change T-test Type: test improvements labels Jan 31, 2022
ff/src/biginteger/mod.rs Outdated Show resolved Hide resolved
ff/src/biginteger/mod.rs Outdated Show resolved Hide resolved
@Pratyush Pratyush merged commit 08c4cdb into arkworks-rs:master Feb 1, 2022
@alexander-zw alexander-zw deleted the rename-bigint branch February 1, 2022 23:08
@@ -721,7 +722,8 @@ pub trait BigInteger:
/// ```
fn add_with_carry(&mut self, other: &Self) -> bool;

/// Mutably subtract another bigint representation from this one, returning
/// Subtract another [`BigInteger`] from this one. This method stores the result in
/// `self`, and returns a borrow.
/// the borrow bit.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Uh typo?

@Pratyush Pratyush linked an issue Sep 2, 2022 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change This PR contains a breaking change T-test Type: test improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rename BigInteger::sub_noborrow Rename BigInteger::add_nocarry
2 participants