Skip to content

Conversation

@renjiezh
Copy link
Contributor

No description provided.

@wfa-reviewable
Copy link

This change is Reviewable

@renjiezh renjiezh requested a review from SanjayVas December 16, 2025 18:27
@SanjayVas SanjayVas changed the title feat: Update TrusTEE mill to use StreamingAead fix: Update TrusTEE mill to use StreamingAead Dec 16, 2025
Copy link
Member

@SanjayVas SanjayVas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SanjayVas reviewed 5 of 5 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @renjiezh)


src/main/kotlin/org/wfanet/measurement/duchy/mill/trustee/TrusTeeMill.kt line 224 at r1 (raw file):

  }

  private fun decryptRequisitionData(dek: KeysetHandle, data: ByteString): ByteArray {

nit: This isn't really taking advantage of the streaming aspect. The idea is to pass in each chunk while reading the blob, meaning you'd need to change getRequisitionData. See StreamingAead.decrypt in common-jvm.

Of course, there's less benefit if you need the whole plaintext in memory, but it still avoids having both the full plaintext and ciphertext in memory at the same time.

Maybe leave a TODO?

@renjiezh renjiezh force-pushed the renjiez-trustee-duchy-patch branch from e839386 to a71e389 Compare December 17, 2025 04:55
Copy link
Contributor Author

@renjiezh renjiezh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 3 of 5 files reviewed, all discussions resolved (waiting on @SanjayVas)


src/main/kotlin/org/wfanet/measurement/duchy/mill/trustee/TrusTeeMill.kt line 224 at r1 (raw file):

Previously, SanjayVas (Sanjay Vasandani) wrote…

nit: This isn't really taking advantage of the streaming aspect. The idea is to pass in each chunk while reading the blob, meaning you'd need to change getRequisitionData. See StreamingAead.decrypt in common-jvm.

Of course, there's less benefit if you need the whole plaintext in memory, but it still avoids having both the full plaintext and ciphertext in memory at the same time.

Maybe leave a TODO?

Added a TODO.

Copy link
Collaborator

@stevenwarejones stevenwarejones left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stevenwarejones reviewed 2 of 5 files at r1, 2 of 2 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @renjiezh)


src/main/kotlin/org/wfanet/measurement/duchy/mill/trustee/TrusTeeMill.kt line 229 at r2 (raw file):

      val streamingAead = dek.getPrimitive(StreamingAead::class.java)
      val decryptingStream = streamingAead.newDecryptingStream(data.newInput(), byteArrayOf())
      return decryptingStream.readAllBytes()

i'd prefer this leverage/get combined with existing common-jvm classes like WithEnvelopeEncryption or StreamingEncryption or StreamingAeadStorageClient

Copy link
Contributor Author

@renjiezh renjiezh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @stevenwarejones)


src/main/kotlin/org/wfanet/measurement/duchy/mill/trustee/TrusTeeMill.kt line 229 at r2 (raw file):

Previously, stevenwarejones (Steven Ware Jones) wrote…

i'd prefer this leverage/get combined with existing common-jvm classes like WithEnvelopeEncryption or StreamingEncryption or StreamingAeadStorageClient

That is a good point. I have created an ticket [https://github.com//issues/2800] for it.
Now my PRs are stacking on each other. It takes time for me to verify these type of change. Can we get PRs merged and then work on the improvements?

Copy link
Collaborator

@stevenwarejones stevenwarejones left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stevenwarejones reviewed 1 of 5 files at r1.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @renjiezh)

@renjiezh renjiezh enabled auto-merge (squash) December 17, 2025 18:15
@renjiezh renjiezh merged commit 8bb62aa into main Dec 17, 2025
5 checks passed
@renjiezh renjiezh deleted the renjiez-trustee-duchy-patch branch December 17, 2025 18:47
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.

5 participants