`decaf377-rdsa` is a randomizable signature scheme using the `decaf377` group.

Overview

decaf377-rdsa is a variant of RedDSA, instantiated using the decaf377 group.

Signatures are parameterized by domain (for instance, Binding and SpendAuth); this library distinguishes different domains in the type system using the SigType trait as a type-level enum.

In addition to the Signature, SigningKey, VerificationKey types, the library also provides VerificationKeyBytes, a refinement of a [u8; 32] indicating that bytes represent an encoding of a RedJubjub verification key. This allows the VerificationKey type to cache verification checks related to the verification key encoding.

Examples

Creating a spend authorization signature, serializing and deserializing it, and verifying the signature:

# use std::convert::TryFrom;
use rand::thread_rng;
use decaf377_rdsa::*;

let msg = b"Hello!";

// Generate a secret key and sign the message
let sk = SigningKey::<SpendAuth>::new(thread_rng());
let sig = sk.sign(thread_rng(), msg);

// Types can be converted to raw byte arrays using From/Into
let sig_bytes: [u8; 64] = sig.into();
let pk_bytes: [u8; 32] = VerificationKey::from(&sk).into();

// Deserialize and verify the signature.
let sig: Signature<SpendAuth> = sig_bytes.into();
assert!(
    VerificationKey::try_from(pk_bytes)
        .and_then(|pk| pk.verify(msg, &sig))
        .is_ok()
);

About

This library is based on the redjubjub crate.

Comments
  • Make `SpendAuth` signatures independent of the decaf377 hash-to-group mechanism.

    Make `SpendAuth` signatures independent of the decaf377 hash-to-group mechanism.

    Because the hash-to-group mechanism for decaf377 is still subject to change (we need to select the quadratic nonresidue together with an optimized square root algorithm), all uses of it are also subject to change. Making SpendAuth signatures independent of this evolution means that the (longer-term) spend authorization keys are less likely to be invalidated.

    opened by hdevalence 1
  • Use the standard decaf377 basepoint for SpendAuth signatures

    Use the standard decaf377 basepoint for SpendAuth signatures

    Per https://github.com/penumbra-zone/penumbra/issues/25#issuecomment-953494816 , the basepoint() function in impl Sealed for SpendAuth should return the standard decaf377 basepoint 080000.....

    opened by hdevalence 1
  • Add an `Fr` constructor for `SigningKey`s

    Add an `Fr` constructor for `SigningKey`s

    This doesn't expose much additional API surface, because we already had to expose the field elements in the API as randomizers.

    Also update some stale doc comments.

    opened by hdevalence 1
  • Add nicer hex-formatted Debug impls

    Add nicer hex-formatted Debug impls

    Now produces debug output like

    Signature<SpendAuth>("f008bc2a80174fd0a450f28f86ddf1f2c2e20acd8986edbe6a8cf1ad5575fa02044fcc0ec0faf138ab26d39a600d723e0e2a671304a89c86b641cad4829f8604")
    VerificationKey<SpendAuth>("26bc0fe0b14a3c4cbc125b721475ca57cf24b5b12ff740bd652a88c531b68506")
    
    opened by hdevalence 0
  • Add a constructor to the `SigningKey` that takes a field element as input.

    Add a constructor to the `SigningKey` that takes a field element as input.

    We should add a constructor to the SigningKey API in decaf377_rdsa that takes a field element as input.

    Originally posted by @hdevalence in https://github.com/penumbra-zone/penumbra/pull/78#r727604829

    opened by hdevalence 0
Owner
Penumbra
Penumbra is a fully private proof-of-stake network interoperable with the Cosmos ecosystem.
Penumbra
Python/Rust implementations and notes from Proofs Arguments and Zero Knowledge study group

What is this? This is where I'll be collecting resources related to the Study Group on Dr. Justin Thaler's Proofs Arguments And Zero Knowledge Book. T

Thor 65 Dec 16, 2022
An NTP implementation in Rust, supported by Internet Security Research Group's Prossimo project.

NTPD-rs NTPD-rs is an implementation of NTP completely written in Rust, with a focus on exposing a minimal attack surface. The project is currently in

Prossimo (ISRG) 302 Jan 4, 2023
Yet Another Kalman Filter Implementation. As well as Lie Theory (Lie group and algebra) on SE(3). [no_std] is supported by default.

yakf - Yet Another Kalman Filter Yet Another Kalman Filter Implementation, as well as, Lie Theory (Lie group, algebra, vector) on SO(3), SE(3), SO(2),

null 7 Dec 1, 2022
Librarian runs pre-configured commands against a group of files that match a set of filters

Filesystem Librarian Librarian runs pre-configured commands against a group of files that match a set of filters. The group of files is called a libra

Jason Rogena 10 Dec 25, 2022
Sky Island Showdown: CSE 125 Spring 2023 Group 5 Project, a Multiplayer, 3D Game

As the Wind Blows ?? Project for CSE 125 Spring 2023, Group 5 Homepage » As the Wind Blows is a 3D multiplayer game, created with Rust, WGPU, and a to

null 5 May 1, 2023
Create, reorder, group, and focus workspaces easily in i3. Fully configurable with enhanced polybar modules.

Create, reorder, group, and focus workspaces fast and easily in i3. Features Focus Mode: Eliminate Distractions Enable Focus Mode: Use groups and focu

i3-wsman 15 Sep 2, 2023
An optimizing IK solver based on the Lie group of rigid transforms SE(3)

OptIK A fast inverse kinematics solver for arbitrary serial chains, providing Rust and Python programming interfaces. The implementation is similar to

Kyle Cesare 17 Oct 5, 2023
Using BDK from nodejs using WASM webpack 🦀

BDK + nodejs = ❤️ This repository shows how to use the bdk library in nodejs. It's just a proof-of-concept, not a complete example, and as such, it's

Daniela Brozzoni 10 Feb 21, 2023
Build terminal user interfaces and dashboards using Rust

tui-rs tui-rs is a Rust library to build rich terminal user interfaces and dashboards. It is heavily inspired by the Javascript library blessed-contri

Florian Dehau 9.3k Jan 4, 2023
Pure-Rust rewrite of the Linux fontconfig library (no system dependencies) - using ttf-parser and allsorts

rust-fontconfig Pure-Rust rewrite of the Linux fontconfig library (no system dependencies) - using allsorts as a font parser in order to parse .woff,

Felix Schütt 28 Oct 29, 2022
A CLI tool that allow you to create a temporary new rust project using cargo with already installed dependencies

cargo-temp A CLI tool that allow you to create a new rust project in a temporary directory with already installed dependencies. Install Requires Rust

Yohan Boogaert 61 Oct 31, 2022
Mini Rust CLI to deploy sites to Netlify using their API

This is a Rust CLI that uses the Netlify API to deploy sites.

Benjamin Lannon 10 May 12, 2022
Build terminal dashboards using ascii/ansi art and javascript

blessed-contrib Build dashboards (or any other application) using ascii/ansi art and javascript. Friendly to terminals, ssh and developers.

Yaron Naveh 15k Jan 2, 2023
A few demos showing how to estimate projects using Monte Carlo simulations.

Agile Monte Carlo Simulations Demos This is the repository which accompanies the blog post "How to replace estimations and guesses with a Monte Carlo

Lucas F. da Costa 14 Jun 18, 2022
A CLI tool for getting screenshots of URLs using headless chrome

rustywitness ?? ?? ?? Web screenshot utility A CLI tool for getting screenshots of URLs using headless chrome Built with ❤︎ by swanandx and contributo

Swanand Mulay 16 Jan 3, 2023
Shellcode Runner/Injector in Rust using NTDLL functions directly with the ntapi Library

RustSCRunner Shellcode Runner/Injector in Rust using NTDLL functions directly with the ntapi Library. Surprisingly this is my first ever Rust project

null 86 Dec 18, 2021
Kit-kat clock utility rewritten in Rust using minifb

kitkat clock in Rust This is the plan9 cat clock utility rewritten in rust with minifb crate. $ kitkat --help Usage: kitkat [--hook|--crazy|--offset O

Manos Pitsidianakis 18 Oct 19, 2022
Black-box integration tests for your REST API using the Rust and its test framework

restest Black-box integration test for REST APIs in Rust. This crate provides the [assert_api] macro that allows to declaratively test, given a certai

IOmentum 10 Nov 23, 2022
My solutions for the 2021 edition of the Advent of Code, using Rust and SOM (Simple Object Machine)

Advent of Code 2021 These are my solutions for the 2021 edition of the Advent of Code. The solutions are all implemented using both Rust and SOM (Simp

Nicolas Polomack 1 Dec 23, 2021