Minor pq usage tweak
This commit is contained in:
parent
21eb87781e
commit
7cfd9034d0
|
@ -26,18 +26,16 @@ public class Authenticator {
|
|||
// Note that Java uses big endian, which is correct here
|
||||
final BigInteger pq = new BigInteger(resPq.pq());
|
||||
final Pair<BigInteger, BigInteger> pqPair = Utils.factorize(pq);
|
||||
final BigInteger p = pqPair.getKey();
|
||||
final BigInteger q = pqPair.getValue();
|
||||
|
||||
// Once again, as big endian
|
||||
final byte[] pBytes = p.toByteArray();
|
||||
final byte[] qBytes = q.toByteArray();
|
||||
final byte[] p = pqPair.getKey().toByteArray();
|
||||
final byte[] q = pqPair.getValue().toByteArray();
|
||||
|
||||
final BigInteger newNonce = new BigInteger(Utils.randomBytes(32));
|
||||
final byte[] pqInnerData = new Types.PQInnerData()
|
||||
.pq(resPq.pq())
|
||||
.p(pBytes)
|
||||
.q(qBytes)
|
||||
.p(p)
|
||||
.q(q)
|
||||
.nonce(resPq.nonce())
|
||||
.serverNonce(resPq.serverNonce())
|
||||
.newNonce(newNonce)
|
||||
|
@ -61,8 +59,8 @@ public class Authenticator {
|
|||
new Functions.ReqDHParams()
|
||||
.nonce(resPq.nonce())
|
||||
.serverNonce(resPq.serverNonce())
|
||||
.p(pBytes)
|
||||
.q(qBytes)
|
||||
.p(p)
|
||||
.q(q)
|
||||
.publicKeyFingerprint(targetFingerprint)
|
||||
.encryptedData(cipherText)
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue