Skip to content

Commit

Permalink
Add PQC-lite mode using falcon
Browse files Browse the repository at this point in the history
  • Loading branch information
fireduck64 committed Dec 29, 2023
1 parent 37dd6dc commit b0e6fe7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
11 changes: 11 additions & 0 deletions client/src/WalletUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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);
Expand Down
9 changes: 9 additions & 0 deletions iceleaf-ui/src/MakeWalletPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -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)");

Expand Down Expand Up @@ -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);

Expand All @@ -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);
Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit b0e6fe7

Please sign in to comment.