Incremental hashing based on curve25519-dalek

Overview

A toy project on building an incremental hash function using the Ristretto elliptic curve for me to learn Rust.

Example code from examples/main.rs:

use rust_incrhash::RistBlakeIncHash;

fn main() {
    let mut h: RistBlakeIncHash = RistBlakeIncHash::default();

    println!("Incremental hash of empty set {{}}: {}", h);

    let s1 = "key1 = val1";
    let b1 = s1.as_bytes();
    let s2 = "key2 = val1";
    let b2 = s2.as_bytes();

    let e1 = RistBlakeIncHash::from(b1);
    let e2 = RistBlakeIncHash::from(b2);

    h += &e1;
    println!("Incremental hash of {{ {} }}: {}", s1, h);

    h += &e2;
    println!("Incremental hash of {{ {}, {} }}: {}", s1, s2, h);

    h -= &e2;
    println!("Incremental hash of {{ {} }}: {}", s1, h);

    h -= &e1;
    println!("Incremental hash of empty set {{}}: {}", h);
}
You might also like...
A Rust library for lattice-based additive homomorphic encryption.

Cupcake Cupcake is an efficient Rust library for the (additive version of) Fan-Vercauteren homomorphic encryption scheme, offering capabilities to enc

EXPERIMENTAL: Bitcoin Core Prometheus exporter based on User-Space, Statically Defined Tracing and eBPF.

bitcoind-observer An experimental Prometheus metric exporter for Bitcoin Core based on Userspace, Statically Defined Tracing and eBPF. This demo is ba

Ruo is a dictionary-based password cracker written in rust 🦀 .

Ruo is a dictionary-based password cracker written in rust 🦀 . The primary purpose is to crack weak hashes/commonly used passwords.

A cw20 based DAO.

cw20 DAO NOT PRODUCTION READY This builds on cw3-flex-multisig and instead has the voting set maintained by cw20 tokens. This allows for the cw20s to

The Voting example based on MoonZoon and Solana + Anchor framework.
The Voting example based on MoonZoon and Solana + Anchor framework.

The Voting example based on MoonZoon and Solana + Anchor framework.

A cw20 based DAO.

cw20 DAO NOT PRODUCTION READY This builds on cw3-flex-multisig and instead has the voting set maintained by cw20 tokens. This allows for the cw20s to

Marinde Anchor-Based, first on mainnet, liquid-staking-program and mSOL-SOL swap pool

marinade-anchor Marinade-finance liquid staking program for the Solana blockchain Audits & Code Review Kudelski Security: https://marinade.finance/Kud

A Substrate-based PoA node supporting dynamic addition/removal of authorities.

Substrate PoA A sample Substrate runtime for a PoA blockchain that allows: Dynamically add/remove authorities. Automatically remove authorities when t

Multi Party Key Management System (KMS) for Secp256k1 Elliptic curve based digital signatures.

Key Management System (KMS) for curve Secp256k1 Multi Party Key Management System (KMS) for Secp256k1 Elliptic curve based digital signatures. Introdu

Owner
Alin Tomescu
Alin Tomescu
A pure-Rust implementation of group operations on Ristretto and Curve25519

curve25519-dalek A pure-Rust implementation of group operations on Ristretto and Curve25519. curve25519-dalek is a library providing group operations

dalek cryptography 611 Dec 25, 2022
Rust-based file hashing program

Rash A file hashing tool written in Rust Command line application for calculating the hash value of a file. Rash uses the RustCrypto collection of lib

Stuart Reilly 6 Sep 16, 2022
BTM is an incremental data backup mechanism that does not require downtime.

BTM Blockchain Time Machine. BTM is an incremental data backup mechanism that does not require downtime.

æ¼¢ 2 Mar 27, 2022
Lockstitch is an incremental, stateful cryptographic primitive for symmetric-key cryptographic operations in complex protocols.

Lockstitch is an incremental, stateful cryptographic primitive for symmetric-key cryptographic operations (e.g. hashing, encryption, message authentication codes, and authenticated encryption) in complex protocols.

Coda Hale 3 Dec 27, 2022
Password hashing functions / KDFs

RustCrypto: Password Hashes Collection of password hashing algorithms, otherwise known as password-based key derivation functions, written in pure Rus

Rust Crypto 387 Dec 28, 2022
ASURA implementation in Rust. A better alternative of consistent-hashing.

ASURA implementation in Rust. A better alternative of consistent-hashing.

Akira Hayakawa 4 May 30, 2022
Expose various non-cryptographic hashing functions with Digest traits

noncrypto-digests Expose various non-cryptographic hashing functions with Digest traits. This allows users to use any hashing function with the same t

Yuri Astrakhan 3 Dec 9, 2023
A Secure Capability-Based Runtime for JavaScript Based on Deno

Secure Runtime secure-runtime, as the name implies, is a secure runtime for JavaScript, designed for the multi-tenant serverless environment. It is an

Gigamono 7 Oct 7, 2022
Parity-Bridge — Bridge between any two ethereum-based networks

Deprecated Bridges This repo is deprecated. Originally it contained the ETH <> ETH-PoA bridge (see tumski tag). Later it was repurposed for ETH-PoA <>

Parity Technologies 314 Nov 25, 2022
rabe is an Attribute Based Encryption library, written in Rust

Rabe rabe is a rust library implementing several Attribute Based Encryption (ABE) schemes using a modified version of the bn library of zcash (type-3

Fraunhofer AISEC 52 Dec 15, 2022