feat: add test for RSA 4096 operability#488
Conversation
| /** | ||
| * @brief generate an RSA keypair | ||
| * | ||
| * @param public_key the public key struct to populate, should be initialized first | ||
| * @param private_key the private key struct to populate, should be initialized first | ||
| * @param keysize the size of the key to generate, e.g. 2048 | ||
| */ | ||
| int atchops_rsa_generate(atchops_rsa_key_public_key *public_key, atchops_rsa_key_private_key *private_key, | ||
| const atchops_md_type md_type); | ||
|
|
There was a problem hiding this comment.
This was removed from the public API with no replacement for its functionality.
There was a problem hiding this comment.
It is redundant code, tests pass without it as no code utilises the func. I believe @JeremyTubongbanua has a different way to generate key pair elsewhere
There was a problem hiding this comment.
generation code is in rsa_key.h/.c
There was a problem hiding this comment.
Have we added support for specifying the size of the key when we generate?
There was a problem hiding this comment.
Not from an end-developer PoV, I suppose. The way the code is structured allows for 256 or 512-sized keys dynamically and is documented in the code, but if the sdk is utilised in the CLI, I don't think this would be known
There was a problem hiding this comment.
Oh interesting, I wonder what's gone wrong with my test then
There was a problem hiding this comment.
Well, for generate, it's probably only testing rsa2048. but for hard-code 4096 keys in the tests, everything (in theory) should be working fine
There was a problem hiding this comment.
It would be nice to decrypt the ciphertext after, and check that the value is the same though.
There was a problem hiding this comment.
Or since the key is hardcoded in the tests at least check against the expected ciphertext
There was a problem hiding this comment.
It would be nice to decrypt the ciphertext after, and check that the value is the same though.
I'll write a test for that such that it'll check against what the expected ciphertext would be
- What I did
Added test that verifies at_c's capability of withstanding a 512-byte key
- How I did it
Updated verify func to determine if 256 or 512-byte key is used, created a test that uses a 512-byte generated public key
- How to verify it
Run the tests and verify that tests pass with
- Description for the changelog
feat: tests for RSA 4096