Gregory Maxwell
8563713a4f
Add non-null and unused-result warnings for the external API.
...
GCC (and clang) supports extensions to annotate functions so that their
results must be used and so that their arguments can't be statically
provable to be null. If a caller violates these requirements they
get a warning, so this helps them write correct code.
I deployed this in libopus a couple years ago with good success, and
the implementation here is basically copied straight from that.
One consideration is that the non-null annotation teaches the optimizer
and will actually compile out runtime non-nullness checks as dead-code.
Since this is usually not whats wanted, the non-null annotations are
disabled when compiling the library itself.
The commit also removes some dead inclusions of assert.h and introduces
compatibility macros for restrict and inline in preparation for some
portability improvements.
10 years ago
Pieter Wuille
8ed7c33cd6
Merge pull request #96
...
6fac238
Use same build template as bitcoin. Add bitcoin_secp.m4. (kiwigb)
f9aac5b
Remove INCLUDES. Obsolete, appears unused anyway. (kiwigb)
db72c18
Add autoreconf warnings. Replace obsolete AC_TRY_COMPILE. Remove redundant checks (already done by LT_INIT). (kiwigb)
10 years ago
Pieter Wuille
28515b8848
Merge pull request #99
...
c27fdc0
Document some preconditions (Pieter Wuille)
10 years ago
Pieter Wuille
c27fdc0b97
Document some preconditions
10 years ago
Pieter Wuille
7ff4770e15
Merge pull request #98
...
fb1bb0b
Rearrange _gej_add_ge to save an _fe_negate (Peter Dettman)
9338dbf
Branch-free point addition (Pieter Wuille)
10 years ago
Peter Dettman
fb1bb0b445
Rearrange _gej_add_ge to save an _fe_negate
10 years ago
Pieter Wuille
9338dbf791
Branch-free point addition
10 years ago
kiwigb
6fac238f03
Use same build template as bitcoin. Add bitcoin_secp.m4.
10 years ago
kiwigb
f9aac5b034
Remove INCLUDES. Obsolete, appears unused anyway.
10 years ago
kiwigb
db72c181bb
Add autoreconf warnings. Replace obsolete AC_TRY_COMPILE.
...
Remove redundant checks (already done by LT_INIT).
10 years ago
Pieter Wuille
ef6f677679
Merge pull request #95
...
79ad6d4
Remove some dead variables in the tests. (Gregory Maxwell)
9974d86
Misc. Warning and cosmetic error cleanups. (Gregory Maxwell)
10 years ago
Pieter Wuille
985fd63a73
Merge pull request #77
...
1d52a8b
Implementations for scalar without data-dependent branches. (Pieter Wuille)
10 years ago
Gregory Maxwell
79ad6d44ea
Remove some dead variables in the tests.
10 years ago
Gregory Maxwell
9974d8693e
Misc. Warning and cosmetic error cleanups.
...
This fixes a cosmetic precedence bug in the tests along with some
type warnings.
It also adds a dummy cast to the CHECK macro to avoid hundreds
of statement with no effect warnings on compilers that warn about
such things.
10 years ago
Pieter Wuille
1d52a8b155
Implementations for scalar without data-dependent branches.
10 years ago
Pieter Wuille
0ce80ef47e
Merge pull request #94
...
da55986
Label variable-time functions correctly and don't use those in sign (Pieter Wuille)
10 years ago
Pieter Wuille
da55986fdf
Label variable-time functions correctly and don't use those in sign
10 years ago
Pieter Wuille
784e62f3b2
Fix typo
10 years ago
Pieter Wuille
aee112a24e
Merge pull request #92
...
137e77a
Address 'constant-time' TODOs in field impls (Peter Dettman)
10 years ago
Peter Dettman
137e77afb4
Address 'constant-time' TODOs in field impls
10 years ago
Pieter Wuille
112510dfab
Merge pull request #93
...
5362875
warnings: enable quiet builds (Cory Fields)
10 years ago
Cory Fields
53628757f3
warnings: enable quiet builds
10 years ago
Pieter Wuille
cc20075ef7
Merge pull request #85
...
7a8e385
Fix interaction between magnitudes and negation (Pieter Wuille)
10 years ago
Pieter Wuille
47ebd6b7fa
Merge pull request #89
...
501d58f
Get rid of {num,scalar,ecdsa_sig}_{init,free} (Pieter Wuille)
10 years ago
Pieter Wuille
501d58f098
Get rid of {num,scalar,ecdsa_sig}_{init,free}
10 years ago
Pieter Wuille
49596769d4
Merge pull request #70
...
e2d66a2
Fix build for 64bit field under OSX (Peter Dettman)
10 years ago
Peter Dettman
e2d66a2c62
Fix build for 64bit field under OSX
...
- caused by 8881212ebc
- OSX's ar tool doesn't work for empty archives ("ar: no archive members specified")
- introduce COMMON_LIB variable; leave empty when not using asm
10 years ago
Pieter Wuille
7a8e385d74
Fix interaction between magnitudes and negation
...
Magnitude m means values are allowed to be up to 2 * 0xFFF...FFF * m,
while the argument passed to secp256k1_fe_negate didn't take the 2 into
account. Fix this.
10 years ago
Pieter Wuille
b0295868f4
Merge pull request #82
...
8f9a307
Better .gitignore for bench binaries (Pieter Wuille)
fa5c13f
Add bench_sign tool (Pieter Wuille)
10 years ago
Pieter Wuille
36abcf5510
Merge pull request #83
...
7d681ac
Add verification to 32bit field (Peter Dettman)
10 years ago
Pieter Wuille
8f9a307818
Better .gitignore for bench binaries
10 years ago
Peter Dettman
7d681ac636
Add verification to 32bit field
...
- implement _fe_verify for 10x26
- fe is normalized after _fe_clear
- a few corresponding changes in 64bit field
10 years ago
Pieter Wuille
fa5c13ff4c
Add bench_sign tool
10 years ago
Pieter Wuille
27aded3ccb
Merge pull request #80
...
504c63d
Rename bench to bench_verify (Pieter Wuille)
01097dd
Make bench deterministic (Pieter Wuille)
10 years ago
Pieter Wuille
504c63d72a
Rename bench to bench_verify
10 years ago
Pieter Wuille
01097ddf19
Make bench deterministic
10 years ago
Pieter Wuille
81dc171604
Merge pull request #79
...
ae2679b
Add bench_inv tool (Pieter Wuille)
10 years ago
Pieter Wuille
66002cfa87
Merge pull request #78
...
520ba3c
Remove OpenSSL bignum implementation (Pieter Wuille)
10 years ago
Pieter Wuille
520ba3c921
Remove OpenSSL bignum implementation
10 years ago
Pieter Wuille
ae2679b6e4
Add bench_inv tool
10 years ago
Pieter Wuille
9c698f16d6
Merge pull request #76
...
7935930
Add unit tests for scalars. (Pieter Wuille)
eca6cdb
Switch scalar to use get/set 32-byte arrays (Pieter Wuille)
10 years ago
Pieter Wuille
79359302fb
Add unit tests for scalars.
...
Also add a secp256k1_scalar_is_one function.
10 years ago
Pieter Wuille
eca6cdb123
Switch scalar to use get/set 32-byte arrays
10 years ago
Pieter Wuille
774594e979
Merge pull request #75
...
a9f5c8b
Introduce secp256k1_scalar_t for future constant-time mod order operations (Pieter Wuille)
10 years ago
Pieter Wuille
a9f5c8b875
Introduce secp256k1_scalar_t for future constant-time mod order operations
10 years ago
Pieter Wuille
b2bfdabdeb
Merge pull request #72
...
eb74c36
Abstract out tweak logic to secp256k1_eckey_* functions (Pieter Wuille)
ffffc87
Use internal secp256k1_eckey_ prefix for functions in eckey (Pieter Wuille)
e2f71f1
Move non-ECDSA operations from ecdsa to eckey (Pieter Wuille)
ae6bc76
[API CHANGE] Use secp256k1_ec_ prefix for non-ECDSA key operations (Pieter Wuille)
10 years ago
Pieter Wuille
eb74c36bd2
Abstract out tweak logic to secp256k1_eckey_* functions
10 years ago
Pieter Wuille
ffffc87855
Use internal secp256k1_eckey_ prefix for functions in eckey
10 years ago
Pieter Wuille
e2f71f1efe
Move non-ECDSA operations from ecdsa to eckey
10 years ago
Pieter Wuille
ae6bc76e32
[API CHANGE] Use secp256k1_ec_ prefix for non-ECDSA key operations
10 years ago