Top Stories

Ankaj Gupta
June 04, 2025
libmceliece: Full Installation Guide

libmceliece: Full Installation Guide for Global Users (System-Wide)

This guide walks you through installing libmceliece — a high-performance C implementation of the McEliece post-quantum cryptosystem — from source globally on a Linux system.

Note: If you see warnings like this script does not know how to check instruction-set extensions without python3-capstone, it's recommended to install python3-capstone for accurate CPU detection.

๐Ÿงฐ 1. Prerequisites

Install all necessary and recommended dependencies:

sudo apt update && sudo apt install -y \
  autoconf \
  build-essential \
  clang \
  python3 \
  python3-pip \
  gcc \
  clang \
  valgrind \
  libcpucycles-dev \
  librandombytes-dev \
  python3-capstone \
  wget \
  curl \
  make \
  man-db 

๐Ÿ“‹ Breakdown by Category

Category Packages
Build tools gcc, clang, build-essential, make
Testing tools valgrind
Crypto dependencies libcpucycles-dev, librandombytes-dev
Python tools python3, python3-pip, python3-capstone
Network & CLI wget, curl, man-db

⬇️ 2. Download the Latest libmceliece Release

Visit the official site or use wget to fetch the latest source:

# Download the latest version tag
wget https://lib.mceliece.org/libmceliece-latest-version.txt

# Extract the version number (e.g., 2025.04.28)
version=$(cat libmceliece-latest-version.txt)

# Download the corresponding tarball
wget https://lib.mceliece.org/libmceliece-$version.tar.gz

# Extract the archive
tar -xzf libmceliece-$version.tar.gz
cd libmceliece-$version

⚙️ 3. Configure, Build and Install (System-Wide)

./configure
make -j$(nproc)
sudo make install

This installs headers, libraries, binaries, and man pages to /usr/local.

Alternative for unprivileged users:

./configure --prefix=$HOME
make -j$(nproc)
make install

This installs the following:

  • Headers: /usr/local/include/

  • Libraries: /usr/local/lib/

  • Binaries: /usr/local/bin/

  • Man pages: /usr/local/man/

✅ 4. Post-Install: Test the Library

It’s critical to run the built-in test suite to validate the integrity and security of the build:

make check

๐Ÿ› ️ Step 5: Configure the Dynamic Linker

Ensure the system recognizes the new library

sudo ldconfig


✅ Step 6: Verify Installation

Check the dynamic library is registered

sudo ldconfig

ldconfig -p | grep mceliece

Check if headers are available:

ls /usr/local/include | grep mceliece

Check if binaries are installed:

mceliece-keygen --help

๐Ÿ” 7. Troubleshooting Common Issues

  • Missing Capstone Warning: this script does not know how to check instruction-set extensions without python3-capstone
    → Fix: sudo apt install python3-capstone
  • Missing Libraries: e.g., libcpucycles or librandombytes
    → Fix: Ensure libcpucycles-dev and librandombytes-dev are installed

๐Ÿ“ 8. Breakdown by Function

CategoryPackages
Build toolsgcc, clang, build-essential, make
Testing toolsvalgrind
Post-quantum depslibcpucycles-dev, librandombytes-dev
Python envpython3, python3-pip, python3-capstone
Network/CLI toolswget, curl, man-db

๐Ÿงช 9. Optional: Check if everything is correctly installed

gcc --version
clang --version
python3 --version
python3 -c "import capstone; print('Capstone OK')"

If all print versions or success messages, your prerequisites are ready.

๐Ÿ“š References

Version: Based on 2025.04.28 release of the installation documentation.

libmceliece Python
Read more

Discover more amazing content below