🎯 Problem Statement
To create an immutable provenance passport for an indigenous micro-lot (coffee, honey, or backstrap loom textiles), we must compute a deterministic cryptographic digest combining:
- Producer identification and parcel location.
- The authentic oral audio testimonial in an indigenous variant (Tu'un Savi, Zapotec, or Spanish).
- The photograph of the harvested batch or textile sample.
- Unix timestamp and geographical coordinates (5-decimal precision).
🛠️ Technical Tasks
✅ Definition of Done (Acceptance Criteria)
- Target Module:
src/core/crypto/CryptoEngine.ts
🎯 Problem Statement
To create an immutable provenance passport for an indigenous micro-lot (coffee, honey, or backstrap loom textiles), we must compute a deterministic cryptographic digest combining:
🛠️ Technical Tasks
CryptoEngine.computeSha256()to acceptstring,Uint8Array, andArrayBuffer.canonicalizeLotPayload(input: LotDigestInput): stringensuring dictionary keys are sorted alphabetically before serialization to prevent cross-platform hash discrepancies.window.crypto.subtlein browsers with automatic fallback to Node'snode:cryptowhen run server-side or in CI unit tests.src/core/crypto/__tests__/CryptoEngine.test.tswith at least 6 deterministic test vectors.✅ Definition of Done (Acceptance Criteria)
npm run testpasses 100% without UI or React dependencies.src/core/crypto/CryptoEngine.ts