Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,21 @@ else if (N <= 256)
throw new IllegalArgumentException("cannot precompute SPX_WOTS_LEN2 for n outside {2, .., 256}");
}
}
else if (w == 4)
{
WOTS_LOGW = 2;
WOTS_LEN1 = (8 * N / WOTS_LOGW);
WOTS_LEN2 = (int)(Math.log(WOTS_LEN1 * (w - 1)) / Math.log(w)) + 1;
}
else if (w == 8)
{
WOTS_LOGW = 3;
WOTS_LEN1 = (8 * N / WOTS_LOGW);
WOTS_LEN2 = (int)(Math.log(WOTS_LEN1 * (w - 1)) / Math.log(w)) + 1;
}
else
{
throw new IllegalArgumentException("wots_w assumed 16 or 256");
throw new IllegalArgumentException("wots_w assumed 4, 8, 16 or 256");
}
this.WOTS_W = w;
this.WOTS_LEN = WOTS_LEN1 + WOTS_LEN2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,29 @@ interface SLHDSAEngineProvider
public static final SLHDSAParameters shake_256s = new SLHDSAParameters(
"shake-256s", new Shake256EngineProvider(32, 16, 8, 14, 22, 64), TYPE_PURE);

// SHA2-128-24
public static final SLHDSAParameters sha2_128_24 = new SLHDSAParameters(
"sha2-128-24", new Sha2EngineProvider(16, 4, 1, 24, 6, 22), TYPE_PURE);

// SHAKE-128-24
public static final SLHDSAParameters shake_128_24 = new SLHDSAParameters(
"shake-128-24", new Shake256EngineProvider(16, 4, 1, 24, 6, 22), TYPE_PURE);

// SHA2-192-24
public static final SLHDSAParameters sha2_192_24 = new SLHDSAParameters(
"sha2-192-24", new Sha2EngineProvider(24, 8, 1, 25, 9, 21), TYPE_PURE);

// SHAKE-192-24
public static final SLHDSAParameters shake_192_24 = new SLHDSAParameters(
"shake-192-24", new Shake256EngineProvider(24, 8, 1, 25, 9, 21), TYPE_PURE);

// SHA2-256-24
public static final SLHDSAParameters sha2_256_24 = new SLHDSAParameters(
"sha2-256-24", new Sha2EngineProvider(32, 4, 1, 25, 12, 21), TYPE_PURE);

// SHAKE-256-24
public static final SLHDSAParameters shake_256_24 = new SLHDSAParameters(
"shake-256-24", new Shake256EngineProvider(32, 4, 1, 25, 12, 21), TYPE_PURE);

// "Pre-hash" SLH-DSA Parameters
// SHA-2
Expand Down