Skip to content
This repository was archived by the owner on Feb 15, 2024. It is now read-only.

Remove OpenSSL dependency#95

Merged
jgarzik merged 2 commits into
jgarzik:masterfrom
aido:fortuna
Dec 21, 2016
Merged

Remove OpenSSL dependency#95
jgarzik merged 2 commits into
jgarzik:masterfrom
aido:fortuna

Conversation

@aido
Copy link
Copy Markdown
Contributor

@aido aido commented Dec 6, 2016

Hi,

This pull request removes the OpenSSL dependency. The OpenSSL RAND_bytes functionality is replaced with an implementation of Fortuna PRNG based on code from the PostgreSQL database project.
http://www.postgres.org/

A few builds are failing in Travis (see issue #91) but this is fixed in pull request #94.

With this pull request picocoin now has two implementations of AES. The ctaes.c code used by the wallet and rijndael.c code used by Fortuna. For now it was easy to just add the rijndael.c code for Fortuna but this may be changed in the future so that there is just a single AES implemetaion used by both Fortuna and the wallet.

@coveralls
Copy link
Copy Markdown

coveralls commented Dec 6, 2016

Coverage Status

Coverage decreased (-8.6%) to 70.805% when pulling a15680e on aido:fortuna into 81bb7ab on jgarzik:master.

@aido aido force-pushed the fortuna branch 2 times, most recently from eaed5a7 to 067cfd4 Compare December 7, 2016 02:09
@coveralls
Copy link
Copy Markdown

coveralls commented Dec 7, 2016

Coverage Status

Coverage decreased (-6.5%) to 72.952% when pulling eaed5a7 on aido:fortuna into 81bb7ab on jgarzik:master.

@coveralls
Copy link
Copy Markdown

coveralls commented Dec 7, 2016

Coverage Status

Coverage decreased (-6.5%) to 72.955% when pulling 067cfd4 on aido:fortuna into 81bb7ab on jgarzik:master.

@coveralls
Copy link
Copy Markdown

coveralls commented Dec 7, 2016

Coverage Status

Coverage decreased (-6.4%) to 73.05% when pulling 45716c5 on aido:fortuna into 81bb7ab on jgarzik:master.

@jgarzik
Copy link
Copy Markdown
Owner

jgarzik commented Dec 8, 2016

Concept ACK

Seems like valgrind and aes-util tests are failing, triggering a Travis failure.

@aido
Copy link
Copy Markdown
Contributor Author

aido commented Dec 8, 2016

Hi Jeff,

Yes, these tests are failing because of issue highlighted in #91. They should be fixed in pull request #94.

I have also written a test to check just how random the new PRNG actually is. It performs the same tests as the ent utility (https://www.fourmilab.ch/random/). However, I am finding that due to the nature of PRNGs this test randomly fails so I have made it an optional test by setting FORCE_PRNG_VERF=1.

The test currently gives the following output, which looks positive:

Entropy:
========
Entropy = 8.000000 bits per byte.

Optimum compression would reduce the size
of this 536870912 byte input by 0 percent.

Chi-square Test:
================
Chi square distribution for 536870912 samples is 264.59, and randomly
would exceed this value 32.68 percent of the times.

Arithmetic Mean:
================
Arithmetic mean value of data bytes is 127.4962 (127.5 = random).

Monte Carlo Value for Pi:
=========================
Monte Carlo value for Pi is 3.141875994 (error 0.01 percent).

Serial Correlation Coefficient:
===============================
Serial correlation coefficient is 0.000044 (totally uncorrelated = 0.0).

See https://www.fourmilab.ch/random/ for detailed description of output.
Repeatedly running the test does not always give as favorable results as above.

Also, the PRNG can easily be expanded with other sources of entropy in the future.

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage decreased (-6.2%) to 73.217% when pulling 310456f on aido:fortuna into 81bb7ab on jgarzik:master.

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage decreased (-7.9%) to 71.508% when pulling c22ecf2 on aido:fortuna into 81bb7ab on jgarzik:master.

1 similar comment
@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage decreased (-7.9%) to 71.508% when pulling c22ecf2 on aido:fortuna into 81bb7ab on jgarzik:master.

@aido aido force-pushed the fortuna branch 2 times, most recently from bd13d53 to f848b4c Compare December 18, 2016 00:49
@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage decreased (-7.5%) to 71.916% when pulling bd13d53 on aido:fortuna into 81bb7ab on jgarzik:master.

1 similar comment
@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage decreased (-7.5%) to 71.916% when pulling bd13d53 on aido:fortuna into 81bb7ab on jgarzik:master.

@coveralls
Copy link
Copy Markdown

coveralls commented Dec 18, 2016

Coverage Status

Coverage decreased (-7.5%) to 71.916% when pulling f848b4c on aido:fortuna into 81bb7ab on jgarzik:master.

@aido aido force-pushed the fortuna branch 5 times, most recently from 6fb0d7d to c7bb0a7 Compare December 18, 2016 05:39
@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage decreased (-7.5%) to 71.923% when pulling c7bb0a7 on aido:fortuna into 81bb7ab on jgarzik:master.

@coveralls
Copy link
Copy Markdown

coveralls commented Dec 18, 2016

Coverage Status

Coverage decreased (-7.4%) to 72.013% when pulling c7bb0a7 on aido:fortuna into 81bb7ab on jgarzik:master.

@aido aido force-pushed the fortuna branch 2 times, most recently from 12167ac to d0a8926 Compare December 18, 2016 23:12
@jgarzik jgarzik merged commit 3c3d504 into jgarzik:master Dec 21, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants