GitHub - bronlabs/bron-crypto: Bron's Advanced Cryptography Library

3 min read Original article ↗

Bron's Advanced Cryptography Library

This library provides implementations of state-of-the-art cryptographic protocols, written by cryptographers for cryptographers, using modern software engineering practices. Our approach is characterized by the following principles:

  1. Redundancy: Since we operate at the frontier of cryptographic research rather than in the domain of "settled" cryptography, we plan for yet-unknown protocol-level vulnerabilities by providing alternative implementations that rely on different cryptographic assumptions and tools.

  2. Reusability: Cryptography code is typically written once, audited, and then forgotten. We aim for reusability through modular design. For example, our sigma protocols can be made non-interactive using different compilers (Fiat-Shamir, Fischlin, Randomised Fischlin) or composed together (AND, OR) with minimal additional code. Similarly, our CRT and Fast modular arithmetic is implemented independently so that both Paillier and future applications like RSA can use it. We have also made extensive use of interfaces (see commitments.go or encryption.go/kemdem.go) to maximally cover future applications.

Focus

The primary focus of this library is MPC (Multi-Party Computation), specifically MPC signing over arbitrary monotone access structures (threshold, unanimity, CNF, hierarchical conjunctive, boolean-expression, …). We support the following protocols:

The design of MPC signing protocols are stateless. Orchestrating them is not in scope of this library; this includes implementation of the networking layer as well. For example, to establish the broadcast channel one typically has to do Echo-Broadcast yet this is implemented as a separate package.

Security Notice

This library is not designed to be fully side-channel resistant. We build higher-level protocols on top of a side-channel resistant foundation of elliptic curve (usually generated by fiat-cryptography, for example see K256) and big integer operations (wraps saferith and borinssl).

Important: This library is intended for use by experienced cryptographers and developers who understand the security implications of the protocols involved. If you are not familiar with the underlying cryptographic primitives, please consult with a cryptography expert before using this library in production.

Audit: The MPC signing packages of this library and all their direct and indirect dependencies have been audited by Trail of Bits and the audit report may be found in the audits directory.

For the full Security Notice, including how to submit bugs, see SECURITY.md

Documentation

Public documentations can be found at https://pkg.go.dev/github.com/bronlabs/bron-crypto

To access the documentation of the local version, run godoc -http=:6060 and open the following url in your browser.

http://localhost:6060/pkg/github.com/bronlabs/bron-crypto

Specification

A draft of our formal specification can be found in docs. However, based on our experience, LaTeX-based specification tends always be trailing the code. We are experimenting with new kinds of specifications and will update the repo in time.

Installation

go get github.com/bronlabs/bron-crypto

Note: This library requires CGO and links against BoringSSL. See DEVELOPMENT.md for build prerequisites and setup instructions.

Development

To set up the repository for development, see DEVELOPMENT.md.

Maintainers

Alumni

License

SPDX-License-Identifier: Apache-2.0

See LICENSE and thirdparty/NOTICE files for details.