Hi,
I have a question about an assertion used by the DhTest.testKeyPairGenerator and DhTest.testDefaultKeyPairGenerator tests.
These tests generate a DH key pair and then makes the assertion:
assertTrue(x.bitLength() >= (keySize / 2) - 32)
where x is the DH
private key value.
According to NIST.SP.800-56Ar2, section 5.6.1.1, the
private key, x, is a randomly selected integer in the range 1-(q-1)
which doesn't limit the minimum bit length.
FIPS 186-4 section B.1.1
also states that: 0 ≤ c mod (q–1) ≤ q–2 and implies that 1 ≤ x ≤
q–1. So this also indicates that there is not a minimum bit length
required.
Is the requirement for this assertion documented anywhere or is it a ‘best
practices’ requirement?
Regards,
Calvin.