What is OpenSSL still used for?
5 messages, 19 to 25 Jan 2016. Started by Andrew C.
Andrew C, Ethan Heilman, Douglas Roark, Jonas Schnelli, Wladimir J. van der Laan
In the release notes for 0.12, it says that we have moved from using OpenSSL to libsecp256k1 for signature validation. So what else is it being used for that we need to keep it as a dependency?
Thanks, Andrew
I believe libsecp256k1 just performs Elliptic Curve operations required by Bitcoin. OpenSSL is used for all other crypto.
For instance the PRNG appears to be OpenSSL: https://github.com/bitcoin/bitcoin/blob/master/src/random.h
On Mon, Jan 18, 2016 at 8:39 PM, Andrew C via bitcoin-dev <bitcoin-dev@lists•linuxfoundation•org> wrote:
Quoted text (12 lines)
> In the release notes for 0.12, it says that we have moved from using OpenSSL > to libsecp256k1 for signature validation. So what else is it being used for > that we need to keep it as a dependency? > > Thanks, > Andrew > > _______________________________________________ > bitcoin-dev mailing list > bitcoin-dev@lists•linuxfoundation•org > https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev >
On 2016/1/18 19:58, Ethan Heilman via bitcoin-dev wrote:
Quoted text (2 lines)
> I believe libsecp256k1 just performs Elliptic Curve operations > required by Bitcoin. OpenSSL is used for all other crypto.
The exact answer, as I understand it, is a bit more nuanced. In particular, you referenced the PRNG. I believe libsecp256k1, as currently written, relies on an implementation of RFC 6979 instead of using a PRNG. I'm guessing this is done for portability reasons (no need to hook into the OS's RNG).
Otherwise, yes, I believe this answer is basically correct. There are still some crypto functions not covered by libsecp256k1, at least at the API level. But, for consensus-critical functionality, I think 0.12 will be rid of OpenSSL.
- -- - --- Douglas Roark Cryptocurrency, network security, travel, and art. https://onename.com/droark joroark@vt•edu PGP key ID: 26623924
Hi Andrew
Quoted text (3 lines)
> In the release notes for 0.12, it says that we have moved from > using OpenSSL to libsecp256k1 for signature validation. So what > else is it being used for that we need to keep it as a dependency?
Openssl was dropped from the consensus layer (ECC) in 0.12, though, it still used for...
1) ... getting random numbers (randomize the ECC signing context) 2) [wallet only] ... AES256 encryption of private keys 3) [GUI only] ... SSL/X.509 for BIP70 (payment protocol)
Openssl dependency for 1) and 2) could be removed. There are some – outdated – relevant PRs:
Entropy: https://github.com/bitcoin/bitcoin/pull/5885 AES: https://github.com/bitcoin/bitcoin/pull/5949
I guess for point 3) [BIP70] it makes sense to keep openssl.
/jonas
Quoted text (18 lines)
> > In the release notes for 0.12, it says that we have moved from > > using OpenSSL to libsecp256k1 for signature validation. So what > > else is it being used for that we need to keep it as a dependency? > > Openssl was dropped from the consensus layer (ECC) in 0.12, though, it > still used for... > > 1) ... getting random numbers (randomize the ECC signing context) > 2) [wallet only] ... AES256 encryption of private keys > 3) [GUI only] ... SSL/X.509 for BIP70 (payment protocol) > > Openssl dependency for 1) and 2) could be removed. There are some – > outdated – relevant PRs: > > Entropy: https://github.com/bitcoin/bitcoin/pull/5885 > AES: https://github.com/bitcoin/bitcoin/pull/5949 > > I guess for point 3) [BIP70] it makes sense to keep openssl.
Exactly - the plan is that OpenSSL will, in due time, be a dependency only if the GUI is enabled. Most of the work for that is already done but it has to be made up to date and carefully tested and integrated.
Wladimir