diff options
Diffstat (limited to 'src/lib/pubkey/xmss/xmss_tools.cpp')
-rw-r--r-- | src/lib/pubkey/xmss/xmss_tools.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/lib/pubkey/xmss/xmss_tools.cpp b/src/lib/pubkey/xmss/xmss_tools.cpp new file mode 100644 index 000000000..13e66759c --- /dev/null +++ b/src/lib/pubkey/xmss/xmss_tools.cpp @@ -0,0 +1,32 @@ +/** + * XMSS Tools + * Contains some helper functions. + * (C) 2016 Matthias Gierlings + * + * Botan is released under the Simplified BSD License (see license.txt) + **/ +#include <botan/xmss_tools.h> + +namespace Botan { + +XMSS_Tools::XMSS_Tools() + { +#if defined(BOTAN_TARGET_CPU_HAS_KNOWN_ENDIANESS) +#if defined(BOTAN_TARGET_CPU_IS_LITTLE_ENDIAN) + m_is_little_endian = true; +#else + m_is_little_endian = false; +#endif +#else + uint16_t data = 0x01; + m_is_little_endian = reinterpret_cast<const byte*>(&data)[0] == 0x01; +#endif + } + +const XMSS_Tools& XMSS_Tools::get() + { + static const XMSS_Tools self; + return self; + } + +} |