Redundant conditional in ecdsa_impl.h #10811

issue bytting opened this issue on July 12, 2017
  1. bytting commented at 10:07 PM on July 12, 2017: contributor

    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

  2. fanquake commented at 11:41 PM on July 12, 2017: member

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

  3. bytting commented at 11:49 PM on July 12, 2017: contributor

    Okay, that makes sense, thanks

  4. bytting closed this on Jul 12, 2017

  5. MarcoFalke locked this on Sep 8, 2021
Contributors

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-25 06:17 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me