Skip to content

Commit ac1e50a

Browse files
committed
style(README.md): apply formatter to README.md
1 parent 6ede852 commit ac1e50a

File tree

1 file changed

+60
-75
lines changed

1 file changed

+60
-75
lines changed

README.md

+60-75
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,50 @@
1-
liboqs-rust: Rust bindings for liboqs
2-
=====================================
1+
# liboqs-rust: Rust bindings for liboqs
32

43
[![Build status](https://github.com/open-quantum-safe/liboqs-rust/workflows/Continuous%20integration/badge.svg)](https://github.com/open-quantum-safe/liboqs-rust/actions?query=workflow%3A"Continuous+integration")
54

6-
| crate | crates.io | docs.rs | License |
7-
|--------- |--------------------------------------------------------------------------------------------- |--------------------------------------------------------------------------------------------------- |----------------------------------------------------- |
8-
| oqs-sys | [ ![crates.io](https://img.shields.io/crates/v/oqs-sys)](https://crates.io/crates/oqs-sys) | [![crates.io/docs](https://img.shields.io/docsrs/oqs-sys)](https://docs.rs/crate/oqs-sys/latest/) | ![License](https://img.shields.io/crates/l/oqs-sys) |
9-
| oqs | [![crates.io](https://img.shields.io/crates/v/oqs)](https://crates.io/crates/oqs) | [![crates.io/docs](https://img.shields.io/docsrs/oqs)](https://docs.rs/crate-oqs/latest/) | ![License](https://img.shields.io/crates/l/oqs) |
5+
| crate | crates.io | docs.rs | License |
6+
| ------- | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------- | --------------------------------------------------- |
7+
| oqs-sys | [ ![crates.io](https://img.shields.io/crates/v/oqs-sys)](https://crates.io/crates/oqs-sys) | [![crates.io/docs](https://img.shields.io/docsrs/oqs-sys)](https://docs.rs/crate/oqs-sys/latest/) | ![License](https://img.shields.io/crates/l/oqs-sys) |
8+
| oqs | [![crates.io](https://img.shields.io/crates/v/oqs)](https://crates.io/crates/oqs) | [![crates.io/docs](https://img.shields.io/docsrs/oqs)](https://docs.rs/crate-oqs/latest/) | ![License](https://img.shields.io/crates/l/oqs) |
109

1110
**liboqs-rust** offers two Rust wrappers for the [Open Quantum Safe](https://openquantumsafe.org/) [liboqs](https://github.com/open-quantum-safe/liboqs/) C library, which is a C library for quantum-resistant cryptographic algorithms.
1211

13-
* The ``oqs-sys`` crate compiles and builds ``liboqs`` and generates ``unsafe`` bindings to the C library.
14-
* The ``oqs`` crate offers a Rust-style safe interface to the schemes included in ``liboqs``.
12+
- The `oqs-sys` crate compiles and builds `liboqs` and generates `unsafe` bindings to the C library.
13+
- The `oqs` crate offers a Rust-style safe interface to the schemes included in `liboqs`.
1514

16-
Versioning
17-
----------
15+
## Versioning
1816

1917
The version numbers follow the upstream `liboqs` versions, but with a twist.
2018
The `liboqs` version `0.7.2` gets released as the `oqs` and `oqs-sys` version `0.7.2xx` series.
2119
This allows us to release patch versions of the Rust bindings as `0.7.201`, `0.7.202`, and so on.
2220

23-
Pre-requisites
24-
--------------
21+
## Pre-requisites
2522

26-
``oqs-sys`` depends on the [liboqs](https://github.com/open-quantum-safe/liboqs) C library.
27-
It will build ``liboqs`` automatically.
23+
`oqs-sys` depends on the [liboqs](https://github.com/open-quantum-safe/liboqs) C library.
24+
It will build `liboqs` automatically.
2825

29-
Contents
30-
--------
26+
## Contents
3127

3228
This crate provides unsafe `ffi` bindings in the `oqs-sys` crate, and safe wrappers are offered via the `oqs` crate.
3329
The rendered rustdoc documentation can be [found here](https://open-quantum-safe.github.io/liboqs-rust/oqs/)
3430

35-
Usage
36-
-----
31+
## Usage
3732

38-
Update your ``Cargo.toml`` and include ``oqs``:
33+
Update your `Cargo.toml` and include `oqs`:
3934

4035
```toml
4136
[dependencies]
4237
oqs = "*"
4338
```
4439

45-
``oqs-sys`` can be specified equivalently.
40+
`oqs-sys` can be specified equivalently.
4641

47-
Minimal builds
48-
--------------
42+
## Minimal builds
4943

5044
The default-on `kems` and `sigs` features turn on all supported KEMs and signature schemes. If you want a smaller build, turn off these default features and opt-in to individual algorithms.
5145
Note that if you specify `default-features = false`, you may also want to re-include the `oqs-sys/openssl` feature.
5246

53-
Vendored `liboqs`
54-
-----------------
47+
## Vendored `liboqs`
5548

5649
By default `oqs-sys` attempts to find a system-provided version of `liboqs` and build against it,
5750
falling back to vendored from-source build otherwise.
@@ -60,19 +53,17 @@ You can opt into forcing the vendored build by enabling the `vendored` feature.
6053
Otherwise, if you want to force using the system-provided `liboqs`,
6154
you can set the `LIBOQS_NO_VENDOR=1` environment variable and the build will fail if the library is not found.
6255

63-
Serde support
64-
-------------
56+
## Serde support
6557

66-
You can enable ``serde`` serialization support by enabling the ``serde`` feature on the ``oqs`` crate.
58+
You can enable `serde` serialization support by enabling the `serde` feature on the `oqs` crate.
6759

68-
``std`` support
69-
----------------
60+
## `std` support
7061

71-
The ``oqs-sys`` crate does not use `std` at all.
72-
Note that the default features do enable building liboqs with ``openssl``, so use ``default-features = false``.
62+
The `oqs-sys` crate does not use `std` at all.
63+
Note that the default features do enable building liboqs with `openssl`, so use `default-features = false`.
7364

74-
To make ``oqs`` a ``#![no_std]`` crate make sure the ``std`` feature is disabled.
75-
Make sure to also disable the ``oqs-sys/openssl`` feature by specifying ``default-features = false``.
65+
To make `oqs` a `#![no_std]` crate make sure the `std` feature is disabled.
66+
Make sure to also disable the `oqs-sys/openssl` feature by specifying `default-features = false`.
7667

7768
As `default-features` includes the `kems` and `sigs` features, consider re-adding them as well. This results into:
7869

@@ -87,41 +78,36 @@ You will probably want to change the random-number generator through the [`OQS_R
8778

8879
[`OQS_RAND` API]: https://open-quantum-safe.github.io/liboqs-rust/oqs_sys/rand/index.html
8980

90-
``non_portable`` feature
91-
------------------------
81+
## `non_portable` feature
9282

93-
If compiled with the ``non_portable`` feature, ``liboqs-sys`` will not enable CPU feature detection and
83+
If compiled with the `non_portable` feature, `liboqs-sys` will not enable CPU feature detection and
9484
always use the best implementation on your current platform. This enables support for implementations
9585
where feature detection is not functional.
9686

97-
Stack usage
98-
-----------
87+
## Stack usage
9988

100-
Some algorithms use large amounts of stack space. This means that you may need to specify ``RUST_MIN_STACK`` in your environment.
89+
Some algorithms use large amounts of stack space. This means that you may need to specify `RUST_MIN_STACK` in your environment.
10190
This for example affects tests.
10291

103-
Algorithm features
104-
------------------
105-
106-
* `kems` (default): Compile with all KEMs enabled
107-
* `bike`
108-
* `classic_mceliece`
109-
* `frodokem`
110-
* `hqc`
111-
* `kyber`
112-
* `ntru`
113-
* `ntruprime`
114-
* `saber`
115-
* `sigs` (default): Compile with all signature schemes enabled
116-
* `dilithium`
117-
* `falcon`
118-
* `picnic`
119-
* `rainbow`
120-
* `sphincs`: SPHINCS+
121-
122-
123-
Running
124-
-------
92+
## Algorithm features
93+
94+
- `kems` (default): Compile with all KEMs enabled
95+
- `bike`
96+
- `classic_mceliece`
97+
- `frodokem`
98+
- `hqc`
99+
- `kyber`
100+
- `ntru`
101+
- `ntruprime`
102+
- `saber`
103+
- `sigs` (default): Compile with all signature schemes enabled
104+
- `dilithium`
105+
- `falcon`
106+
- `picnic`
107+
- `rainbow`
108+
- `sphincs`: SPHINCS+
109+
110+
## Running
125111

126112
```rust
127113
/// # Example: Some signed KEX
@@ -157,28 +143,29 @@ fn main() -> Result<()> {
157143
}
158144
```
159145

160-
161-
Adding new algorithms
162-
---------------------
146+
## Adding new algorithms
163147

164148
### KEMs
165149

166150
1. Update the Git submodule
167151
2. `oqs-sys` will now update when you build again
168-
3. Add it to the ``implement_kems!`` macro call in ``oqs/src/kem.rs``:
169-
- The structure is a name for the algorithm in CamelCase, and the name of the constant of the algorithm (``OQS_KEM_alg_...``)
152+
3. Add it to the `implement_kems!` macro call in `oqs/src/kem.rs`:
153+
154+
- The structure is a name for the algorithm in CamelCase, and the name of the constant of the algorithm (`OQS_KEM_alg_...`)
155+
170156
4. Add the necessary features to `Cargo.toml` and `oqs-sys/build.rs`.
171157

172158
### Signature schemes:
173159

174160
1. Update the Git submodule
175161
2. `oqs-sys` is now up-to-date when you build again
176-
3. Add it to ``implement_sigs!`` macro call in ``oqs/src/sig.rs``.
177-
- The structure is a name for the algorithm in CamelCase, and the name of the constant of the algorithm (``OQS_SIG_alg_...``)
162+
3. Add it to `implement_sigs!` macro call in `oqs/src/sig.rs`.
163+
164+
- The structure is a name for the algorithm in CamelCase, and the name of the constant of the algorithm (`OQS_SIG_alg_...`)
165+
178166
4. Add the necessary features to `Cargo.toml` and `oqs-sys/build.rs`.
179167

180-
Limitations and security
181-
------------------------
168+
## Limitations and security
182169

183170
liboqs is designed for prototyping and evaluating quantum-resistant cryptography. Security of proposed quantum-resistant algorithms may rapidly change as research advances, and may ultimately be completely insecure against either classical or quantum computers.
184171

@@ -188,15 +175,13 @@ We acknowledge that some parties may want to begin deploying post-quantum crypto
188175

189176
Just like liboqs, liboqs-rust is provided "as is", without warranty of any kind. See [LICENSE-MIT](https://github.com/open-quantum-safe/liboqs-rust/blob/main/LICENSE-MIT) for the full disclaimer.
190177

191-
License
192-
-------
178+
## License
193179

194180
liboqs-rust is dual-licensed under the MIT and Apache-2.0 licenses.
195181

196-
The included library ``liboqs`` is covered by the [``liboqs`` license](https://github.com/open-quantum-safe/liboqs/blob/main/LICENSE.txt).
182+
The included library `liboqs` is covered by the [`liboqs` license](https://github.com/open-quantum-safe/liboqs/blob/main/LICENSE.txt).
197183

198-
Team
199-
----
184+
## Team
200185

201186
The Open Quantum Safe project is led by [Douglas Stebila](https://www.douglas.stebila.ca/research/) and [Michele Mosca](http://faculty.iqc.uwaterloo.ca/mmosca/) at the University of Waterloo.
202187

0 commit comments

Comments
 (0)