device-operation: machine operation log and reputation; conformance: 260 rules, 17 verifiers, 791 vectors
This commit is contained in:
1 parent
c1721b3bf1
commit
6ba33c477f
281 files changed
+115161
-46
No files matched your search
@@ -12,6 +12,7 @@
|
||||
// (six hybrid key pairs), the SD-JWT and SD-JWT VC tokens, one Travel Rule exchange (with the
|
||||
// beneficiary's KEM key pair, test material declared at the scene), one compliance exchange,
|
||||
// the presentations of one credential with and without a request (2026-10-18),
|
||||
// the operation log of one machine with its forged siblings (2026-10-20),
|
||||
// and the transaction of the recorded receipt READ from testnet 28001 (two
|
||||
// eth_ calls; nothing is sent). With --tot everything is made anew; with --refa <name>
|
||||
// ONE source is made anew (its vectors change, the others stay byte for byte)
|
||||
@@ -39,6 +40,11 @@ import * as DV from '../device-identity/device.mjs';
|
||||
import * as SJ from '../identity/sdjwt.mjs';
|
||||
import * as SV from '../identity/sdjwt-vc.mjs';
|
||||
import * as TR from '../identity/travel-rule.mjs';
|
||||
// 2026-10-20 (B7): the operation log of a machine and its reputation. The log's fresh source is made by that component's own world (its
|
||||
// producers); the reputation vectors are derived by that component's producer of them, from its fixed source, and taken through the forms here
|
||||
import * as OP from '../device-operation/operation.mjs';
|
||||
import * as OPL from '../device-operation/lume-operation.mjs';
|
||||
import { construieste as vectoriReputatie } from '../device-operation/genereaza-vectori.mjs';
|
||||
import { hartaPublica, LEVELS } from './reguli.mjs';
|
||||
|
||||
const AICI = path.dirname(fileURLToPath(import.meta.url));
|
||||
@@ -585,6 +591,46 @@ const PROASPETE_IN_PLUS = {
|
||||
const REQUEST = cerere('get', {});
|
||||
return { audience: AUD, nonce: NONCE, now: at(30), trusted: [iss.id], list: lista, request: REQUEST, otherRequest: cerere('revoke', { grantId: 'deployers' }), withRequest: prez({ request: REQUEST }), withoutRequest: prez() };
|
||||
},
|
||||
// 2026-10-20 (B7, roadmap 26): the operation log of ONE machine, made by the world of the device operation component (lume-operation.mjs,
|
||||
// over that component's producers and the device identity's): a manufacturer, another manufacturer and a stranger (three hybrid key pairs)
|
||||
// and three ML-DSA-65 device keys, all made and discarded in this call. Six records at fixed times (2026-10-01, hours 0 to 5): three
|
||||
// signed by the first key, the third of them rotating to the second key, which the same manufacturer certified for the same model and
|
||||
// serial; three signed by the second key. Every record names a block; records 1 and 4 carry an anchor envelope. The blocks are synthetic
|
||||
// and the readings of blocks and anchors stand for the readings a verifier makes on a chain (the component says the same): nothing was
|
||||
// notarized and no chain was read. The forged siblings only a key holder can make are made with the producers and the published signing
|
||||
// formula (signRecord through the world's resemneaza); the vectors built from them are each checked, at derivation, against the verifier
|
||||
deviceOperation: async () => {
|
||||
const W = OPL.lume(), T0 = W.T0, H = OPL.ORA, iso = W.iso, zi = 24 * H;
|
||||
const j = W.jurnal({ ore: [0, 1, 2, 3, 4, 5], rotireLa: 2, ancoreLa: [1, 4] }); const R = j.log.records; const la = (i) => Date.parse(R[i].statement.at);
|
||||
const cheia2 = (o) => W.credential({ deviceKey: W.dev2.publicKey, status: { list: W.LID, index: 4 }, ...o });
|
||||
const credentialOtherKey = W.credential({ deviceKey: W.dev3.publicKey, status: { list: W.LID, index: 5 } });
|
||||
return { ids: { manufacturer: W.mfr.id, otherManufacturer: W.altMfr.id, key1: W.dev1.deviceId, key2: W.dev2.deviceId, key3: W.dev3.deviceId }, log: j.log,
|
||||
options: { now: iso(T0 + 6 * H), trustedManufacturers: [W.mfr.id], statusLists: [W.lista()], statusRecords: [], readings: j.readings, beacons: j.beacons, otherRecords: [] },
|
||||
empty: OP.newLog({ manufacture: W.M1 }),
|
||||
forged: {
|
||||
// records signed again by a key the log certifies
|
||||
recordKey: W.resemneaza(R[3], W.dev1, (st) => { st.deviceId = W.dev1.deviceId; }),
|
||||
recordSeq: W.resemneaza(R[3], W.dev2, (st) => { st.seq = 7; }),
|
||||
recordPrev: W.resemneaza(R[3], W.dev2, (st) => { st.prev = OP.recordHash(R[1]); }),
|
||||
recordTimeBack: W.resemneaza(R[3], W.dev2, (st) => { st.at = iso(la(2) - 60000); st.after = null; }),
|
||||
recordCounter: W.resemneaza(R[3], W.dev2, (st) => { st.counter = R[2].statement.counter - 1; }),
|
||||
keyWindowBefore: W.resemneaza(R[0], W.dev1, (st) => { st.at = iso(T0 - 31 * zi); st.after = null; }),
|
||||
// manufacture credentials of the second key (and of another key) the manufacturer signs
|
||||
credentialEnded: cheia2({ validUntil: iso(T0 + 4 * H) }), credentialLastInstant: cheia2({ validUntil: R[5].statement.at }),
|
||||
credentialOtherModel: cheia2({ model: 'AX-300' }), credentialOtherSerial: cheia2({ serial: 'SN-0002' }), credentialOtherKey,
|
||||
// the manufacturer's recall list with the first key's credential recalled, and status records
|
||||
recalledList: W.lista([3]),
|
||||
retiredAtRecord1: W.stare(W.M1, 'retired', la(1)), retiredAfterRotation: W.stare(W.M1, 'retired', la(2) + 1800000), retiredInFuture: W.stare(W.M1, 'retired', T0 + 7 * H),
|
||||
suspended: W.stare(W.M1, 'suspended', la(1)), retiredOtherDevice: W.stare(credentialOtherKey, 'retired', la(1)),
|
||||
retiredByOtherManufacturer: DV.statusRecord({ by: W.altMfr, deviceId: W.dev1.deviceId, ownership: '0x' + 'ab'.repeat(32), state: 'retired', seq: 1, validUntil: iso(la(1) + 30 * zi), now: new Date(la(1)) }),
|
||||
// records handed beside the log
|
||||
sibling3: W.resemneaza(R[3], W.dev2, (st) => { st.state = 'fault'; }), sibling1: W.resemneaza(R[1], W.dev1, (st) => { st.state = 'fault'; }),
|
||||
oldKeyAfterRotation: W.resemneaza(R[4], W.dev1, (st) => { st.deviceId = W.dev1.deviceId; }),
|
||||
strangerRecord: W.resemneaza(R[3], W.dev3, (st) => { st.deviceId = W.dev3.deviceId; }),
|
||||
beyond: OP.operationRecord({ device: W.dev2, log: j.log, state: 'operating', counter: R[5].statement.counter + 100, now: new Date(la(5) + 1800000) }),
|
||||
// an anchor envelope about record 1 whose source is another device (no key: its hash is recomputed with the published formula)
|
||||
anchorOtherSource: { ...buildProof('time', { subjectHash: OP.recordHash(R[1]), source: W.dev2.deviceId, at: R[1].statement.at, createdAt: R[1].statement.at }), notarization: { chainId: OPL.LANT, note: 'a claim written for this vector: nothing was notarized' } } } };
|
||||
},
|
||||
};
|
||||
|
||||
// ---------- fixed inputs of the AIP-23 kinds (the inputs of the published AIP-23 kind vectors) ----------
|
||||
@@ -1436,6 +1482,100 @@ function construieste() {
|
||||
c('presentation-freshness', 'the verifier\'s clock is an hour after the presentation was made (the policy allows 300 s)', { op: 'set', path: ['now'], value: X.later }, ['compliance.presentation', 'compliance.rule']);
|
||||
c('presentation-signature', 'the ML-DSA-65 half of the holder\'s signature has one character changed', { op: 'set', path: ['presentation', 'signature', 'mldsa65'], value: schimba(sg.mldsa65) }, ['compliance.presentation', 'compliance.rule']);
|
||||
c('presentation-disclosure-removed', 'a disclosure taken out after the holder signed for the list', { op: 'remove', path: ['presentation', 'disclosures', 0] }, ['compliance.presentation', 'compliance.rule']); }
|
||||
// (O) the operation log of a machine (2026-10-20, B7): the records its device key signed, judged with what the verifier brings (its clock and
|
||||
// the tolerance of it, the manufacturers it trusts, the recall list, the manufacturer's status records, its own readings of the anchors and of
|
||||
// the blocks, records of the machine it holds from elsewhere). The verifier makes every check of each record it reaches; the log is accepted
|
||||
// up to the first record a rule refuses. Every vector of this section is checked at derivation against the operation verifier itself
|
||||
{ const X = P.deviceOperation; const A = 'device-operation-log'; const F = X.forged; const OK = Object.keys(HARTA).filter((r) => r.startsWith('operation.'));
|
||||
const AP = { authenticity: 'PASSED' }, OPRIT = { authenticity: 'NOT_MEASURED' }, NI = { integrity: 'NOT_MEASURED' }, NA = { authenticity: 'NOT_MEASURED' }, NN = { anchoring: 'NOT_MEASURED' };
|
||||
const src = 'producers (device operation: newLog, operationRecord, append, anchorEnvelope, signRecord, through its world lume-operation.mjs; device identity: manufacture, statusRecord; identity: createStatusList), three hybrid key pairs and three ML-DSA-65 device keys made and discarded at generation; the blocks are synthetic and the readings of anchors and blocks stand for the readings a verifier makes on a chain';
|
||||
const R = X.log.records, la = (i) => Date.parse(R[i].statement.at), sec = (ms) => Math.floor(ms / 1000); const schimba = (c) => (c[0] === 'A' ? 'B' : 'A') + c.slice(1);
|
||||
const bo = 'device-operation-log/six-records.valid', bt = 'device-operation-log/two-trusted-manufacturers.valid', bc = 'device-operation-log/clock-30s-behind.valid', br = 'device-operation-log/retired-after-rotation.partial';
|
||||
valid(bo, A, 'six records of one machine: three signed by its first key, the third rotating to a second key the same manufacturer certified for the same model and serial, three by the second key; every record names a block the verifier read, records 1 and 4 carry an anchor the verifier read on the chain; the verifier brings its clock, the manufacturer it trusts, the recall list and the manufacturer\'s status registry, read and empty', src, { log: X.log, ...X.options }, { exercises: OK, levels: AP });
|
||||
// one operation away from a log that is not refused: what it does to the verdict is what it was written for
|
||||
const din = (id, titlu, baza, op, verdict, levels = {}) => { const b = V.find((x) => x.id === baza); valid(id, A, titlu, src, aplica(b.input, op), { exercises: OK, verdict, levels: { ...b.expected.levels, ...levels }, base: baza, mutation: op }); };
|
||||
din('device-operation-log/beacon-unread.valid', 'the verifier did not read the block record 3 names: no lower bound from it, named, and the verdict stands', bo, { op: 'remove', path: ['beacons', 3] }, 'VALID');
|
||||
din(bc, 'the verifier\'s clock is 30 seconds behind the last record: inside the tolerance of its clock (60 s)', bo, { op: 'set', path: ['now'], value: new Date(la(5) - 30000).toISOString() }, 'VALID');
|
||||
din('device-operation-log/witness-30s-early.valid', 'the verifier read the anchor of record 1 thirty seconds before the time the record carries: inside the tolerance of its clock', bo, { op: 'set', path: ['readings', 0, 'at'], value: sec(la(1) - 30000) }, 'VALID');
|
||||
din('device-operation-log/suspended.valid', 'the manufacturer suspended the first key: a suspension concerns what the device may do, not what it signed, and is not a revocation here', bo, { op: 'set', path: ['statusRecords'], value: [F.suspended] }, 'VALID');
|
||||
din('device-operation-log/retirement-not-yet-in-effect.valid', 'a retirement of the first key dated an hour after the verifier\'s clock: not in effect yet, named', bo, { op: 'set', path: ['statusRecords'], value: [F.retiredInFuture] }, 'VALID');
|
||||
din('device-operation-log/retirement-of-another-device.valid', 'the manufacturer retired another device: the record is passed over', bo, { op: 'set', path: ['statusRecords'], value: [F.retiredOtherDevice] }, 'VALID');
|
||||
din('device-operation-log/retired-by-an-untrusted-manufacturer.valid', 'a retirement of the first key signed by a manufacturer the verifier does not trust: passed over', bo, { op: 'set', path: ['statusRecords'], value: [F.retiredByOtherManufacturer] }, 'VALID');
|
||||
din('device-operation-log/old-key-after-rotation.valid', 'beside the log, a record signed by the first key for a position after the log rotated away from it: somebody still holds that key, named; the log does not depend on it', bo, { op: 'set', path: ['otherRecords'], value: [F.oldKeyAfterRotation] }, 'VALID');
|
||||
din('device-operation-log/stranger-record.valid', 'beside the log, a record signed by a device key no credential of the log certifies: ignored, named', bo, { op: 'set', path: ['otherRecords'], value: [F.strangerRecord] }, 'VALID');
|
||||
din(bt, 'the verifier trusts two manufacturers: the log stays what it was', bo, { op: 'set', path: ['trustedManufacturers'], value: [X.ids.manufacturer, X.ids.otherManufacturer] }, 'VALID');
|
||||
{ const input = clona(V.find((x) => x.id === bo).input); input.log.credentials[1] = F.credentialLastInstant;
|
||||
valid('device-operation-log/credential-last-instant.valid', A, 'the credential of the second key ends at the very instant of the last record: the last instant of a validity is inside it', src, input, { exercises: OK, levels: AP }); }
|
||||
// what was not brought or not read: nothing refuses, and the verdict is not VALID
|
||||
din('device-operation-log/status-not-read.partial', 'the manufacturer\'s status registry was not read: a retirement of a key cannot be seen', bo, { op: 'remove', path: ['statusRecords'] }, 'PARTIAL', NI);
|
||||
din('device-operation-log/no-trusted-manufacturers.partial', 'the verifier names no manufacturer it trusts: anyone can issue a manufacture credential with their own keys', bo, { op: 'remove', path: ['trustedManufacturers'] }, 'PARTIAL', NA);
|
||||
din('device-operation-log/recall-list-not-read.partial', 'the recall list both credentials name was not handed to the verifier', bo, { op: 'set', path: ['statusLists'], value: [] }, 'PARTIAL', NI);
|
||||
din('device-operation-log/anchors-not-read.partial', 'the two anchors claim a notarization and the verifier read neither on the chain: a claim is not a reading', bo, { op: 'set', path: ['readings'], value: [] }, 'PARTIAL', NN);
|
||||
din('device-operation-log/reading-not-whole-seconds.partial', 'the reading of the anchor of record 1 is not a time in whole seconds: it cannot be used, and that anchor is not read', bo, { op: 'set', path: ['readings', 0, 'at'], value: sec(la(1) + 600000) + 0.5 }, 'PARTIAL', NN);
|
||||
din(br, 'the manufacturer retired the first key half an hour after the record that rotated away from it: the two records an anchor read shows existed before the retirement count, the rotation record (whose earliest anchor came after it) does not', bo, { op: 'set', path: ['statusRecords'], value: [F.retiredAfterRotation] }, 'PARTIAL', NN);
|
||||
din('device-operation-log/retired-key-used.partial', 'beside that log, another record of the retired first key for position 1: whoever copied the key may have signed it after the retirement, so it proves nothing against the device, named', br, { op: 'set', path: ['otherRecords'], value: [F.sibling1] }, 'PARTIAL');
|
||||
din('device-operation-log/records-beyond.partial', 'beside the log, a seventh record signed by the key in force at its end: the log shown is not the latest the verifier holds', bo, { op: 'set', path: ['otherRecords'], value: [F.beyond] }, 'PARTIAL', NI);
|
||||
din('device-operation-log/retired-by-another-trusted-manufacturer.partial', 'a retirement of the first key signed by the other manufacturer the verifier trusts: not applied, and not passed over (the same key may carry that manufacturer\'s credential too)', bt, { op: 'set', path: ['statusRecords'], value: [F.retiredByOtherManufacturer] }, 'PARTIAL', NI);
|
||||
valid('device-operation-log/empty.partial', A, 'a log that carries no record: nothing in it says anything about the machine\'s operation', src, { log: X.empty, ...X.options, readings: [], beacons: [] }, { exercises: OK, verdict: 'PARTIAL', levels: { ...AP, ...NI } });
|
||||
// refused: one operation on the log or on what the verifier brings, or one change at the producer (a record or a credential signed again)
|
||||
const o = (nume, titlu, op, r, opt = {}) => invalid('device-operation-log/six-records.' + nume, titlu, bo, op, r, opt);
|
||||
const prod = (nume, titlu, cale, val, r, nota, levels = {}) => { const input = clona(V.find((x) => x.id === bo).input); let t = input; for (const k of cale.slice(0, -1)) t = t[k]; t[cale[cale.length - 1]] = clona(val);
|
||||
invalid('device-operation-log/six-records.' + nume, titlu, bo, null, r, { levels, producer: { note: nota, input, changed: [cale] } }); };
|
||||
o('form', 'the file is of another kind', { op: 'set', path: ['log', 'kind'], value: 'aere-device-bundle' }, ['operation.form'], { levels: OPRIT });
|
||||
o('form-version', 'a log of another version', { op: 'set', path: ['log', 'v'], value: 2 }, ['operation.form'], { levels: OPRIT });
|
||||
o('form-member-more', 'a member more beside the log', { op: 'add', path: ['log', 'note'], value: 'x' }, ['operation.form'], { levels: OPRIT });
|
||||
o('identity-untrusted-manufacturer', 'the verifier trusts another manufacturer: neither credential is accepted, and no record is judged', { op: 'set', path: ['trustedManufacturers'], value: [X.ids.otherManufacturer] }, ['operation.identity'], { levels: NI });
|
||||
o('identity-recalled', 'the manufacturer\'s current recall list recalls the credential of the first key: no record of it is judged (a recall carries no time)', { op: 'set', path: ['statusLists'], value: [F.recalledList] }, ['operation.identity'], { levels: NI });
|
||||
o('identity-signature', 'the ML-DSA-65 half of the manufacturer\'s signature on the first credential has one character changed', { op: 'set', path: ['log', 'credentials', 0, 'signature', 'mldsa65'], value: schimba(X.log.credentials[0].signature.mldsa65) }, ['operation.identity'], { levels: NI });
|
||||
o('identity-second-key', 'the ML-DSA-65 half of the manufacturer\'s signature on the second credential has one character changed: the records of the first key are judged, the first record of the second key is not', { op: 'set', path: ['log', 'credentials', 1, 'signature', 'mldsa65'], value: schimba(X.log.credentials[1].signature.mldsa65) }, ['operation.identity']);
|
||||
o('record-form', 'record 2 carries a state that is not one of the four', { op: 'set', path: ['log', 'records', 2, 'statement', 'state'], value: 'broken' }, ['operation.record-form'], { levels: OPRIT });
|
||||
o('record-form-day', 'record 2 is dated on a day that does not exist (September 31)', { op: 'set', path: ['log', 'records', 2, 'statement', 'at'], value: R[2].statement.at.replace(/^2026-10-01/, '2026-09-31') }, ['operation.record-form'], { levels: OPRIT });
|
||||
o('record-signature', 'the signature of record 3 has one character changed', { op: 'set', path: ['log', 'records', 3, 'signature', 'value'], value: schimba(R[3].signature.value) }, ['operation.record-signature']);
|
||||
o('record-signature-member-more', 'the signature object of record 3 carries a member more: another text of the same signed record', { op: 'add', path: ['log', 'records', 3, 'signature', 'note'], value: 'x' }, ['operation.record-signature']);
|
||||
o('record-removed', 'record 3 taken out: record 4 stands at position 3 and names a record that is not before it', { op: 'remove', path: ['log', 'records', 3] }, ['operation.record-prev', 'operation.record-seq']);
|
||||
o('record-time-ahead', 'the verifier\'s clock is at hour 4: record 4 is dated more than its tolerance ahead of it', { op: 'set', path: ['now'], value: new Date(Date.parse(X.options.now) - 2 * OPL.ORA).toISOString() }, ['operation.record-time']);
|
||||
invalid('device-operation-log/clock-30s-behind.record-time-no-tolerance', 'the same clock, 30 seconds behind the last record, and the verifier allows its clock no tolerance', bc, { op: 'add', path: ['clockSkewS'], value: 0 }, ['operation.record-time']);
|
||||
o('key-retired', 'the manufacturer retired the first key at the very time of record 1: record 1 is refused, and record 0, which no anchor read shows existed before, is not counted', { op: 'set', path: ['statusRecords'], value: [F.retiredAtRecord1] }, ['operation.key-retired']);
|
||||
// NOT a vector, said: the credential of the second key taken out (the rotation names a key no credential of the log certifies). The
|
||||
// verifier refuses it for `rotation`; with that rule planted out, though, the walk reaches a position with no key in force and the
|
||||
// verifier's own guard against a walk that stops without a refusal throws, which this suite's control counts as a broken vector, not a
|
||||
// fail (measured 2026-10-20). The case is held by the operation component's own probe (its row A25), where the planting turns it red
|
||||
o('anchor-envelope', 'the anchor of record 1 names another device as its source after it was hashed', { op: 'set', path: ['log', 'anchors', 0, 'statement', 'source'], value: X.ids.key2 }, ['operation.anchor-envelope']);
|
||||
o('witness-time', 'the verifier read the anchor of record 1 two minutes before the time the record carries: the record is dated after it was on the chain', { op: 'set', path: ['readings', 0, 'at'], value: sec(la(1) - 120000) }, ['operation.witness-time']);
|
||||
o('beacon-hash', 'record 2 names block 1002 with a hash the verifier did not read there', { op: 'set', path: ['beacons', 2, 'hash'], value: '0x' + 'ab'.repeat(32) }, ['operation.beacon-hash']);
|
||||
o('beacon-time', 'the verifier read block 1002 two minutes after the time record 2 carries: the record is dated before the block it names existed', { op: 'set', path: ['beacons', 2, 'at'], value: sec(la(2) + 120000) }, ['operation.beacon-time']);
|
||||
o('equivocation', 'beside the log, another record the second key signed for position 3: a proof of equivocation', { op: 'set', path: ['otherRecords'], value: [F.sibling3] }, ['operation.equivocation']);
|
||||
o('equivocation-first-key', 'beside the log, another record the first key signed for position 1', { op: 'set', path: ['otherRecords'], value: [F.sibling1] }, ['operation.equivocation']);
|
||||
const r3 = ['log', 'records', 3];
|
||||
prod('record-key', 'record 3 signed by the first key, which the log rotated away from at record 2', r3, F.recordKey, ['operation.record-key'], 'the holder of the first key signed position 3 under its own device id');
|
||||
prod('record-seq', 'record 3 carries position 7, signed again by the second key', r3, F.recordSeq, ['operation.record-seq'], 'the second key signed record 3 with seq 7');
|
||||
prod('record-prev', 'record 3 names record 1 as the one before it, signed again by the second key', r3, F.recordPrev, ['operation.record-prev'], 'the second key signed record 3 naming the hash of record 1');
|
||||
prod('record-time-back', 'record 3 dated a minute before record 2, signed again by the second key (naming no block)', r3, F.recordTimeBack, ['operation.record-time'], 'the second key signed record 3 with an earlier time and no block');
|
||||
prod('record-counter', 'record 3 with a counter one lower than record 2\'s, signed again by the second key', r3, F.recordCounter, ['operation.record-counter'], 'the second key signed record 3 with a lower counter');
|
||||
prod('key-window-before', 'record 0 dated 31 days before the time it carried, a day before its credential begins, signed again by the first key (naming no block)', ['log', 'records', 0], F.keyWindowBefore, ['operation.key-window'], 'the first key signed record 0 with a time before its credential\'s validity');
|
||||
const c1 = ['log', 'credentials', 1];
|
||||
prod('key-window-ended', 'the credential of the second key ends at hour 4: record 4 is dated after it', c1, F.credentialEnded, ['operation.key-window'], 'the manufacturer certified the second key until hour 4');
|
||||
prod('rotation-model', 'the credential of the second key is for another model', c1, F.credentialOtherModel, ['operation.rotation'], 'the manufacturer certified the second key for model AX-300');
|
||||
prod('rotation-serial', 'the credential of the second key is for another serial', c1, F.credentialOtherSerial, ['operation.rotation'], 'the manufacturer certified the second key for serial SN-0002');
|
||||
prod('rotation-other-key', 'the second credential of the log certifies another key than the one the rotation names', c1, F.credentialOtherKey, ['operation.rotation'], 'the manufacturer\'s credential of a third key stands where the second key\'s should');
|
||||
prod('anchor-envelope-other-source', 'an anchor of record 1 that hashes right and names another device as its source', ['log', 'anchors', 0], F.anchorOtherSource, ['operation.anchor-envelope'], 'an anchor envelope about record 1 built with another source');
|
||||
// the verifier's own verdict on every vector above: a vector that says what the verifier does not is not written
|
||||
for (const v of V.filter((x) => x.artifact === A)) { const i = v.input, op = { now: i.now }; for (const k of ['clockSkewS', 'trustedManufacturers', 'statusLists', 'statusRecords', 'readings', 'beacons', 'otherRecords']) if (i[k] !== undefined) op[k] = i[k];
|
||||
const r = OP.verifyOperation(i.log, op), ast = v.expected.failed.map((x) => x.replace(/^operation\./, '')).sort();
|
||||
if (r.verdict !== v.expected.verdict || r.rules.join() !== ast.join()) throw new Error(`vector ${v.id}: the operation verifier gives ${r.verdict} [${r.rules}], the vector says ${v.expected.verdict} [${ast}]`); } }
|
||||
// (P) the reputation of a machine (2026-10-20, B7): the figures somebody states for the facts of an operation log and the parameters chosen,
|
||||
// checked by computing the published formula aere-device-reputation/1 again. DERIVED by the producer of these vectors in the device operation
|
||||
// component (its genereaza-vectori.mjs: eight logs made once by its producers, every key discarded; the operation verifier gives the facts,
|
||||
// the formula gives the reputation, one operation on a VALID input gives each INVALID one). Each of its vectors is taken through this suite's
|
||||
// forms: an INVALID one is its base here with the one operation applied here, and must be byte for byte the input the component derived
|
||||
{ const A = 'device-reputation'; const RK = Object.keys(HARTA).filter((r) => r.startsWith('reputation.'));
|
||||
for (const m of vectoriReputatie()) {
|
||||
if (m.artifact !== A) throw new Error('the reputation producer gave a vector of another kind: ' + m.id);
|
||||
if (!m.base) valid(m.id, A, m.title, 'the device operation component, ' + m.source, m.input, { exercises: RK });
|
||||
else invalid(m.id, m.title, m.base, m.mutation, m.expected.failed);
|
||||
const v = V[V.length - 1];
|
||||
if (JSON.stringify(v.input) !== JSON.stringify(m.input) || JSON.stringify(v.expected) !== JSON.stringify({ verdict: m.expected.verdict, failed: m.expected.failed, levels: v.expected.levels }) || LEVELS.some((l) => v.expected.levels[l] !== m.expected.levels[l]))
|
||||
throw new Error('vector ' + m.id + ': this suite\'s form of it is not what the device operation component derived'); } }
|
||||
// (E) a dataset: a record, a range answer, a consistency proof, an availability sample
|
||||
const DS = P.dataset; const REC = ['dataset.form', 'dataset.commitment', 'dataset.field', 'dataset.inclusion']; const src = 'producer (verifiable-data), random salts, generated ' + P.at;
|
||||
valid('dataset-record/r5.valid', 'dataset-record', 'one record against the commitment of version 2, two fields disclosed', src, { record: DS.record, commitment: DS.newer }, { exercises: REC });
|
||||
|
||||
Reference in new issue
Block a user