REDUCED_SIGNATURE_LENGTH lowered from 8 to 4

This still gives more than enough uniqueness to prevent mempow nonces from being pre-calculated. Could potentially go even lower still?
This commit is contained in:
CalDescent 2022-04-05 09:03:14 +01:00
parent abc9cb3958
commit 012cde705a
2 changed files with 4 additions and 2 deletions

View File

@ -28,6 +28,8 @@ import java.util.*;
import java.util.concurrent.TimeoutException;
import java.util.stream.Collectors;
import static org.qortal.transform.Transformer.REDUCED_SIGNATURE_LENGTH;
public class OnlineAccountsManager extends Thread {
private class OurOnlineAccountsThread extends Thread {
@ -415,7 +417,7 @@ public class OnlineAccountsManager extends Thread {
LOGGER.info("Unable to compute online accounts without having a recent block");
return false;
}
byte[] reducedRecentBlockSignature = Arrays.copyOfRange(recentBlockData.getSignature(), 0, 8);
byte[] reducedRecentBlockSignature = Arrays.copyOfRange(recentBlockData.getSignature(), 0, REDUCED_SIGNATURE_LENGTH);
byte[] mempowBytes;
try {

View File

@ -18,7 +18,7 @@ public abstract class Transformer {
public static final int SIGNATURE_LENGTH = 64;
public static final int TIMESTAMP_LENGTH = LONG_LENGTH;
public static final int REDUCED_SIGNATURE_LENGTH = 8;
public static final int REDUCED_SIGNATURE_LENGTH = 4;
public static final int MD5_LENGTH = 16;
public static final int SHA256_LENGTH = 32;