Commit f465167
committed
Make the
Downstream projects, such as `bitcoin` are using types from this crate
and need to compile the C code even if they only use the types for
checking validity of the data and don't perform cryptographic
operations. Compiling C code is slow and unreliable so there was desire
to avoid this.
This commit introduces pure Rust implementation of basic
non-cryptographic operations (is point on the curve, decompression of
point, secret key constant time comparisons) and feature-gates
cryptographic operations on `secp256k1-sys` which is now optional. To
make use of this, downstream crates will have to deactivate the feature
and possibly feature gate themselves.
The implementation requires a U256 type which was copied from the
`bitcoin` crate. We don't depend on a common crate to avoid needless
compilation when the feature is turned on.
This is a breaking change because users who did cryptographic operations
with `default-features = false` will get compilation errors until they
enable the feature.-sys crate optional1 parent 6648126 commit f465167
12 files changed
+1397
-370
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
23 | 25 | | |
24 | | - | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
| |||
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
39 | | - | |
| 41 | + | |
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
| |||
57 | 59 | | |
58 | 60 | | |
59 | 61 | | |
60 | | - | |
| 62 | + | |
61 | 63 | | |
62 | 64 | | |
63 | 65 | | |
64 | | - | |
| 66 | + | |
65 | 67 | | |
66 | 68 | | |
67 | 69 | | |
68 | | - | |
| 70 | + | |
69 | 71 | | |
70 | 72 | | |
71 | 73 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
66 | | - | |
67 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
74 | | - | |
75 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| |||
0 commit comments