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

Session.find_objects(): implement fewer calls to C_FindObjects() #214

Merged

Conversation

keldonin
Copy link
Collaborator

This PR contains code that optimizes Session.find_objects(). It essentially quit the loop as soon as less than MAX_OBJECT_COUNT have been returned by C_FindObjects().

It typically results in calling one less time the underlying API C_FindObjects().

Testing code included.

@keldonin keldonin force-pushed the implement_fewer_C_FindObjects_iterations branch from 6cbd0b1 to 2676100 Compare August 27, 2024 20:34
hug-dev
hug-dev previously approved these changes Aug 28, 2024
cryptoki/src/session/object_management.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@wiktor-k wiktor-k left a comment

Choose a reason for hiding this comment

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

Yup, this looks similar to the C examples I've seen in the wild.

Thanks for adding the tests too! 👍

@wiktor-k wiktor-k merged commit d6c47a5 into parallaxsecond:main Aug 30, 2024
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