From b0e6fe7b45fba8722a658efff96a9e5a46f6859c Mon Sep 17 00:00:00 2001 From: fireduck64 Date: Fri, 29 Dec 2023 09:53:05 -0800 Subject: [PATCH] Add PQC-lite mode using falcon --- client/src/WalletUtil.java | 11 +++++++++++ iceleaf-ui/src/MakeWalletPanel.java | 9 +++++++++ 2 files changed, 20 insertions(+) diff --git a/client/src/WalletUtil.java b/client/src/WalletUtil.java index 760bd1e..4582285 100644 --- a/client/src/WalletUtil.java +++ b/client/src/WalletUtil.java @@ -37,6 +37,7 @@ public class WalletUtil public static final String MODE_STANDARD = "standard"; public static final String MODE_QHARD = "qhard"; public static final String MODE_PQC1 = "pqc1"; + public static final String MODE_PQC_LITE = "pqc_lite"; public static final String MODE_SEED = "seed"; private static final Logger logger = Logger.getLogger("snowblossom.client"); @@ -219,7 +220,17 @@ else if (key_mode.equals(MODE_PQC1)) wallet_builder.addAddresses(claim); } + else if (key_mode.equals(MODE_PQC_LITE)) + { + logger.info("Creating PQC_LITE key set. This takes a while."); + WalletKeyPair k_falcon = KeyUtil.generateWalletFalconKey(); + + wallet_builder.addKeys(k_falcon); + claim = AddressUtil.getMultiSig(1, ImmutableList.of(k_falcon)); + wallet_builder.addAddresses(claim); + + } else { throw new RuntimeException("Unknown key_mode: " + key_mode); diff --git a/iceleaf-ui/src/MakeWalletPanel.java b/iceleaf-ui/src/MakeWalletPanel.java index 8edc1c5..3cf2ff5 100644 --- a/iceleaf-ui/src/MakeWalletPanel.java +++ b/iceleaf-ui/src/MakeWalletPanel.java @@ -29,6 +29,7 @@ public class MakeWalletPanel extends BasePanel protected JRadioButton old_std_button = new JRadioButton("Old Standard - secp256k1"); protected JRadioButton qhard_button = new JRadioButton("QHard - secp256k1 + rsa8192 + dstu4145"); protected JRadioButton pqc1_button = new JRadioButton("PQC1 - secp256k1 + dstu4145 + sphincsplus + dilithium"); + protected JRadioButton pqc_lite_button = new JRadioButton("PQC Lite - falcon"); protected JRadioButton import_seed_button = new JRadioButton("Import seed"); protected JRadioButton import_xpub_button = new JRadioButton("Import xpub (watch only)"); @@ -69,6 +70,7 @@ public void setupPanel() main_radio_bg.add(old_std_button); main_radio_bg.add(qhard_button); main_radio_bg.add(pqc1_button); + main_radio_bg.add(pqc_lite_button); main_radio_bg.add(import_seed_button); main_radio_bg.add(import_xpub_button); @@ -78,6 +80,7 @@ public void setupPanel() panel.add(old_std_button, c); panel.add(qhard_button, c); panel.add(pqc1_button, c); + panel.add(pqc_lite_button, c); c.gridwidth=1; panel.add(import_seed_button, c); @@ -164,6 +167,12 @@ else if (pqc1_button.isSelected()) config_map.put("key_mode", "pqc1"); config_map.put("key_count", "1"); } + else if (pqc_lite_button.isSelected()) + { + config_out.println("key_mode=pqc_lite"); + config_map.put("key_mode", "pqc_lite"); + config_map.put("key_count", "1"); + } else if (import_seed_button.isSelected()) { config_out.println("key_mode=seed");