Skip to content

[Quote V5 Support] Implement TDX Quote V5 Proto to Bytes Conversion#83

Merged
Sourabh-25 merged 1 commit intogoogle:mainfrom
Sourabh-25:quote-V5-toAbi
Jan 4, 2026
Merged

[Quote V5 Support] Implement TDX Quote V5 Proto to Bytes Conversion#83
Sourabh-25 merged 1 commit intogoogle:mainfrom
Sourabh-25:quote-V5-toAbi

Conversation

@Sourabh-25
Copy link
Collaborator

This change adds the functionality to serialize the TDX Quote Format V5 protobuf messages back into their raw little-endian ABI byte format. This complements the byte-to-proto parsing added in the previous PR.

NOTE: Stacked PR: This builds on top of my previous pending PR . Please ignore the first commits and only review the final commit which implements quoteToAbiBytes.
Key changes:

  • Proto to Bytes Serialization:

    • Updated QuoteToAbiBytes to dispatch to quoteToAbiBytesV5 for pb.QuoteV5 types.
    • Implemented quoteToAbiBytesV5: Converts the main pb.QuoteV5 message to bytes.
      • Implemented TdQuoteBodyDescriptorToAbiBytes: Converts the pb.TDQuoteBodyDescriptor message to bytes.
      • Implemented TdQuoteBodyV5ToAbiBytes: Converts the pb.TDQuoteBodyV5 message to bytes, handling differences between TDX 1.0 and 1.5 body types.
  • Unit Tests:

    • Added tests in abi_test.go to verify the correctness of the proto-to-bytes conversions.
    • Ensured round-trip conversion integrity: The raw bytes obtained from QuoteToAbiBytes(QuoteToProto(test.RawQuoteV5)) match the original test.RawQuoteV5.
    • Added test cases for nil and invalid inputs for the new TdQuoteBodyDescriptorToAbiBytes and TdQuoteBodyV5ToAbiBytes functions in TestNilToAbiBytesConversions and TestInvalidConversionsToAbiBytes.

@Sourabh-25 Sourabh-25 force-pushed the quote-V5-toAbi branch 2 times, most recently from 5118719 to 3e20e83 Compare December 30, 2025 08:22
@Sourabh-25 Sourabh-25 force-pushed the quote-V5-toAbi branch 2 times, most recently from 19fd3bf to 76e212d Compare December 31, 2025 07:09
@Sourabh-25 Sourabh-25 force-pushed the quote-V5-toAbi branch 2 times, most recently from 6e88e6d to 896a175 Compare December 31, 2025 08:01
@Sourabh-25 Sourabh-25 merged commit 32866d7 into google:main Jan 4, 2026
7 checks passed
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.

3 participants