Skip to content

Commit

Permalink
PaxeStackClusterTest works
Browse files Browse the repository at this point in the history
  • Loading branch information
simbo1905 committed Jan 12, 2025
1 parent ea61fb0 commit e80869c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions trex-paxe/src/main/java/com/github/trex_paxos/paxe/SRPUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,17 @@ public static String u(String N, String a, String b) {

byte[] aBytes = fromHex(a);
byte[] paddedABytes = new byte[nBytes.length];
System.arraycopy(aBytes, 0, paddedABytes, nBytes.length - paddedABytes.length, paddedABytes.length);
System.arraycopy(aBytes, 0, paddedABytes,
nBytes.length - aBytes.length, // Use aBytes.length for offset
aBytes.length); // Copy only aBytes.length bytes

byte[] bBytes = fromHex(b);
byte[] paddedBBytes = new byte[nBytes.length];
System.arraycopy(bBytes, 0, paddedBBytes, nBytes.length - paddedBBytes.length, paddedBBytes.length);
System.arraycopy(bBytes, 0, paddedBBytes,
nBytes.length - bBytes.length, // Use bBytes.length for offset
bBytes.length); // Copy only bBytes.length bytes

byte[] hashed = SRPUtils.H(aBytes, bBytes);
byte[] hashed = SRPUtils.H(paddedABytes, paddedBBytes);
return toHex(hashed);
}

Expand Down

0 comments on commit e80869c

Please sign in to comment.