6 Commits

Author SHA1 Message Date
Brian Smith
a5e5df273c Add more RSA key length tests. 2018-11-28 12:34:39 -10:00
Brian Smith
97d5877fbf Report unsupported RSA private key length at during key construction.
Previously, one could construct an RSA key pair "successfully" even if
the bit length of the private moduli was not evenly divisible by 512.
However, using such a key to sign something would (usually) fail on
x86-64 because the x86-64 signing code requires the modulus to be an
even multiple of 8 limbs.

Now, all keys that have private primes with lengths that aren't
multiples of 512 bits will be rejected at key construction time with
error "PrivateModulusLenNotMultipleOf512Bits".
2018-11-28 11:52:18 -10:00
Brian Smith
9968baa55d Report some details of why asymmetric keys were rejected. 2018-11-28 11:52:18 -10:00
Brian Smith
d42f9d5e21 Fix test cases in PKCS#8.
The test case was accidentally a duplicate of the one that follows it.
Fix it so that it is badly encoded in the way described in the comment.
2018-11-28 11:22:37 -10:00
Gavin Li
c95e96bb48 Add support for keys where p < q
Support them by swapping (p, dP) and (q, dQ) and recalculating qInv
ourselves. Added a few test vectors for |p < q|
parsing/signing/verification.

I agree to license my contributions to each file under the terms given
at the top of each file I changed.
2018-05-04 08:57:38 -10:00
Brian Smith
30093dd947 Convert RSA PKCS#8 tests to file tests. 2017-05-16 18:00:02 -10:00