Skip to content

Adopt stateless per-object TLV blob versioning protocol - #311

Open
sasdf wants to merge 3 commits into
lowRISC:mainfrom
sasdf:mjTzzvkmqtm
Open

Adopt stateless per-object TLV blob versioning protocol#311
sasdf wants to merge 3 commits into
lowRISC:mainfrom
sasdf:mjTzzvkmqtm

Conversation

@sasdf

@sasdf sasdf commented Aug 20, 2026

Copy link
Copy Markdown

Transition personalization blob encoding and decoding from whole-blob versioning to self-describing stateless TLV objects protocol introduced in lowRISC/opentitan#30994.

(Please find the protocol description in the opentitan PR description above)

sasdf added 3 commits August 20, 2026 12:06
Transition C++ personalization blob encoding and decoding from whole-blob
versioning to self-describing stateless TLV objects:
- Define kPersoTlvVersionPrefixV1 (0x010004F0) and capacity limits
  (kCrthV0MaxCertNameLen, kObjhV0MaxObjSize) in ate_perso_blob.h.
- Implement GetObjectVersion to inspect the 4-byte prefix of V1 objects.
- Implement SelectObjectVersion to automatically select V0 vs V1 format
  based on object payload and cert name length limits.
- Update ReadObjectHeader, ExtractCertObject, ExtractDeviceId, and
  UnpackPersoBlob to unpack objects statelessly without whole-blob versioning.
- Update PackCertTlvObject and PackSeedTlvObject to auto-version each object.
- Remove obsolete GetPersoBlobVersion function and blob_version parameter
  from public API functions (PackPersoBlob, PackRegistryPersoTlvData).
- Update test_programs/ft.cc and ate_perso_blob_test.cc.

Signed-off-by: Yi-Hsuan Deng <yhdeng@google.com>
Change-Id: I91b36e1b8f3a94b03e1f5f1116c3822d6a6a6964
Transition Go personalization blob encoding and decoding from whole-blob
versioning to self-describing stateless TLV objects:
- Define persoTlvVersionPrefixV1 ([0xF0, 0x04, 0x00, 0x01]) and capacity
  constants (kCrthV0MaxCertNameLen, kObjhV0MaxObjSize).
- Implement getObjectVersion to detect V1 object prefixes.
- Implement selectObjectVersion to automatically determine V0 vs V1 format
  based on object size and certificate label length.
- Update getObjectHeaderFields, extractCertObject, and UnpackPersoBlob
  to unpack objects statelessly without relying on whole-blob versioning.
- Update BuildPersoBlob to auto-version objects and remove whole-blob
  version object headers.
- Remove obsolete GetPersoBlobVersion function and blobVersion parameter
  from BuildPersoBlob.
- Update callers in dututils.go and loadtest.go.

Signed-off-by: Yi-Hsuan Deng <yhdeng@google.com>
Change-Id: I46763e5c95f1a95723693c5eb97dc2606a6a6964
Add Known Answer Tests (KAT) to verify full output wire byte matching
against known encoded blobs:
- TestBuildPersoBlobV0WireFormat: validates legacy 16-bit object and
  cert headers without prefix.
- TestBuildPersoBlobV1WireFormat: validates 4-byte version prefix
  (0xF0040001) and 32-bit object and cert headers.

Signed-off-by: Yi-Hsuan Deng <yhdeng@google.com>
Change-Id: I004fd96d48900cdb07d70367ec792f236a6a6964
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants