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

Increase robustness against UB in secp256k1_scalar_cadd_bit #647

Merged
merged 2 commits into from
Oct 28, 2019

Commits on Jul 5, 2019

  1. Increase robustness against UB.

    Thanks to elichai2 who noted that the literal '1' is a signed integer, and that shifting a signed 32-bit integer by 31 bits causes an overflow and yields undefined behaviour.
    While 'scalar_low_impl''s 'secp256k1_scalar_cadd_bit' is only used for testing purposes and currently the 'bit' parameter is only 0 or 1, it is better to avoid undefined behaviour in case the used domain of 'secp256k1_scalar_cadd_bit' expands.
    roconnor-blockstream committed Jul 5, 2019
    Configuration menu
    Copy the full SHA
    8fe63e5 View commit details
    Browse the repository at this point in the history

Commits on Aug 7, 2019

  1. Improve VERIFY_CHECK of overflow in secp256k1_scalar_cadd_bit.

    This added check ensures that any curve order overflow doesn't go undetected due a uint32_t overflow.
    roconnor-blockstream committed Aug 7, 2019
    Configuration menu
    Copy the full SHA
    0d82732 View commit details
    Browse the repository at this point in the history