Giter Club home page Giter Club logo

rs-skip-ratchet's Introduction

Skip Ratchet Logo

Skip Ratchet

Crate Information Code Coverage Build Status License Docs Discord

This library implements the [Skip Ratchet paper][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.

Outline

Usage

Creating a new ratchet and advancing it.

use skip_ratchet::Ratchet;

let mut ratchet = Ratchet::new();
ratchet.inc_by(10);

println!("{:?}", ratchet.derive_key());

Getting the previous versions of a ratchet.

use skip_ratchet::Ratchet;

let mut old_ratchet = Ratchet::new();
old_ratchet.inc_by(5);

let mut recent_ratchet = old_ratchet.clone();
recent_ratchet.inc_by(10);

for revision in recent_ratchet.previous(&old_ratchet, 10).unwrap() {
    println!("{:?}", String::from(&revision));
}

Building the Project

  • Clone the repository.

    git clone https://github.com/WebNativeFileSystem/rs-skip-ratchet.git
  • Change directory

    cd rs-skip-ratchet
  • Build the project

    cargo build

Testing the Project

  • Run tests

    cargo test

Contributing

Pre-commit Hook

This library recommends using [pre-commit][pre-commit] for running pre-commit hooks. Please run this before every commit and/or push.

  • Once installed, Run pre-commit install to setup the pre-commit hooks locally. This will reduce failed CI builds.
  • If you are doing interim commits locally, and for some reason if you don't want pre-commit hooks to fire, you can run git commit -a -m "Your message here" --no-verify.

Conventional Commits

This project lightly follows the [Conventional Commits convention][commit-spec-site] 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:

<type>[optional scope]: <description>

[optional body]

[optional footer(s)]

Getting Help

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.

License

This project is licensed under the Apache License 2.0.

[commit-spec-site]: https://www.conventionalcommits.org/{% if bench %} [paper]: https://eprint.iacr.org/2022/1078.pdf [pre-commit]: https://pre-commit.com/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.