OpenViSTAI · Agents · Blockchain · Crypto
Menu
Developer Tools

Mcl

Mcl is an open-source C++ library for pairing-based cryptography, supporting optimal Ate pairings over BN curves and BLS12-381. It provides library builds for integration into software and documents supported architectures, curve options, and build configurations.

Independent OpenViST project profile, based on linked sources.

Mcl — OpenViST project profile in Developer Tools.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use Mcl when a C++ project needs pairing-based cryptography and its target curve, compiler, processor instructions, and build environment align with the library's documented support.

Who it is for

  • C++ developers implementing pairing-based cryptographic operations.
  • Cryptographic software developers selecting support for BN curves or BLS12-381.
  • Developers evaluating a portable library with documented builds across multiple operating systems and processor architectures.

Documented uses

  • Add pairing-based cryptographic operations to a C++ application.
  • Build cryptographic features that use BN curves or BLS12-381 pairings.
  • Compile a static or shared Mcl library using the documented Makefile or CMake workflow.
Before you choose

Requirements & limits

The repository is public and identifies its license as BSD-3-Clause.

  • The documented pairing support covers BN curves and BLS12-381; the README also lists BN254, BN_SNARK1, BN381_1, BN462, and BLS12_377.
  • The default configuration supports up to 384 bits for Fp and 256 bits for Fr; larger curve parameters may require configuration changes and regeneration of low-level functions.
  • Mcl v4 requires BMI2 and ADX instruction sets, while the README notes breaking changes in versions 3 and 4.
  • Compiler requirements vary by platform, and some architecture targets have distinct toolchain instructions.
  • GMP is needed only for building test programs; OpenMP is optional.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Build Mcl with Make on Linux or macOS

Compile Mcl and produce its documented static or shared library on x86-64 Linux or macOS.

Before you start

  • A Linux or macOS development environment on x86-64.
  • A C++ compiler; clang++ is required except for x86-64 Linux and Windows with MinGW.
  • Git and Make.

Steps

  1. Clone the Mcl repository and change into its directory.

  2. Run the command below; where required, specify CXX=clang++.

    Documented command
    make -j4
  3. Use the generated lib/libmcl.a static library or lib/libmcl.so shared library.

Expected outcome

A compiled Mcl library is produced in the repository's `lib` directory.

Guide limitations

  • The documented Makefile commands cover x86-64 Linux and macOS; other targets have distinct instructions.
  • GMP is required only to build test programs, and OpenMP is optional.
  • Mcl v4 requires BMI2 and ADX instruction sets.
Source-based practical guide

Build Mcl with CMake on Linux or macOS

Configure and compile Mcl using its documented CMake path.

Before you start

  • A Linux or macOS development environment on x86-64.
  • CMake and Make.
  • A C++ compiler; clang++ is required except for x86-64 Linux and Windows with MinGW.

Steps

  1. Create a build directory in the Mcl repository and change into it.

  2. Run cmake ...

  3. Run make to compile the project; where required, configure CMake with -DCMAKE_CXX_COMPILER=clang++.

Expected outcome

The project is configured and compiled through its documented CMake workflow.

Guide limitations

  • The listed CMake commands specifically cover x86-64 Linux and macOS, with a separate compiler option noted for other platforms.
  • Mcl v4 requires BMI2 and ADX instruction sets.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
14 October 2026
Original website title
herumi/mcl · Official homepage title · retained in its source language