Skip to content

Commit 1f1dc86

Browse files
committed
Fix checksum conversion to base w
- innocuous for currently tested parameter sets
1 parent 9a83754 commit 1f1dc86

File tree

1 file changed

+1
-1
lines changed
  • core/src/main/java/org/bouncycastle/pqc/crypto/sphincsplus

1 file changed

+1
-1
lines changed

core/src/main/java/org/bouncycastle/pqc/crypto/sphincsplus/WotsPlus.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public byte[] sign(byte[] M, byte[] skSeed, byte[] pkSeed, ADRS paramAdrs)
8484
}
8585
int len_2_bytes = (engine.WOTS_LEN2 * engine.WOTS_LOGW + 7) / 8;
8686
byte[] bytes = Pack.intToBigEndian(csum);
87-
msg = Arrays.concatenate(msg, base_w(Arrays.copyOfRange(bytes, len_2_bytes, bytes.length), w, engine.WOTS_LEN2));
87+
msg = Arrays.concatenate(msg, base_w(Arrays.copyOfRange(bytes, 4 - len_2_bytes, bytes.length), w, engine.WOTS_LEN2));
8888
byte[][] sig = new byte[engine.WOTS_LEN][];
8989
for (int i = 0; i < engine.WOTS_LEN; i++)
9090
{

0 commit comments

Comments
 (0)