This library implements the Skip Ratchet paper. Skip ratchet is a data structure for deriving keys that maintain backward secrecy. Unlike hash chains, this data structure is capable of efficiently making large leaps in hash count.
```rust use skip_ratchet::Ratchet;
let mut ratchet = Ratchet::new(); ratchet.inc_by(10);
println!("{:?}", ratchet.derive_key()); ```
```rust use skip_ratchet::Ratchet;
let mut oldratchet = Ratchet::new(); oldratchet.inc_by(5);
let mut recentratchet = oldratchet.clone(); recentratchet.incby(10);
for revision in recentratchet.previous(&oldratchet, 10).unwrap() { println!("{:#?}", revision); } ```
Clone the repository.
bash
git clone https://github.com/WebNativeFileSystem/rs-skip-ratchet.git
Change directory
bash
cd rs-skip-ratchet
Build the project
bash
cargo build
Run tests
bash
cargo test
This library recommends using pre-commit for running pre-commit hooks. Please run this before every commit and/or push.
pre-commit install
to setup the pre-commit hooks locally. This will reduce failed CI builds.git commit -a -m "Your message here" --no-verify
.This project lightly follows the Conventional Commits convention
to help explain commit history and tie in with our release process. The full
specification can be found here. We recommend prefixing your
commits with a type of fix
, feat
, docs
, ci
, refactor
, etc...,
structured like so:
```
[optional body]
[optional footer(s)] ```
For usage questions, usecases, or issues reach out to us in our Discord webnative-fs channel. We would be happy to try to answer your question or try opening a new issue on Github.
This project is licensed under the Apache License 2.0.