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 ccmparameters test - it loads an entire EncryptionAlgorithm but only tests the KdfAlgorithm part we're interested in. Again, additional tests for the `kdf*andkey_lengthproperties may be prudent. Creating other files to test with is easy usingopenssl pkcs8 -scryptand any of the optional switches that go with that (-scrypt_N N,-scrypt_r r, or-scrypt_p p`)
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
andEncryptionAlgorithm.kdf_iterations
to returnNone
as scrypt has no concept of those, but as it has both asalt
and (optional)key_length
parameter,EncryptionAlgorithm.kdf_salt
andEncryptionAlgorithm.key_length
can be left as-is. I created a test case modeled after the ccmparameters test - it loads an entireEncryptionAlgorithm
but only tests theKdfAlgorithm
part we're interested in. Again, additional tests for the `kdf*and
key_lengthproperties may be prudent. Creating other files to test with is easy using
openssl pkcs8 -scryptand any of the optional switches that go with that (
-scrypt_N N,
-scrypt_r r, or
-scrypt_p p`)