Skip to content

Commit

Permalink
bindings/rust/README.md: clarify the Rust version support.
Browse files Browse the repository at this point in the history
  • Loading branch information
dot-asm committed Oct 16, 2023
1 parent 47bc240 commit b125f20
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions bindings/rust/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,15 @@ If the target application crashes with an "illegal instruction" exception [after

To compile for WebAssembly, your clang has to recognize `--target=wasm32`. Alternatively you can build your project with `CC` environment variable set to `emcc`, the [Emscripten compiler](https://emscripten.org), and `AR` set to `emar`, naturally, with both commands available on your `PATH`.

While `cargo test`'s dependencies happen to require at least Rust 1.56, the library by itself can be compiled with earlier compiler versions. Though it takes some version pinning in the dependent's Cargo.toml, `zeroize` to "=1.3.0" and `zeroize_derive` to "=1.3.3".
While `cargo test`'s dependencies happen to require at least Rust 1.65, the library by itself can be compiled with earlier compiler versions. Though in order to use Rust version prior 1.56 you would need to pin`zeroize` to "=1.3.0" and `zeroize_derive` to "=1.3.3" in **your** project Cargo.toml. And if you find yourself with Rust 1.56 through 1.64 as the only option and want to execute `cargo test` you'd need to pin some of `[dev-dependencies]` versions in **this** project's Cargo.toml:

```
csv = "=1.1.6"
byteorder = "=1.4.3"
regex = "=1.7.3"
rayon = "=1.6.1"
rayon-core = "=1.10.1"
```

## Usage
There are two primary modes of operation that can be chosen based on declaration path:
Expand Down Expand Up @@ -56,7 +64,7 @@ let msg = b"blst is such a blast";
let sig = sk.sign(msg, dst, &[]);

let err = sig.verify(true, msg, dst, &[], &pk, true);
assert_eq!(err, blst:BLST_ERROR::BLST_SUCCESS);
assert_eq!(err, blst::BLST_ERROR::BLST_SUCCESS);
```

See the tests in src/lib.rs and benchmarks in benches/blst_benches.rs for further examples of usage.

0 comments on commit b125f20

Please sign in to comment.