Giter Site home page Giter Site logo

libbbs's Introduction

libbbs

Specification-compliant and performant implementation of the bbs signature scheme.

Provides a library libbbs implementing the BLS12381-SHA-256 and BLS12-381-SHAKE-256 cipher suite.

Setup

Prerequisites

Dependencies:

  • gmp
  • xsltproc (indirect dependency of XKCP Keccak hash library)
  • cmake (build only)
mkdir build
cd build
cmake ..

Installation

Within build:

make install

Test

Within build:

make
make test

Benchmark

Within build:

make bench

Benchmark on Apple M1 Pro 2021 16GB:

  • 2 messages each of size 64 bytes
  • Disclosing first message only
  • Runtime averaged over 1000 iterations without warmup
Function SHA256 (ms) SHAKE256 (ms)
key generation (SK & PK) 0,174 0,172
sign 1,995 1,888
verify 3,877 3,829
proof generation 3,289 3,220
proof verification 4,532 4,482

libbbs's People

Contributors

bellebaum avatar schanzen avatar stephanschmiedmayer avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

libbbs's Issues

Better initialization of relic

We should either add a bbs_init function that initializes the subsystem or a compiler attribute (constructor) that does that when the library is loaded.
Currently, it is not even really documented outside of the tests how to use libbbs correctly.

Add benchmark

We would probably like to test the performance of our primitives:

  • bbs_keygen_full
  • bbs_sign
  • bbs_verify
  • bbs_proof_gen
  • bbs_proof_verify

While the keygen is trivial, for all the other function we probably want to use fixtures and not cumulatively test the other (previous) functions as well.
I would suggest that we create one binary for each function that is run exactly once (potentially with any necessary fixtures loaded).
Unfortunately the existing tests run multiple fixture from the I-D and do other things.
So, I guess we should create dedicated binaries for this.
The resulting binaries can be benchmarked using hyperfine, for example. E.g.:

$ hyperfine perf_bbs_verify

Eventually, this can become a custom (c)make target (make bench)

Breaking Relic API change

Building on main throws fatal error:

src/bbs_util.c:608:10: fatal error: 'relic_tmpl_map.h' file not found
#include <relic_tmpl_map.h>

Reason: Relic PR relic-toolkit/relic#292 changed the pairing+elliptic curve API, especially renaming "relic_tmpl_map.h" to "relic_ep_map_tmpl.h" and changing the TMPL_MAP_SSWU API

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.