Redundant conditional in ecdsa_impl.h #10811

Closed
corebob opened this Issue Jul 12, 2017 · 2 comments

Comments

Projects
None yet
2 participants
Contributor

corebob commented Jul 12, 2017 edited

The following code block can be seen in src/secp256k1/src/ecdsa_impl.h starting at line 83

while (lenleft > 0) {
    if ((ret >> ((sizeof(size_t) - 1) * 8)) != 0) {
    }
    ret = (ret << 8) | **sigp;
    if (ret + lenleft > (size_t)(sigend - *sigp)) {
        /* Result exceeds the length of the passed array. */
        return -1;
    }
    (*sigp)++;
    lenleft--;
}

The conditional if statement at line 84 doesn't appear to have a purpose other than spending cycles

Contributor

fanquake commented Jul 12, 2017

You should submit this issue to the upstream secp256k1 repository https://github.com/bitcoin-core/secp256k1.

Contributor

corebob commented Jul 12, 2017

Okay, that makes sense, thanks

corebob closed this Jul 12, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment