// kit 01

PQC Toolkit

Cripto post-cuántica lista para producción. Elige stack, elige primitiva, copia el código.

$ verify_release.php
L1
PHP
1<?php
2// SLH-DSA-SHA2-128s release artifact verifier.
3// Verification only — signing is done in CI by release_sign.py.
4declare(strict_types=1);
5 
6require __DIR__ . '/SlhDsa128sVerify.php'; // FFI wrapper to liboqs
7 
8function verify_release(string $artifactPath, string $sigPath, string $pubB64): bool {
9 $bytes = file_get_contents($artifactPath);
10 $digest = hash('sha384', $bytes, true);
11 $sig = file_get_contents($sigPath);
12 $pub = base64_decode($pubB64);
13 return SlhDsa128sVerify::verify($digest, $sig, $pub);
14}
15 
16if (php_sapi_name() === 'cli') {
17 [$_, $artifact, $sig, $pub] = $argv;
18 echo verify_release($artifact, $sig, $pub) ? "OK\n" : "BAD\n";
19}
TAMAÑO CLAVE
32 B pub
FIRMA / CT
7856 B sig
NIVEL NIST
L1
NOTAS

Verificador PHP SLH-DSA que envuelve liboqs vía FFI (mismo patrón que PqcKem.php y PqcSign.php).

  • Coste de verificación: ~3 ms por artefacto.
  • La firma se hace en CI con release_sign.py (pqc-kit-python) — mismo formato.
  • Coloca SlhDsa128sVerify.php junto a este archivo; los dos están en el bundle PHP.