]> www.infradead.org Git - users/jedix/linux-maple.git/commit
crypto: rsa - restrict plaintext/ciphertext values more
authorJoachim Vandersmissen <git@jvdsn.com>
Sat, 3 Feb 2024 07:19:59 +0000 (01:19 -0600)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 9 Feb 2024 04:57:18 +0000 (12:57 +0800)
commite8829ef1f73fa4051a936ab9f0204195dae4ef2b
tree7393a8af5d26823a325da50a8d6d588741dc2c6f
parent9567d3dc760931afc38f7f1144c66dd8c4b8c680
crypto: rsa - restrict plaintext/ciphertext values more

SP 800-56Br2, Section 7.1.1 [1] specifies that:
1. If m does not satisfy 1 < m < (n – 1), output an indication that m is
out of range, and exit without further processing.

Similarly, Section 7.1.2 of the same standard specifies that:
1. If the ciphertext c does not satisfy 1 < c < (n – 1), output an
indication that the ciphertext is out of range, and exit without further
processing.

This range is slightly more conservative than RFC3447, as it also
excludes RSA fixed points 0, 1, and n - 1.

[1] https://doi.org/10.6028/NIST.SP.800-56Br2

Signed-off-by: Joachim Vandersmissen <git@jvdsn.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/rsa.c