Skip to content

Commit

Permalink
feat(crypto): document package feature flags
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfertel committed Mar 13, 2024
1 parent f92253d commit 53ec792
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 deletions.
11 changes: 6 additions & 5 deletions GUIDELINES.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ This is enforced by `rustfmt`. Note that this is a `nightly` feature.

### Variable naming

Use short 1-letter names when the variable scope is only a few lines, or the context is
Use short 1-letter names when the variable scope is only a few lines, or the
context is
obvious, eg.

```rust
Expand Down Expand Up @@ -148,10 +149,10 @@ and/or object and repeating that would be redundant.

## Dependencies

Before adding any code dependencies, check with the maintainers if this is okay.
In general, we try not to add external dependencies unless it's necessary.
Dependencies increase counter-party risk, build-time, attack surface, and
make code harder to audit.
Before adding any code dependencies, check with the maintainers if this is
okay. In general, we try not to add external dependencies unless it's
necessary. Dependencies increase counter-party risk, build-time, attack
surface, and make code harder to audit.

We also optimize for binary size, which means we try to keep generated code to
a minimum and adding dependencies is one of the biggest sources of code bloat.
Expand Down
6 changes: 4 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Security

> ⚠️ Warning! ⚠️
> This project is still in a very early and experimental phase. It has never been audited nor thoroughly reviewed for security vulnerabilities. Do not use in production.
> [!WARNING]
> This project is still in a very early and experimental phase. It has never
> been audited nor thoroughly reviewed for security vulnerabilities. Do not use
> in production.
Please report any security issues you find to [email protected].
15 changes: 11 additions & 4 deletions lib/crypto/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,24 @@

Common cryptographic procedures for a blockchain environment.

> [!WARNING] `crypto` is still `0.*.*`, so breaking changes
> [!WARNING]
> Note that `crypto` is still `0.*.*`, so breaking changes
> [may occur at any time](https://semver.org/#spec-item-4). If you must depend
> on `crypto`, we recommend pinning to a specific version, i.e., `=0.y.z`.
## Verifying Merkle Proofs

[`merkle.rs`](lib/crypto/src/merkle.rs) provides:

* A `verify` function which can prove that some value is part of a [Merkle tree].
* A `verify_multi_proof` function which can prove multiple values are part of a [Merkle tree].
- A `verify` function which can prove that some value is part of a
[Merkle tree].
- A `verify_multi_proof` function which can prove multiple values are part of a
[Merkle tree].

[Merkle tree]: https://en.wikipedia.org/wiki/Merkle_tree

TODO: Document feature flags.
## Feature Flags

This crate exposes its modules behind feature gates to ensure the bare minimum
is included in consumer condebases. You can check the current feature flags in
the [Cargo.toml](./Cargo.toml) file.

0 comments on commit 53ec792

Please sign in to comment.