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

Remove the min(max( construction for the ct_exponent argument #840

Merged
merged 1 commit into from Mar 25, 2020

Conversation

@stevenroose
Copy link
Member

stevenroose commented Mar 24, 2020

As per @dgpv's suggestion here: #834 (comment)

@dgpv could you review?

We removed the similar construction for ct_bits in an earlier commit.
The construction is to keep the value between -1 and 18. This kind of
means that a user that inputs a value outside that range will not get an
error, but will use the value on the edge of the range instead.

It's probably better to return an error (generated by secp256k1) in the
case of invalid input.
@dgpv

This comment has been minimized.

Copy link
Contributor

dgpv commented Mar 24, 2020

Looks good to me, this makes the code consistent in that both ct_bits and ct_exponent are not restricted and the expectation being that secp256k1_rangeproof_sign will just fail if incorrect values are set to these parameters.

@stevenroose stevenroose merged commit 3c029f4 into ElementsProject:master Mar 25, 2020
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@stevenroose

This comment has been minimized.

Copy link
Member Author

stevenroose commented Mar 25, 2020

Thanks! Could you review the backport as well: #841

stevenroose added a commit that referenced this pull request Mar 31, 2020
…ct_exponent argument

35c83bd Remove the min(max( construction for the ct_exponent argument (Steven Roose)

Pull request description:

  Backport of #840.

  @dgpv Could you review again?

Tree-SHA512: e212bc04e314bfd8a8e7b7c9c3d5620ad1b6f603706cc038136a655ab729f49c3430f70b0a9baa2d04a2e0bdc9e0aaced413d3cb0d4a424e386b50322b958dc2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.