Giter Site home page Giter Site logo

bbs's Introduction

BBS Signatures

[WIP] Reference implementation of BBS Signatures in Rust.

Usage

use bbs::prelude::*;

// initialize the BBS ciphersuite
let bbs = Bbs::<Bls12381Sha256>::default();

// encoded message data
let data = [
    bbs.message("I ❤️ BBS"),
    bbs.message("I also ❤️ Rust"),
    bbs.message("Pie is better than cake"),
    bbs.message("Pineapple on pizza is a crime"),
    bbs.message("Blame copilot for these messages"),
];

// generate a random key
let sk = SecretKey::random();
let pk = sk.public_key();

// sign the messages
let signature = bbs.sign(&sk, &data);

// verify the signature
let res = bbs.verify(&pk, &data, &signature);

// create a proof by disclosing the messages at indices 1 and 3
let proof = bbs.create_proof(&pk, &signature, &data, &[1, 3]).unwrap();

let disclosed_data = [data[1], data[3]];

// verify the generated proof
let res = bbs.verify_proof(&pk, &proof, data.len(), &disclosed_data, &[1, 3]);

bbs's People

Contributors

tmarkovski avatar

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.