Is K computed properly?

Issue #26 resolved
Josh Brown created an issue

The code for computing K is:

public BigInteger computeK(final MessageDigest digest,
                                      final BigInteger N, 
                                      final BigInteger g) {
    
        return hashPaddedPair(digest, N, N, g);
    }
    

hashPaddedPair pads both the 3rd (N) and 4th (g) argument.

However, RFC5054 says the following:

k = SHA1(N | PAD(g))

In the RFC, only g is padded however in the library both N and g are padded.

Is this incorrect or am I missing something?

Comments (2)

  1. Log in to comment