Adopt stateless per-object TLV blob versioning protocol - #311
Open
sasdf wants to merge 3 commits into
Open
Conversation
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
timothytrippel
approved these changes
Aug 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)