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

Add scrypt KDF #226

Merged
merged 2 commits into from
Jun 29, 2022
Merged

Add scrypt KDF #226

merged 2 commits into from
Jun 29, 2022

Conversation

geitda
Copy link
Contributor

@geitda geitda commented May 5, 2022

Add a new KDF algorithm type for scrypt. Field names are pulled exactly from RFC7914.
Added some logic (but no direct tests for it) in EncryptionAlgorithm.kdf_hmac and EncryptionAlgorithm.kdf_iterations to return None as scrypt has no concept of those, but as it has both a salt and (optional) key_length parameter, EncryptionAlgorithm.kdf_salt and EncryptionAlgorithm.key_length can be left as-is. I created a test case modeled after the ccm_parameters test - it loads an entire EncryptionAlgorithm but only tests the KdfAlgorithm part we're interested in. Again, additional tests for the kdf_* and key_length properties may be prudent. Creating other files to test with is easy using openssl pkcs8 -scrypt and any of the optional switches that go with that (-scrypt_N N, -scrypt_r r, or -scrypt_p p)

@geitda geitda mentioned this pull request May 19, 2022
@wbond
Copy link
Owner

wbond commented Jun 28, 2022

Sorry that I missed this earlier. Could you rebase on master so we can try and get all of the CI jobs to run? For some reason only a couple did.

@wbond wbond merged commit b5f03e6 into wbond:master Jun 29, 2022
@wbond
Copy link
Owner

wbond commented Jun 29, 2022

Awesome, thank you for this enhancement!

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.

None yet

2 participants