Export SHA256 functions #447
pull chfast wants to merge 1 commits into bitcoin-core:master from chfast:export-sha256 changing 5 files +61 −53-
chfast commented at 9:51 am on March 13, 2017: none
-
Export SHA256 functions 6cec601d03
-
chfast force-pushed on Mar 13, 2017
-
dcousens approved
-
dcousens commented at 11:00 am on March 21, 2017: contributorutACK
-
laanwj commented at 12:57 pm on March 21, 2017: member
Should SHA256 functions be part of the library’s API? The library is secp256k1, not sha256lib, there are plenty of libraries available that export SHA256.
I think we should avoid exporting internal implementation details. This reduces the flexibility to change things in the future.
-
chfast commented at 1:04 pm on March 21, 2017: noneWhy would you like to have 2 implementations of SHA256 in your codebase if you need both secp256k1 and SHA256? This increases code size and decreases performance.
-
sipa commented at 5:43 pm on March 21, 2017: contributor
Sorry, NACK. libsecp256k1 is a library for elliptic curve crypto, not a generic cryptography library. It has a copy of SHA256 for randomization and a few related algorithms, but it is not optimized in any way. I fear that exposing the function will lead to people demanding that it gets optimized for various purposes and/or platforms, which I don’t think should be the library’s focus.
If code size matters that much to you (SHA256 is only a few kB), perhaps we should provide a way for libsecp256k1 to be compiled using an external SHA256 implementation instead.
-
dcousens commented at 9:24 pm on March 21, 2017: contributor
If code size matters that much to you (SHA256 is only a few kB), perhaps we should provide a way for libsecp256k1 to be compiled using an external SHA256 implementation instead.
For me, supporting exporting SHA256 here was purely for the purposes of ensuring a consistent implementation being used. [not to doubt the quality of any implementation]
Providing the above would resolve my concern.
-
sipa closed this on Mar 21, 2017
-
real-or-random cross-referenced this on Jul 22, 2020 from issue Add schnorrsig module which implements BIP-340 compliant signatures by jonasnick
This is a metadata mirror of the GitHub repository bitcoin-core/secp256k1. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-10-30 03:15 UTC
More mirrored repositories can be found on mirror.b10c.me