Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User iterator instead of temporary buffer for CertifyKey TCB #359

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jhand2
Copy link
Collaborator

@jhand2 jhand2 commented Oct 8, 2024

When encoding TcbInfos, do not make a temporary buffer to copy all the
TCI measurements. This adds multiple KiB of stack usage. Instead, add a
function to allow the X.509 library to create an iterator for the TCB of
the node.

This allows the main DPE context array to be used as the backing memory
when encoding TcbInfos instead of using extra stack space.

This reduces stack usage by ~350 bytes

@jhand2 jhand2 changed the title WIP: Optimize stack usage User iterator instead of temporary buffer for CertifyKey TCB Oct 9, 2024
@jhand2 jhand2 marked this pull request as ready for review October 9, 2024 05:31
@jhand2 jhand2 requested a review from zhalvorsen October 11, 2024 18:06
zhalvorsen
zhalvorsen previously approved these changes Oct 11, 2024
dpe/src/x509.rs Outdated Show resolved Hide resolved
dpe/src/context.rs Outdated Show resolved Hide resolved
dpe/src/context.rs Outdated Show resolved Hide resolved
When encoding TcbInfos, do not make a temporary buffer to copy all the
TCI measurements. This adds multiple KiB of stack usage. Instead, add a
function to allow the X.509 library to create an iterator for the TCB of
the node.

This allows the main DPE context array to be used as the backing memory
when encoding TcbInfos instead of using extra stack space.
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