Skip to content

Add Mechanism::AesCtr - #365

Merged
wiktor-k merged 2 commits into
parallaxsecond:mainfrom
sietseringers:add-aes-ctr-mechanism
Aug 20, 2026
Merged

Add Mechanism::AesCtr#365
wiktor-k merged 2 commits into
parallaxsecond:mainfrom
sietseringers:add-aes-ctr-mechanism

Conversation

@sietseringers

Copy link
Copy Markdown
Contributor

Adds support for the CKM_AES_CTR mechanism, which was already exposed as a MechanismType but could not be used as a Mechanism because its parameter type had no safe wrapper.

I am interested in this because I am thinking of basing an implementation of AES-SIV (RFC 5297) on top of this, which is based on AES-CTR.

Changes

  • New module defining AesCtrParams, which is a #[repr(transparent)] wrapper around CK_AES_CTR_PARAMS.
  • New Mechanism::AesCtr(AesCtrParams) variant, wired into Mechanism::mechanism_type().

@hug-dev hug-dev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you! Looks good with a small comment. You might need to sign-off your commit (git commit --signoff) for the DCO check to pass :)

Comment thread cryptoki/src/mechanism/aes_ctr.rs
wiktor-k
wiktor-k previously approved these changes Aug 20, 2026

@wiktor-k wiktor-k left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks nice, thanks! Of course @hug-dev remarks stand :)

Comment thread cryptoki/src/mechanism/aes_ctr.rs
Signed-off-by: Sietse Ringers <mail@sietseringers.net>
@sietseringers
sietseringers force-pushed the add-aes-ctr-mechanism branch from 4e65739 to f3c06ff Compare August 20, 2026 12:22
Add empty line after header in rustdoc

Co-authored-by: Wiktor Kwapisiewicz <wiktor@metacode.biz>
Signed-off-by: Sietse Ringers <sietseringers@users.noreply.github.com>

@wiktor-k wiktor-k left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Let's go 🚀

@wiktor-k
wiktor-k merged commit 6bc1220 into parallaxsecond:main Aug 20, 2026
44 checks passed
@sietseringers
sietseringers deleted the add-aes-ctr-mechanism branch August 20, 2026 15:39
@sietseringers

Copy link
Copy Markdown
Contributor Author

Great, thanks!

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