summary refs log tree commit diff
path: root/crypto/src/pqc
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2022-10-10 17:23:21 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2022-10-10 17:23:21 +0700
commit6941ece50b12c7209b67e5e5b784bebf34ea0234 (patch)
treeefd6eff09634127ef1f5731f7a6eb0f85c86ba33 /crypto/src/pqc
parentFix Harakas XOF API compliance (diff)
downloadBouncyCastle.NET-ed25519-6941ece50b12c7209b67e5e5b784bebf34ea0234.tar.xz
Fix checksum conversion to base w
- innocuous for currently tested parameter sets
Diffstat (limited to 'crypto/src/pqc')
-rw-r--r--crypto/src/pqc/crypto/sphincsplus/WotsPlus.cs2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/src/pqc/crypto/sphincsplus/WotsPlus.cs b/crypto/src/pqc/crypto/sphincsplus/WotsPlus.cs
index 508accc06..c87cb67f4 100644
--- a/crypto/src/pqc/crypto/sphincsplus/WotsPlus.cs
+++ b/crypto/src/pqc/crypto/sphincsplus/WotsPlus.cs
@@ -91,7 +91,7 @@ namespace Org.BouncyCastle.Pqc.Crypto.SphincsPlus
             int len_2_bytes = (engine.WOTS_LEN2 * engine.WOTS_LOGW + 7) / 8;
             byte[] bytes = Pack.UInt32_To_BE(csum);
             msg = Arrays.Concatenate(msg,
-                BaseW(Arrays.CopyOfRange(bytes, len_2_bytes, bytes.Length), w, engine.WOTS_LEN2));
+                BaseW(Arrays.CopyOfRange(bytes, 4 -len_2_bytes, bytes.Length), w, engine.WOTS_LEN2));
             byte[][] sig = new byte[engine.WOTS_LEN][];
             for (uint i = 0; i < engine.WOTS_LEN; i++)
             {