aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/pubkey
diff options
context:
space:
mode:
authorMatthias Gierlings <[email protected]>2019-03-03 22:04:23 +0100
committerMatthias Gierlings <[email protected]>2019-05-06 10:00:20 +0200
commit5993c9e447a826582feea1cef75adec619bbd2f0 (patch)
tree687d359343b97d2520b7cea9990822bb72ab18f6 /src/lib/pubkey
parent2c9caac4a0efaa4684374c9bc383e87e82309dcc (diff)
Updates XMSS parameters corresponding to RFC 8391
Changes XMSS and XMSS WOTS algorithm names and OIDs to correspond to RFC 8391.
Diffstat (limited to 'src/lib/pubkey')
-rw-r--r--src/lib/pubkey/xmss/xmss_parameters.cpp120
-rw-r--r--src/lib/pubkey/xmss/xmss_parameters.h24
-rw-r--r--src/lib/pubkey/xmss/xmss_wots_parameters.cpp32
-rw-r--r--src/lib/pubkey/xmss/xmss_wots_parameters.h8
4 files changed, 92 insertions, 92 deletions
diff --git a/src/lib/pubkey/xmss/xmss_parameters.cpp b/src/lib/pubkey/xmss/xmss_parameters.cpp
index b67e5694e..b73e5792c 100644
--- a/src/lib/pubkey/xmss/xmss_parameters.cpp
+++ b/src/lib/pubkey/xmss/xmss_parameters.cpp
@@ -19,30 +19,30 @@ namespace Botan {
XMSS_Parameters::xmss_algorithm_t XMSS_Parameters::xmss_id_from_string(const std::string& param_set)
{
- if(param_set == "XMSS_SHA2-256_W16_H10")
- { return XMSS_SHA2_256_W16_H10; }
- if(param_set == "XMSS_SHA2-256_W16_H16")
- { return XMSS_SHA2_256_W16_H16; }
- if(param_set == "XMSS_SHA2-256_W16_H20")
- { return XMSS_SHA2_256_W16_H20; }
- if(param_set == "XMSS_SHA2-512_W16_H10")
- { return XMSS_SHA2_512_W16_H10; }
- if(param_set == "XMSS_SHA2-512_W16_H16")
- { return XMSS_SHA2_512_W16_H16; }
- if(param_set == "XMSS_SHA2-512_W16_H20")
- { return XMSS_SHA2_512_W16_H20; }
- if(param_set == "XMSS_SHAKE128_W16_H10")
- { return XMSS_SHAKE128_W16_H10; }
- if(param_set == "XMSS_SHAKE128_W16_H16")
- { return XMSS_SHAKE128_W16_H16; }
- if(param_set == "XMSS_SHAKE128_W16_H20")
- { return XMSS_SHAKE128_W16_H20; }
- if(param_set == "XMSS_SHAKE256_W16_H10")
- { return XMSS_SHAKE256_W16_H10; }
- if(param_set == "XMSS_SHAKE256_W16_H16")
- { return XMSS_SHAKE256_W16_H16; }
- if(param_set == "XMSS_SHAKE256_W16_H20")
- { return XMSS_SHAKE256_W16_H20; }
+ if(param_set == "XMSS-SHA2_10_256")
+ { return XMSS_SHA2_10_256; }
+ if(param_set == "XMSS-SHA2_16_256")
+ { return XMSS_SHA2_16_256; }
+ if(param_set == "XMSS-SHA2_20_256")
+ { return XMSS_SHA2_20_256; }
+ if(param_set == "XMSS-SHA2_10_512")
+ { return XMSS_SHA2_10_512; }
+ if(param_set == "XMSS-SHA2_16_512")
+ { return XMSS_SHA2_16_512; }
+ if(param_set == "XMSS-SHA2_20_512")
+ { return XMSS_SHA2_20_512; }
+ if(param_set == "XMSS-SHAKE_10_256")
+ { return XMSS_SHAKE_10_256; }
+ if(param_set == "XMSS-SHAKE_10_256")
+ { return XMSS_SHAKE_16_256; }
+ if(param_set == "XMSS-SHAKE_20_256")
+ { return XMSS_SHAKE_20_256; }
+ if(param_set == "XMSS-SHAKE_10_512")
+ { return XMSS_SHAKE_10_512; }
+ if(param_set == "XMSS-SHAKE_16_512")
+ { return XMSS_SHAKE_16_512; }
+ if(param_set == "XMSS-SHAKE_20_512")
+ { return XMSS_SHAKE_20_512; }
throw Lookup_Error("Unknown XMSS algorithm param '" + param_set + "'");
}
@@ -56,125 +56,125 @@ XMSS_Parameters::XMSS_Parameters(xmss_algorithm_t oid)
{
switch(oid)
{
- case XMSS_SHA2_256_W16_H10:
+ case XMSS_SHA2_10_256:
m_element_size = 32;
m_w = 16;
m_len = 67;
m_tree_height = 10;
- m_name = "XMSS_SHA2-256_W16_H10";
+ m_name = "XMSS-SHA2_10_256";
m_hash_name = "SHA-256";
m_strength = 256;
- m_wots_oid = XMSS_WOTS_Parameters::ots_algorithm_t::WOTSP_SHA2_256_W16;
+ m_wots_oid = XMSS_WOTS_Parameters::ots_algorithm_t::WOTSP_SHA2_256;
break;
- case XMSS_SHA2_256_W16_H16:
+ case XMSS_SHA2_16_256:
m_element_size = 32;
m_w = 16;
m_len = 67;
m_tree_height = 16;
- m_name = "XMSS_SHA2-256_W16_H16";
+ m_name = "XMSS-SHA2_16_256";
m_hash_name = "SHA-256";
m_strength = 256;
- m_wots_oid = XMSS_WOTS_Parameters::ots_algorithm_t::WOTSP_SHA2_256_W16;
+ m_wots_oid = XMSS_WOTS_Parameters::ots_algorithm_t::WOTSP_SHA2_256;
break;
- case XMSS_SHA2_256_W16_H20:
+ case XMSS_SHA2_20_256:
m_element_size = 32;
m_w = 16;
m_len = 67;
m_tree_height = 20;
- m_name = "XMSS_SHA2-256_W16_H20";
+ m_name = "XMSS-SHA2_20_256";
m_hash_name = "SHA-256";
m_strength = 256;
- m_wots_oid = XMSS_WOTS_Parameters::ots_algorithm_t::WOTSP_SHA2_256_W16;
+ m_wots_oid = XMSS_WOTS_Parameters::ots_algorithm_t::WOTSP_SHA2_256;
break;
- case XMSS_SHA2_512_W16_H10:
+ case XMSS_SHA2_10_512:
m_element_size = 64;
m_w = 16;
m_len = 131;
m_tree_height = 10;
- m_name = "XMSS_SHA2-512_W16_H10";
+ m_name = "XMSS-SHA2_10_512";
m_hash_name = "SHA-512";
m_strength = 512;
- m_wots_oid = XMSS_WOTS_Parameters::ots_algorithm_t::WOTSP_SHA2_512_W16;
+ m_wots_oid = XMSS_WOTS_Parameters::ots_algorithm_t::WOTSP_SHA2_512;
break;
- case XMSS_SHA2_512_W16_H16:
+ case XMSS_SHA2_16_512:
m_element_size = 64;
m_w = 16;
m_len = 131;
m_tree_height = 16;
- m_name = "XMSS_SHA2-512_W16_H16";
+ m_name = "XMSS-SHA2_16_512";
m_hash_name = "SHA-512";
m_strength = 512;
- m_wots_oid = XMSS_WOTS_Parameters::ots_algorithm_t::WOTSP_SHA2_512_W16;
+ m_wots_oid = XMSS_WOTS_Parameters::ots_algorithm_t::WOTSP_SHA2_512;
break;
- case XMSS_SHA2_512_W16_H20:
+ case XMSS_SHA2_20_512:
m_element_size = 64;
m_w = 16;
m_len = 131;
m_tree_height = 20;
- m_name = "XMSS_SHA2-512_W16_H20";
+ m_name = "XMSS-SHA2_20_512";
m_hash_name = "SHA-512";
m_strength = 512;
- m_wots_oid = XMSS_WOTS_Parameters::ots_algorithm_t::WOTSP_SHA2_512_W16;
+ m_wots_oid = XMSS_WOTS_Parameters::ots_algorithm_t::WOTSP_SHA2_512;
break;
- case XMSS_SHAKE128_W16_H10:
+ case XMSS_SHAKE_10_256:
m_element_size = 32;
m_w = 16;
m_len = 67;
m_tree_height = 10;
- m_name = "XMSS_SHAKE128_W16_H10";
+ m_name = "XMSS-SHAKE_10_256";
m_hash_name = "SHAKE-128(256)";
m_strength = 256;
- m_wots_oid = XMSS_WOTS_Parameters::ots_algorithm_t::WOTSP_SHAKE128_W16;
+ m_wots_oid = XMSS_WOTS_Parameters::ots_algorithm_t::WOTSP_SHAKE_256;
break;
- case XMSS_SHAKE128_W16_H16:
+ case XMSS_SHAKE_16_256:
m_element_size = 32;
m_w = 16;
m_len = 67;
m_tree_height = 16;
- m_name = "XMSS_SHAKE128_W16_H16";
+ m_name = "XMSS-SHAKE_16_256";
m_hash_name = "SHAKE-128(256)";
m_strength = 256;
- m_wots_oid = XMSS_WOTS_Parameters::ots_algorithm_t::WOTSP_SHAKE128_W16;
+ m_wots_oid = XMSS_WOTS_Parameters::ots_algorithm_t::WOTSP_SHAKE_256;
break;
- case XMSS_SHAKE128_W16_H20:
+ case XMSS_SHAKE_20_256:
m_element_size = 32;
m_w = 16;
m_len = 67;
m_tree_height = 20;
- m_name = "XMSS_SHAKE128_W16_H20";
+ m_name = "XMSS-SHAKE_20_256";
m_hash_name = "SHAKE-128(256)";
m_strength = 256;
- m_wots_oid = XMSS_WOTS_Parameters::ots_algorithm_t::WOTSP_SHAKE128_W16;
+ m_wots_oid = XMSS_WOTS_Parameters::ots_algorithm_t::WOTSP_SHAKE_256;
break;
- case XMSS_SHAKE256_W16_H10:
+ case XMSS_SHAKE_10_512:
m_element_size = 64;
m_w = 16;
m_len = 131;
m_tree_height = 10;
- m_name = "XMSS_SHAKE256_W16_H10";
+ m_name = "XMSS-SHAKE_10_512";
m_hash_name = "SHAKE-256(512)";
m_strength = 512;
- m_wots_oid = XMSS_WOTS_Parameters::ots_algorithm_t::WOTSP_SHAKE256_W16;
+ m_wots_oid = XMSS_WOTS_Parameters::ots_algorithm_t::WOTSP_SHAKE_512;
break;
- case XMSS_SHAKE256_W16_H16:
+ case XMSS_SHAKE_16_512:
m_element_size = 64;
m_w = 16;
m_len = 131;
m_tree_height = 16;
- m_name = "XMSS_SHAKE256_W16_H16";
+ m_name = "XMSS-SHAKE_16_512";
m_hash_name = "SHAKE-256(512)";
m_strength = 512;
- m_wots_oid = XMSS_WOTS_Parameters::ots_algorithm_t::WOTSP_SHAKE256_W16;
+ m_wots_oid = XMSS_WOTS_Parameters::ots_algorithm_t::WOTSP_SHAKE_512;
break;
- case XMSS_SHAKE256_W16_H20:
+ case XMSS_SHAKE_20_512:
m_element_size = 64;
m_w = 16;
m_len = 131;
m_tree_height = 20;
- m_name = "XMSS_SHAKE256_W16_H20";
+ m_name = "XMSS_SHAKE_20_512";
m_hash_name = "SHAKE-256(512)";
m_strength = 512;
- m_wots_oid = XMSS_WOTS_Parameters::ots_algorithm_t::WOTSP_SHAKE256_W16;
+ m_wots_oid = XMSS_WOTS_Parameters::ots_algorithm_t::WOTSP_SHAKE_512;
break;
default:
throw Not_Implemented("Algorithm id does not match any known XMSS algorithm id.");
diff --git a/src/lib/pubkey/xmss/xmss_parameters.h b/src/lib/pubkey/xmss/xmss_parameters.h
index 3e59634f4..06c3c2490 100644
--- a/src/lib/pubkey/xmss/xmss_parameters.h
+++ b/src/lib/pubkey/xmss/xmss_parameters.h
@@ -26,18 +26,18 @@ class BOTAN_PUBLIC_API(2,0) XMSS_Parameters
public:
enum xmss_algorithm_t
{
- XMSS_SHA2_256_W16_H10 = 0x01000001,
- XMSS_SHA2_256_W16_H16 = 0x02000002,
- XMSS_SHA2_256_W16_H20 = 0x03000003,
- XMSS_SHA2_512_W16_H10 = 0x04000004,
- XMSS_SHA2_512_W16_H16 = 0x05000005,
- XMSS_SHA2_512_W16_H20 = 0x06000006,
- XMSS_SHAKE128_W16_H10 = 0x07000007,
- XMSS_SHAKE128_W16_H16 = 0x08000008,
- XMSS_SHAKE128_W16_H20 = 0x09000009,
- XMSS_SHAKE256_W16_H10 = 0x0a00000a,
- XMSS_SHAKE256_W16_H16 = 0x0b00000b,
- XMSS_SHAKE256_W16_H20 = 0x0c00000c
+ XMSS_SHA2_10_256 = 0x00000001,
+ XMSS_SHA2_16_256 = 0x00000002,
+ XMSS_SHA2_20_256 = 0x00000003,
+ XMSS_SHA2_10_512 = 0x00000004,
+ XMSS_SHA2_16_512 = 0x00000005,
+ XMSS_SHA2_20_512 = 0x00000006,
+ XMSS_SHAKE_10_256 = 0x00000007,
+ XMSS_SHAKE_16_256 = 0x00000008,
+ XMSS_SHAKE_20_256 = 0x00000009,
+ XMSS_SHAKE_10_512 = 0x0000000a,
+ XMSS_SHAKE_16_512 = 0x0000000b,
+ XMSS_SHAKE_20_512 = 0x0000000c
};
static xmss_algorithm_t xmss_id_from_string(const std::string& algo_name);
diff --git a/src/lib/pubkey/xmss/xmss_wots_parameters.cpp b/src/lib/pubkey/xmss/xmss_wots_parameters.cpp
index e5e334bf9..6aff1c8dd 100644
--- a/src/lib/pubkey/xmss/xmss_wots_parameters.cpp
+++ b/src/lib/pubkey/xmss/xmss_wots_parameters.cpp
@@ -22,14 +22,14 @@ namespace Botan {
XMSS_WOTS_Parameters::ots_algorithm_t
XMSS_WOTS_Parameters::xmss_wots_id_from_string(const std::string& param_set)
{
- if(param_set == "WOTSP_SHA2-256_W16")
- { return WOTSP_SHA2_256_W16; }
- if(param_set == "WOTSP_SHA2-512_W16")
- { return WOTSP_SHA2_512_W16; }
- if(param_set == "WOTSP_SHAKE128_W16")
- { return WOTSP_SHAKE128_W16; }
- if(param_set == "WOTSP_SHAKE256_W16")
- { return WOTSP_SHAKE256_W16; }
+ if(param_set == "WOTSP-SHA2_256")
+ { return WOTSP_SHA2_256; }
+ if(param_set == "WOTSP-SHA2_512")
+ { return WOTSP_SHA2_512; }
+ if(param_set == "WOTSP-SHAKE_256")
+ { return WOTSP_SHAKE_256; }
+ if(param_set == "WOTSP-SHAKE_512")
+ { return WOTSP_SHAKE_512; }
throw Invalid_Argument("Unknown XMSS-WOTS algorithm param '" + param_set + "'");
}
@@ -42,35 +42,35 @@ XMSS_WOTS_Parameters::XMSS_WOTS_Parameters(ots_algorithm_t oid)
{
switch(oid)
{
- case WOTSP_SHA2_256_W16:
+ case WOTSP_SHA2_256:
m_element_size = 32;
m_w = 16;
m_len = 67;
- m_name = "WOTSP_SHA2-256_W16";
+ m_name = "WOTSP-SHA2_256";
m_hash_name = "SHA-256";
m_strength = 256;
break;
- case WOTSP_SHA2_512_W16:
+ case WOTSP_SHA2_512:
m_element_size = 64;
m_w = 16;
m_len = 131;
- m_name = "WOTSP_SHA2-512_W16";
+ m_name = "WOTSP-SHA2_512";
m_hash_name = "SHA-512";
m_strength = 512;
break;
- case WOTSP_SHAKE128_W16:
+ case WOTSP_SHAKE_256:
m_element_size = 32;
m_w = 16;
m_len = 67;
- m_name = "WOTSP_SHAKE128_W16";
+ m_name = "WOTSP-SHAKE_256";
m_hash_name = "SHAKE-128(256)";
m_strength = 256;
break;
- case WOTSP_SHAKE256_W16:
+ case WOTSP_SHAKE_512:
m_element_size = 64;
m_w = 16;
m_len = 131;
- m_name = "WOTSP_SHAKE256_W16";
+ m_name = "WOTSP-SHAKE_512";
m_hash_name = "SHAKE-256(512)";
m_strength = 512;
break;
diff --git a/src/lib/pubkey/xmss/xmss_wots_parameters.h b/src/lib/pubkey/xmss/xmss_wots_parameters.h
index 0c2825017..34927abfb 100644
--- a/src/lib/pubkey/xmss/xmss_wots_parameters.h
+++ b/src/lib/pubkey/xmss/xmss_wots_parameters.h
@@ -29,10 +29,10 @@ class XMSS_WOTS_Parameters final
public:
enum ots_algorithm_t
{
- WOTSP_SHA2_256_W16 = 0x01000001,
- WOTSP_SHA2_512_W16 = 0x02000002,
- WOTSP_SHAKE128_W16 = 0x03000003,
- WOTSP_SHAKE256_W16 = 0x04000004
+ WOTSP_SHA2_256 = 0x00000001,
+ WOTSP_SHA2_512 = 0x00000002,
+ WOTSP_SHAKE_256 = 0x00000003,
+ WOTSP_SHAKE_512 = 0x00000004
};
XMSS_WOTS_Parameters(const std::string& algo_name);