Giter Site home page Giter Site logo

pixel's Introduction

Pixel signature scheme

Build Status

This is Algorand's implementation of Pixel signature, over the BLS12-381 curve. Useful links:

  • Paper
  • Spec
  • Rust code: this repo
  • Python code
  • Another python code <- This code is only for generating test vectors and cross comparing with Rust's output. It should not be used for any other purpose.

Dependencies

  • Pairing-plus library: Github, Crate.io
    • A fork of zkcrypto's pairing library; with additional functions such as hash to groups and membership testing, etc.
    • We rely heavily on this library for underlying arithmetics.
  • Pixel_param: Github
    • We use the default parameters generated from this crate.
  • BLS_SIG: Github, Crate.io
    • This library is only used for generating and verifying proof of possession.

Code status

  • Version Alpha.
  • This code has NOT been deployed in production.
  • This code has been externally audited by two consulting firms.

Build options

  • cargo build builds a debug version;
  • cargo build --release builds the release version;

Test options

  • cargo test [--release] runs basic tests;
  • cargo test -- --ignored [--release] runs long tests;
  • cargo bench runs benchmarks.

Cross comparison with python code

  • test_vector calls this rust library to generate a list of test vectors.
  • pixel-python/test_vector.py is a python script that generates a list of test vectors.
  • test_vector.py also compares the binary outputs of Rust and python match.

Quality control

Following the guidelines from Facebook's libra source code and Rust API Guidelines.

  • cargo fmt for coding style
  • cargo clippy --all-targets --all-features -- -D warnings for lint
  • cargo doc for documentation.

Exceptions:

  • Facebooks guidelines suggests to have a test file along with the source code. Pixel has a separate test folder that contains all test codes.

Crypto Hygiene

  • Variables that storing secret data are named with a suffix _sec. Always ensure primitive types get cleaned with Zeroize crate; or get passed to the caller. Secret key related structures implements zeroing on drop.
  • Avoiding using clone() function on secret data as possible - this will create two copies of the data. If clone() is used, always clean it after use.

Interfaces documentation

  • Run cargo doc --open
  • See target/doc/pixel/index.html

Wrapper

pixel's People

Contributors

zhenfeizhang avatar algoradam avatar hoeteck 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.