Skip to content

Commit 7c8270a

Browse files
committed
Merge #566: Improve the README
47aa740 Improve the README files (Tobin C. Harding) Pull request description: Improve the README files Improve the secp256k1 readme by: - ~Use a top level markdown header (level 1)~ Use HTML for header and badges - Add a link to the SECG's website (www.secg.org) - Add a link for `secp256k1` to bitcoin.it explaining the curve Improve the secp256k1-sys readme by: - Use HTML for header and badges (a subset of the badges used in `rust-secp256k1` readme) - Basic cleanup - Use 100 column width - Use backticks - Use capitals ACKs for top commit: apoelstra: ACK 47aa740 Tree-SHA512: 8f818ffcda93424430abd72da68d86215c2313479449775e9851aff854d3691180aadfe5052338c2695d85c6cac32e764c4f789301867407eef64d8c3990ef10
2 parents 5817d32 + 47aa740 commit 7c8270a

File tree

2 files changed

+50
-28
lines changed

2 files changed

+50
-28
lines changed

README.md

+15-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
1-
[![Build Status](https://travis-ci.org/rust-bitcoin/rust-secp256k1.png?branch=master)](https://travis-ci.org/rust-bitcoin/rust-secp256k1)
1+
<div align="center">
2+
<h1>Rust Secp256k1</h1>
23

3-
[Full documentation](https://docs.rs/secp256k1/)
4+
<p>
5+
<a href="https://crates.io/crates/secp256k1"><img alt="Crate Info" src="https://img.shields.io/crates/v/secp256k1.svg"/></a>
6+
<a href="https://github.com/rust-bitcoin/rust-secp256k1/blob/master/LICENSE"><img alt="CC0 1.0 Universal Licensed" src="https://img.shields.io/badge/license-CC0--1.0-blue.svg"/></a>
7+
<a href="https://github.com/rust-bitcoin/rust-secp256k1/actions?query=workflow%3AContinuous%20integration"><img alt="CI Status" src="https://github.com/rust-bitcoin/rust-secp256k1/workflows/Continuous%20integration/badge.svg"></a>
8+
<a href="https://docs.rs/secp256k1"><img alt="API Docs" src="https://img.shields.io/badge/docs.rs-secp256k1-green"/></a>
9+
<a href="https://blog.rust-lang.org/2020/02/27/Rust-1.48.0.html"><img alt="Rustc Version 1.48.0+" src="https://img.shields.io/badge/rustc-1.48.0%2B-lightgrey.svg"/></a>
10+
</p>
11+
</div>
412

5-
## rust-secp256k1
13+
`rust-secp256k1` is a wrapper around [libsecp256k1](https://github.com/bitcoin-core/secp256k1), a C
14+
library implementing various cryptographic functions using the [SECG](https://www.secg.org/) curve
15+
[secp256k1](https://en.bitcoin.it/wiki/Secp256k1).
16+
17+
This library:
618

7-
`rust-secp256k1` is a wrapper around [libsecp256k1](https://github.com/bitcoin-core/secp256k1),
8-
a C library by Pieter Wuille for producing ECDSA signatures using the SECG curve
9-
`secp256k1`. This library
1019
* exposes type-safe Rust bindings for all `libsecp256k1` functions
1120
* implements key generation
1221
* implements deterministic nonce generation via RFC6979

secp256k1-sys/README.md

+35-22
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,51 @@
1-
secp256k1-sys
2-
=============
1+
<div align="center">
2+
<h1>Rust secp256k1-sys</h1>
33

4+
<p>
5+
<a href="https://crates.io/crates/secp256k1-sys"><img alt="Crate Info" src="https://img.shields.io/crates/v/secp256k1-sys.svg"/></a>
6+
<a href="https://github.com/rust-bitcoin/rust-secp256k1/blob/master/LICENSE"><img alt="CC0 1.0 Universal Licensed" src="https://img.shields.io/badge/license-CC0--1.0-blue.svg"/></a>
7+
<a href="https://docs.rs/secp256k1"><img alt="API Docs" src="https://img.shields.io/badge/docs.rs-secp256k1-green"/></a>
8+
<a href="https://blog.rust-lang.org/2020/02/27/Rust-1.48.0.html"><img alt="Rustc Version 1.48.0+" src="https://img.shields.io/badge/rustc-1.48.0%2B-lightgrey.svg"/></a>
9+
</p>
10+
</div>
411

5-
This crate provides Rust definitions for the FFI structures and methods.
6-
12+
Provides low-level bindings to the C FFI exposed by [libsecp256k1](https://github.com/bitcoin-core/secp256k1).
713

814
## Vendoring
915

10-
The default build process is to build using the vendored libsecp256k1 sources in
11-
the depend folder. These sources are prefixed with a special
12-
rust-secp256k1-sys-specific prefix `rustsecp256k1_v1_2_3_`.
16+
The default build process is to build using the vendored `libsecp256k1` sources in the `depend`
17+
directory. These sources are prefixed with a special rust-secp256k1-sys-specific prefix
18+
`rustsecp256k1_v1_2_3_`.
1319

1420
This prefix ensures that no symbol collision can happen:
15-
- when a Rust project has two different versions of rust-secp256k1 in its
16-
depepdency tree, or
17-
- when rust-secp256k1 is used for building a static library in a context where
18-
existing libsecp256k1 symbols are already linked.
19-
20-
To update the vendored sources, use the `vendor-libsecp.sh` script:
2121

22-
```
23-
$ ./vendor-libsecp.sh <rev>
24-
```
22+
- When a Rust project has two different versions of `rust-secp256k1` in its depepdency tree, or
23+
- When `rust-secp256k1` is used for building a static library in a context where existing
24+
`libsecp256k1` symbols are already linked.
2525

26-
Where `<rev>` is the git revision of libsecp256k1 to checkout. If you do not
27-
specify a revision, the script will simply clone the repo and use whatever
28-
revision the default branch is pointing to.
26+
To update the vendored sources, use the `vendor-libsecp.sh` script: `./vendor-libsecp.sh <rev>`
2927

28+
- Where `<rev>` is the git revision of `libsecp256k1` to checkout. If you do not specify a revision,
29+
the script will simply clone the repo and use whatever revision the default branch is pointing to.
3030

3131
## Linking to external symbols
3232

33-
If you want to compile this library without using the bundled symbols (which may
34-
be required for integration into other build systems), you can do so by adding
35-
`--cfg=rust_secp_no_symbol_renaming'` to your `RUSTFLAGS` variable.
33+
**Danger: doing this incorrectly may have catastrophic consequences!**
34+
35+
This is mainly intended for applications consisting of various programming languages that intend to
36+
link the same library to save space, or bundles of multiple binaries coming from the same source. Do
37+
not use this to link to a random secp256k1 library you found in your OS! If you are packaging
38+
software that depends on `rust-secp256k1`, using this flag to link to another package, make sure you
39+
stay within the binary compatibility guarantees of that package. For example, in Debian if you need
40+
`libsecp256k1 1.2.3`, make sure your package requires a version strictly`>= 1.2.3 << 1.2.4`. Note
41+
also that unless you're packaging the library for an official repository you should prefix your
42+
package and the library with a string specific to you. E.g. if you have a set of packages called
43+
`my-awesome-packages` you should package `libsecp256k1` as `libmy-awesome-packages-secp256k1` and
44+
depend on that library/package name from your application.
45+
46+
If you want to compile this library without using the bundled symbols (which may be required for
47+
integration into other build systems), you can do so by adding `--cfg=rust_secp_no_symbol_renaming'`
48+
to your `RUSTFLAGS` variable.
3649

3750
## Minimum Supported Rust Version
3851

0 commit comments

Comments
 (0)