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

CertifyKey stack usage is incredibly high #356

Open
jhand2 opened this issue Sep 24, 2024 · 1 comment
Open

CertifyKey stack usage is incredibly high #356

jhand2 opened this issue Sep 24, 2024 · 1 comment

Comments

@jhand2
Copy link
Collaborator

jhand2 commented Sep 24, 2024

I was looking at the CertifyKey disassembly and it uses several KiB of stack (as of this writing CertifyKeyCmd::execute uses almost 7KiB of stack).

This is somewhat expected since it needs to be able to generate a several KiB cert, but we should see if we can optimize this a bit. There are lots of temporary byte arrays that we use as scratch space and could maybe eliminate. This will get worse when we go to increase the max cert size (#357), so we should address this now.

@jhand2
Copy link
Collaborator Author

jhand2 commented Sep 24, 2024

For example, this is a pretty big allocation:

const INITIALIZER: TciNodeData = TciNodeData::new();
let mut nodes = [INITIALIZER; MAX_HANDLES];

Instead, we could consider making an iterator that just gets references to the underlying contexts.

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

No branches or pull requests

1 participant