diff options
author | Jack Lloyd <[email protected]> | 2016-12-11 15:28:38 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2016-12-18 16:48:24 -0500 |
commit | f3cb3edb512bdcab498d825886c3366c341b3f78 (patch) | |
tree | 645c73ec295a5a34f25d99903b6d9fa9751e86d3 /src/lib/pubkey/xmss/xmss_wots_publickey.h | |
parent | c1dd21253c1f3188ff45d3ad47698efd08235ae8 (diff) |
Convert to using standard uintN_t integer types
Renames a couple of functions for somewhat better name consistency,
eg make_u32bit becomes make_uint32. The old typedefs remain for now
since probably lots of application code uses them.
Diffstat (limited to 'src/lib/pubkey/xmss/xmss_wots_publickey.h')
-rw-r--r-- | src/lib/pubkey/xmss/xmss_wots_publickey.h | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/lib/pubkey/xmss/xmss_wots_publickey.h b/src/lib/pubkey/xmss/xmss_wots_publickey.h index 4f414de27..5d973fd6a 100644 --- a/src/lib/pubkey/xmss/xmss_wots_publickey.h +++ b/src/lib/pubkey/xmss/xmss_wots_publickey.h @@ -23,7 +23,7 @@ namespace Botan { -typedef std::vector<secure_vector<byte>> wots_keysig_t; +typedef std::vector<secure_vector<uint8_t>> wots_keysig_t; /** * A Winternitz One Time Signature public key for use with Extended Hash-Based @@ -109,7 +109,7 @@ class BOTAN_DLL XMSS_WOTS_PublicKey : virtual public Public_Key * @param public_seed A precomputed public seed of n-bytes length. **/ XMSS_WOTS_PublicKey(XMSS_WOTS_Parameters::ots_algorithm_t oid, - secure_vector<byte> public_seed) + secure_vector<uint8_t> public_seed) : m_wots_params(oid), m_hash(m_wots_params.hash_function_name()), m_public_seed(public_seed) {} @@ -125,7 +125,7 @@ class BOTAN_DLL XMSS_WOTS_PublicKey : virtual public Public_Key * @param key Precomputed raw key data of the XMSS_WOTS_PublicKey. **/ XMSS_WOTS_PublicKey(XMSS_WOTS_Parameters::ots_algorithm_t oid, - secure_vector<byte>&& public_seed, + secure_vector<uint8_t>&& public_seed, wots_keysig_t&& key) : m_wots_params(oid), m_hash(m_wots_params.hash_function_name()), @@ -144,7 +144,7 @@ class BOTAN_DLL XMSS_WOTS_PublicKey : virtual public Public_Key * @param key Precomputed raw key data of the XMSS_WOTS_PublicKey. **/ XMSS_WOTS_PublicKey(XMSS_WOTS_Parameters::ots_algorithm_t oid, - const secure_vector<byte>& public_seed, + const secure_vector<uint8_t>& public_seed, const wots_keysig_t& key) : m_wots_params(oid), m_hash(m_wots_params.hash_function_name()), @@ -164,10 +164,10 @@ class BOTAN_DLL XMSS_WOTS_PublicKey : virtual public Public_Key * @param public_seed The public public_seed. **/ XMSS_WOTS_PublicKey(XMSS_WOTS_Parameters::ots_algorithm_t oid, - const secure_vector<byte>& msg, + const secure_vector<uint8_t>& msg, const wots_keysig_t& sig, XMSS_Address& adrs, - const secure_vector<byte>& public_seed) + const secure_vector<uint8_t>& public_seed) : m_wots_params(oid), m_hash(m_wots_params.hash_function_name()), m_key(pub_key_from_signature(msg, @@ -184,8 +184,8 @@ class BOTAN_DLL XMSS_WOTS_PublicKey : virtual public Public_Key * @param i index of the element. * @returns n-byte element addressed by i. **/ - const secure_vector<byte>& operator[](size_t i) const { return m_key[i]; } - secure_vector<byte>& operator[](size_t i) { return m_key[i]; } + const secure_vector<uint8_t>& operator[](size_t i) const { return m_key[i]; } + secure_vector<uint8_t>& operator[](size_t i) { return m_key[i]; } /** * Convert the key into the raw key data. The key becomes a length @@ -199,16 +199,16 @@ class BOTAN_DLL XMSS_WOTS_PublicKey : virtual public Public_Key **/ operator wots_keysig_t& () { return m_key; } - const secure_vector<byte>& public_seed() const { return m_public_seed; } + const secure_vector<uint8_t>& public_seed() const { return m_public_seed; } - secure_vector<byte>& public_seed() { return m_public_seed; } + secure_vector<uint8_t>& public_seed() { return m_public_seed; } - void set_public_seed(const secure_vector<byte>& public_seed) + void set_public_seed(const secure_vector<uint8_t>& public_seed) { m_public_seed = public_seed; } - void set_public_seed(secure_vector<byte>&& public_seed) + void set_public_seed(secure_vector<uint8_t>&& public_seed) { m_public_seed = std::move(public_seed); } @@ -261,7 +261,7 @@ class BOTAN_DLL XMSS_WOTS_PublicKey : virtual public Public_Key return m_wots_params.estimated_strength(); } - virtual std::vector<byte> public_key_bits() const override + virtual std::vector<uint8_t> public_key_bits() const override { throw Not_Implemented("No key format defined for XMSS-WOTS"); } @@ -293,17 +293,17 @@ class BOTAN_DLL XMSS_WOTS_PublicKey : virtual public Public_Key * @param public_seed A public seed. * **/ - void chain(secure_vector<byte>& x, + void chain(secure_vector<uint8_t>& x, size_t start_idx, size_t steps, XMSS_Address& adrs, - const secure_vector<byte>& public_seed); + const secure_vector<uint8_t>& public_seed); XMSS_WOTS_Parameters m_wots_params; XMSS_Hash m_hash; wots_keysig_t m_key; - secure_vector<byte> m_public_seed; + secure_vector<uint8_t> m_public_seed; private: /** @@ -319,10 +319,10 @@ class BOTAN_DLL XMSS_WOTS_PublicKey : virtual public Public_Key * @return Temporary WOTS+ public key. **/ wots_keysig_t pub_key_from_signature( - const secure_vector<byte>& msg, + const secure_vector<uint8_t>& msg, const wots_keysig_t& sig, XMSS_Address& adrs, - const secure_vector<byte>& public_seed); + const secure_vector<uint8_t>& public_seed); }; } |