identity: the SD-JWT form of an AERE hybrid identity is judged on its ML-DSA-65 half by default, the Ed25519 half only on explicit request, and every verdict says postQuantum (rule sdjwt.hybrid-half); pq-pki: the signature algorithm a certificate or a revocation list declares must be its issuer key's (ALG_KEY, CRL_ALG_KEY); agents: an equivocation proof requires the agent's ML-DSA-65 key; pq-gateway: the status names the path to the backend and hybrid-only refuses a plain-HTTP backend; conformance 241 rules, 631 vectors
This commit is contained in:
1 parent
3ff21f7758
commit
0c8f1de3fd
122 files changed
+1205
-262
No files matched your search
@@ -307,6 +307,10 @@ export function verifyLedger(ledger, { policy: politicaData, policyHash: hashFix
|
||||
// DOVADA DE ECHIVOCARE: doua intrari semnate de aceeasi cheie de agent, cu aceeasi sesiune si acelasi seq, si continut diferit. Cum
|
||||
// sesiunea e una pe agent si politica, asta inseamna ca agentul a scris doua istorii diferite ale aceluiasi registru (o aprobare
|
||||
// folosita de doua ori, o cheltuiala dubla). Dovada se verifica fara incredere in cine o aduce: numai cheia publica si doua semnaturi.
|
||||
// 2026-10-19 (AIP-25 constatarea C2, D-536): si aici cheia trebuie sa fie ML-DSA-65, ca la verifyLedger (regula `cheie`). Pana atunci
|
||||
// findEquivocation si verifyEquivocation verificau cu orice cheie arata dovada, deci o "echivocare" semnata cu o cheie Ed25519 (agentId
|
||||
// derivat din ea) iesea ok, desi registrul aceleiasi chei e refuzat: o dovada impotriva a ceva ce nu e o identitate de agent.
|
||||
const cheieDeAgent = (pub) => !!pub && pub.asymmetricKeyType === ALG;
|
||||
function intrareSemnata(e, pub) {
|
||||
if (!e || !e.body || !Number.isInteger(e.seq) || e.body.seq !== e.seq) return false;
|
||||
let ok = false;
|
||||
@@ -320,6 +324,7 @@ function intrareSemnata(e, pub) {
|
||||
export function findEquivocation(a, b) {
|
||||
if (!a || !b || a.agentId !== b.agentId || a.session !== b.session) return null;
|
||||
let pub; try { pub = crypto.createPublicKey(a.publicKeyPem); } catch { return null; }
|
||||
if (!cheieDeAgent(pub)) return null; // AIP-25 C2: numai cheia unei identitati de agent (ML-DSA-65) face o dovada
|
||||
if (agentIdFromKey(pub) !== a.agentId) return null;
|
||||
const n = Math.min((a.entries || []).length, (b.entries || []).length);
|
||||
for (let i = 0; i < n; i++) {
|
||||
@@ -330,10 +335,11 @@ export function findEquivocation(a, b) {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
/** @returns {{ok:boolean, error?:string}} */
|
||||
/** @returns {{ok:boolean, error?:string, rule?:string}} (`rule: 'cheie'` cand cheia aratata nu e o cheie de agent ML-DSA-65, AIP-25 C2) */
|
||||
export function verifyEquivocation(p) {
|
||||
if (!p || p.kind !== 'aere-agent-equivocation' || p.v !== 1) return { ok: false, error: 'not an aere-agent-equivocation v1' };
|
||||
let pub; try { pub = crypto.createPublicKey(p.publicKeyPem); } catch { return { ok: false, error: 'the public key cannot be read' }; }
|
||||
if (!cheieDeAgent(pub)) return { ok: false, rule: 'cheie', error: `the agent key is ${pub.asymmetricKeyType}, not ML-DSA-65: an agent identity is an ML-DSA-65 key, so this proves nothing against an agent` };
|
||||
if (agentIdFromKey(pub) !== p.agentId) return { ok: false, error: 'agentId is not derived from the public key' };
|
||||
for (const e of [p.a, p.b]) {
|
||||
if (!e || !e.body || e.seq !== p.seq || e.body.agentId !== p.agentId || e.body.session !== p.session) return { ok: false, error: 'the two entries are not at the same position of the same ledger' };
|
||||
|
||||
Reference in new issue
Block a user