Skip to content

Commit 7f36a3b

Browse files
committed
feat(crypto): add Falcon-512 post-quantum signature support
1 parent 0a8289c commit 7f36a3b

48 files changed

Lines changed: 5264 additions & 29 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

actuator/src/main/java/org/tron/core/actuator/AccountPermissionUpdateActuator.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,14 @@ private boolean checkPermission(Permission permission) throws ContractValidateEx
9595
long weightSum = 0;
9696
List<ByteString> addressList = permission.getKeysList()
9797
.stream()
98-
.map(x -> x.getAddress())
98+
.map(Key::getAddress)
9999
.distinct()
100100
.collect(toList());
101101
if (addressList.size() != permission.getKeysList().size()) {
102102
throw new ContractValidateException(
103103
"address should be distinct in permission " + permission.getType());
104104
}
105+
105106
for (Key key : permission.getKeysList()) {
106107
if (!DecodeUtil.addressValid(key.getAddress().toByteArray())) {
107108
throw new ContractValidateException("key is not a validate address");
@@ -237,4 +238,5 @@ public ByteString getOwnerAddress() throws InvalidProtocolBufferException {
237238
public long calcFee() {
238239
return chainBaseManager.getDynamicPropertiesStore().getUpdateAccountPermissionFee();
239240
}
241+
240242
}

actuator/src/main/java/org/tron/core/utils/ProposalUtil.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -941,6 +941,17 @@ public static void validator(DynamicPropertiesStore dynamicPropertiesStore,
941941
}
942942
break;
943943
}
944+
case ALLOW_FN_DSA_512: {
945+
if (dynamicPropertiesStore.getAllowFnDsa512() == 1) {
946+
throw new ContractValidateException(
947+
"[ALLOW_FN_DSA_512] has been valid, no need to propose again");
948+
}
949+
if (value != 1) {
950+
throw new ContractValidateException(
951+
"This value[ALLOW_FN_DSA_512] is only allowed to be 1");
952+
}
953+
break;
954+
}
944955
default:
945956
break;
946957
}
@@ -1029,7 +1040,9 @@ public enum ProposalType { // current value, value range
10291040
ALLOW_TVM_PRAGUE(95), // 0, 1
10301041
ALLOW_TVM_OSAKA(96), // 0, 1
10311042
ALLOW_HARDEN_RESOURCE_CALCULATION(97), // 0, 1
1032-
ALLOW_HARDEN_EXCHANGE_CALCULATION(98); // 0, 1
1043+
ALLOW_HARDEN_EXCHANGE_CALCULATION(98), // 0, 1
1044+
ALLOW_FN_DSA_512(100); // 0, 1
1045+
10331046
private long code;
10341047

10351048
ProposalType(long code) {

0 commit comments

Comments
 (0)