I am wrapping the
RSACng class from the .Net API.
Whilst unit testing, I run checks against an array of possibilities:
- Key Size = 1024, 2048, or 3072 bits
- Padding Mode = PKCS v1, or PSS (=PKCS v2?)
- Hash Algorithm = SHA-1, SHA256, SHA512
I test for all 3*2*3=18 possible configurations. All tests pass except one combination:
- Key size = 1024 bits
- Padding Mode = PSS
- Hash Algorithm = SHA512
Should this be expected, and how could have I anticipated it? So far, Google has not been my friend.
I also ran a similar batch of unit tests for RSA encryption, and noted a 1024 bits key is incompatible with OAEP-SHA1 and OAEP-SHA256 padding modes. I suspect the key is not large enought, but I was again unable to read some info as to why this was happening.