This is DSA parameters length from NIST.FIPS.186-4 and NIST.FIPS.186-3:
L = 1024, N = 160
L = 2048, N = 224
L = 2048, N = 256
L = 3072, N = 256
And this is code for parameters initialization from OpenJDK
protected void engineInit(int strength, SecureRandom random) {
if ((strength >= 512) && (strength <= 1024) && (strength % 64 == 0)) {
this.valueN = 160;
} else if (strength == 2048) {
this.valueN = 224;
// } else if (strength == 3072) {
// this.valueN = 256;
} else {
throw new InvalidParameterException
("Prime size should be 512 - 1024, or 2048");
}
this.valueL = strength;
this.seedLen = valueN;
this.random = random;
}
My questions:
AFAIK strength of DSA is equals to length of used hash function and hash function length is N. Maybe this init function should take strength argument like 160, 225 and 256, and not 512-1024, 2048?
Am I right in saying that in this implementation of DSA situation with
L = 2048, N = 256
is completly ignored?
EDIT
Well, it looks like code from OpenJDK uses parameters of old DSA standard FIPS.186-2. But javadoc for DSA.java clearly says that this implementation uses FIPS.186-3 as standard source. Is it possible that developers just forgot to update this part of code while upgrading java DSA implementation or something like that? Could this be a security vulnerability?