// kit 01
PQC Toolkit
Cripto post-cuántica lista para producción. Elige stack, elige primitiva, copia el código.
$ verify_release.php
L1
1 <?php 2 // SLH-DSA-SHA2-128s release artifact verifier. 3 // Verification only — signing is done in CI by release_sign.py. 4 declare(strict_types=1); 5 6 require __DIR__ . '/SlhDsa128sVerify.php'; // FFI wrapper to liboqs 7 8 function 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 16 if (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.phpjunto a este archivo; los dos están en el bundle PHP.