aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias Gierlings <[email protected]>2018-08-24 16:26:10 +0200
committerMatthias Gierlings <[email protected]>2018-08-24 16:26:10 +0200
commit88213d27a3601639d75cd977c0642f7ac19bd7cf (patch)
tree8e835a6eb7acceb097367ecbb80317a75fa942f3 /src
parent2de92b238374fd37ba5001aaabac68782bae77b1 (diff)
Implements correct XMSS signature size calculation
Implements the correct signature size calculation for XMSS, required by #1641.
Diffstat (limited to 'src')
-rw-r--r--src/lib/pubkey/xmss/xmss_signature_operation.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/pubkey/xmss/xmss_signature_operation.cpp b/src/lib/pubkey/xmss/xmss_signature_operation.cpp
index d6a57bb08..8c53cd924 100644
--- a/src/lib/pubkey/xmss/xmss_signature_operation.cpp
+++ b/src/lib/pubkey/xmss/xmss_signature_operation.cpp
@@ -54,8 +54,10 @@ XMSS_Signature_Operation::sign(const secure_vector<uint8_t>& msg_hash,
size_t XMSS_Signature_Operation::signature_length() const
{
- // TODO bound this by the params
- return 128*1024;
+ return sizeof(uint64_t) + // size of leaf index
+ m_xmss_params.element_size() +
+ m_xmss_params.len() * m_xmss_params.element_size() +
+ m_xmss_params.tree_height() * m_xmss_params.element_size();
}
wots_keysig_t