Commit Graph

17 Commits

Author SHA1 Message Date
Dimitris Apostolou 07aa4c70ff
Fix insecure links 2020-12-18 00:24:22 +02:00
Jonas Nick eabd9bc46a Allow initializing tagged sha256
This will be used by the schnorrsig module
2020-09-06 19:00:03 +00:00
Tim Ruffing 0dccf98a21 Use preprocessor macros instead of autoconf to detect endianness
This does not fix any particular issue but it's preferable to not
rely on autoconf. This avoids endianness mess for users on BE hosts
if they use their build without autoconf.

The macros are carefully written to err on the side of the caution,
e.g., we #error if the user manually configures a different endianness
than what we detect.
2020-08-11 11:25:39 +02:00
Tim Ruffing ec8f20babd Avoid out-of-bound pointers and integer overflows in size comparisons
This changes pointer calculations in size comparions to a form that
ensures that no out-of-bound pointers are computed, because even their
computation yields undefined behavior.
Also, this changes size comparions to a form that ensures that neither
the left-hand side nor the right-hand side can overflow.
2019-05-23 15:22:29 +02:00
Thomas Snider c7680e570f Reduce usage of hardcoded size constants 2017-11-16 13:09:05 -08:00
Pieter Wuille d1dc9dfc0a Get rid of reserved _t in type names 2017-09-27 15:03:20 -07:00
Dan Raviv abe2d3e84b Fix header guards using reserved identifiers
Identifiers starting with an underscore and followed immediately by a capital letter are reserved by the C++ standard.

The only header guards not fixed are those in the headers auto-generated from java.
2017-08-26 18:44:21 +03:00
Kirill Fomichev 3f8b78e5e9 Fix undefs in hash_impl.h 2016-05-21 10:18:57 +03:00
Pieter Wuille 3e6f1e20dc Change rfc6979 implementation to be a generic PRNG 2015-07-24 22:07:14 +02:00
Gregory Maxwell 33270bff87 Add a couple comments pointing to particular sections of RFC6979. 2015-03-28 00:43:15 +00:00
Gregory Maxwell 2632019713 Brace all the if/for/while.
Unbraced statements spanning multiple lines has been shown in many
 projects to contribute to the introduction of bugs and a failure
 to catch them in review, especially for maintenance on infrequently
 modified code.

Most, but not all, of the existing practice in the codebase were not
 cases that I would have expected to eventually result in bugs but
 applying it as a rule makes it easier for other people to safely
 contribute.

I'm not aware of any such evidence for the case with the statement
 on a single line, but some people strongly prefer to never do that
 and the opposite rule of "_always_ use a single line for single
 statement blocks" isn't a reasonable rule for formatting reasons.
 Might as well brace all these too, since that's more universally
 acceptable.

[In any case, I seem to have introduced the vast majority of the
 single-line form (as they're my preference where they fit).]

This also removes a broken test which is no longer needed.
2015-03-27 23:24:32 +00:00
Pieter Wuille 1573a102c0 Add ability to pass extra entropy to rfc6979
Suggested by Greg Maxwell.
2015-03-23 05:39:56 -07:00
Pieter Wuille ae55e850c7 Use faster byteswapping and avoid alignment-increasing casts. 2015-02-23 04:58:58 -08:00
Pieter Wuille 039723d5da Benchmarks for all internal operations 2015-02-02 20:02:39 -08:00
Gregory Maxwell 792bcdb015 Covert several more files to C89. 2015-01-24 23:34:09 +00:00
Gregory Maxwell 3627437d80 C89 nits and dead code removal. 2015-01-23 04:17:12 +00:00
Pieter Wuille b37fbc280e Implement SHA256 / HMAC-SHA256 / RFC6979. 2014-12-20 14:36:13 +01:00