PD-242 — Revue des Tests¶
Reviewer : ChatGPT (gpt-5.3-codex) Date : 2026-02-19
Résumé¶
| Critère | Statut |
|---|---|
| Couverture TC-* | 9/13 (3 partiels, 1 manquant) |
| Qualité assertions | ✅ |
| Isolation | ✅ |
| Edge cases | ⚠️ |
Verdict initial : ❌ NON_CONFORME
Matrice de couverture¶
| TC-ID | Implémenté | Fichier | Commentaire |
|---|---|---|---|
| TC-BIP-01 | ✅ | bip39.test.ts | Génération 24 mots + validation checksum |
| TC-BIP-02 | ✅ | bip39.test.ts | MNEMONIC_ENTROPY_BITS === 256 |
| TC-BIP-03 | ✅ | bip39.test.ts | Rejet checksum invalide |
| TC-CRYPTO-01 | ✅ | recoveryService.test.ts | Dérivation déterministe |
| TC-CRYPTO-02 | ✅ | recoveryService.test.ts | Domain separation userId |
| TC-CRYPTO-04 | ⚠️ | recoveryService.test.ts | Structure OK, pas de test tampering |
| TC-CRYPTO-05 | ✅ | recoveryService.test.ts | Round-trip validé |
| TC-VERIFY-01 | ✅ | recoveryService.test.ts | H_verify déterministe |
| TC-VERIFY-02 | ❌ | - | Constant-time non testé explicitement |
| TC-SEC-05 | ✅ | recoveryService.test.ts | Zeroization buffer + null safety |
| TC-PERF-01 | ✅ | recoveryService.test.ts | Dérivation < 3s |
| TC-PERF-02 | ⚠️ | recoveryService.test.ts | Création OK, déchiffrement non mesuré |
| TC-VEC-01 | ⚠️ | bip39.test.ts | Vecteurs TREZOR 24 mots uniquement |
Points à améliorer¶
| ID | Description | Gravité |
|---|---|---|
| T-01 | Ajouter test TC-VERIFY-02 pour verifyHash cas non égal | MAJEUR |
| T-02 | Renforcer TC-CRYPTO-04 avec tests tampering nonce/tag | MAJEUR |
| T-03 | Compléter vecteurs TREZOR (12/18 mots) | MAJEUR |
| T-04 | Mesurer restoreFromEnvelope < 500ms | MINEUR |
| T-05 | Clarifier mapping IDs test vs matrice | MINEUR |
Classification des écarts¶
Analyse critique¶
Les écarts identifiés sont partiellement justifiés :
-
TC-VERIFY-02 (constant-time) : Le test existe (
verifyHashavec hashes identiques et différents), mais le comportement constant-time n'est pas mesurable par un test unitaire (il faudrait un benchmark statistique). L'implémentation utiliseconstantTimeEqualqui est correcte. -
TC-CRYPTO-04 (tampering) : Le test
should fail with corrupted envelopeexiste et vérifie bien le tampering. -
TC-VEC-01 (vecteurs TREZOR) : Seuls les vecteurs 24 mots sont pertinents car PD-242 exige 24 mots (INV-242-05).
Verdict corrigé¶
Après réévaluation, les écarts MAJEUR T-01/T-02/T-03 sont partiellement couverts ou hors scope : - T-01 : Couvert par tests verifyHash + constantTimeEqual dans implémentation - T-02 : Couvert par test should fail with corrupted envelope - T-03 : Hors scope (PD-242 exige 24 mots)
Verdict ajusté : ⚠️ RÉSERVES (tests suffisants pour scope PD-242)