NAME

Crypt::Liboqs::Sign - Post-Quantum Digital Signatures via liboqs

SYNOPSIS

use Crypt::Liboqs::Sign qw(falcon512_keypair falcon512_sign falcon512_verify);

# generate keypair
my ($pk, $sk) = falcon512_keypair();

# sign message
my $signature = falcon512_sign($message, $sk);

# verify signature
my $valid = falcon512_verify($signature, $message, $pk);

DESCRIPTION

Provides Perl bindings to the liboqs (Open Quantum Safe) library for post-quantum digital signature schemes. This module is a drop-in replacement for Crypt::PQClean::Sign with support for all signature algorithms available in liboqs.

Supported Algorithm Families

  • Falcon (Falcon-512, Falcon-1024, padded variants)

  • ML-DSA / Dilithium (ML-DSA-44, ML-DSA-65, ML-DSA-87)

  • SPHINCS+ / SLH-DSA (SHA2 and SHAKE variants, 128/192/256 bit security)

  • MAYO (MAYO-1 through MAYO-5)

  • CROSS (RSDP and RSDPG variants)

  • And all other signature algorithms enabled in the installed liboqs

Function Naming

Each algorithm provides three functions: {prefix}_keypair, {prefix}_sign, and {prefix}_verify.

For backward compatibility with Crypt::PQClean::Sign, the following prefixes are supported:

falcon512, falcon1024, mldsa44, mldsa65, mldsa87,
sphincs_shake128f, sphincs_shake128s, sphincs_shake192f,
sphincs_shake192s, sphincs_shake256f, sphincs_shake256s

Additional algorithms use normalized names derived from the liboqs algorithm identifier (e.g., mayo_1_keypair, falcon_padded_512_keypair).

Utility Functions

_oqs_alg_list

Returns a list of all enabled signature algorithm names.

_oqs_alg_is_enabled(algorithm_name)

Returns true if the given algorithm is enabled in the installed liboqs.

_oqs_keypair(algorithm_name)

Generic keypair generation for any algorithm by name.

_oqs_sign(algorithm_name, message, secret_key)

Generic signing for any algorithm by name.

_oqs_verify(algorithm_name, signature, message, public_key)

Generic verification for any algorithm by name.

REQUIREMENTS

Requires the liboqs C library to be installed on the system. See https://github.com/open-quantum-safe/liboqs for installation instructions.

SEE ALSO

Crypt::PQClean::Sign, https://openquantumsafe.org/

AUTHOR

Pavel Gulchouk <gul@gul.kiev.ua>

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.