Botan  2.1.0
Crypto and TLS for C++11
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Botan::XMSS_WOTS_Common_Ops Class Reference

#include <xmss_wots_common_ops.h>

Inheritance diagram for Botan::XMSS_WOTS_Common_Ops:
Botan::XMSS_WOTS_Signature_Operation Botan::XMSS_WOTS_Verification_Operation

Public Member Functions

 XMSS_WOTS_Common_Ops (XMSS_WOTS_Parameters::ots_algorithm_t oid)
 

Protected Member Functions

void chain (secure_vector< uint8_t > &result, size_t start_idx, size_t steps, XMSS_Address &adrs, const secure_vector< uint8_t > &seed)
 

Protected Attributes

XMSS_Hash m_hash
 
XMSS_WOTS_Parameters m_wots_params
 

Detailed Description

Operations shared by XMSS WOTS signature generation and verification operations.

Definition at line 23 of file xmss_wots_common_ops.h.

Constructor & Destructor Documentation

Botan::XMSS_WOTS_Common_Ops::XMSS_WOTS_Common_Ops ( XMSS_WOTS_Parameters::ots_algorithm_t  oid)
inline

Definition at line 26 of file xmss_wots_common_ops.h.

Member Function Documentation

void Botan::XMSS_WOTS_Common_Ops::chain ( secure_vector< uint8_t > &  result,
size_t  start_idx,
size_t  steps,
XMSS_Address adrs,
const secure_vector< uint8_t > &  seed 
)
protected

Algorithm 2: Chaining Function.

Parameters
[out]resultContains the n-byte input string "x" upon call to chain(), that will be replaced with the value obtained by iterating the cryptographic hash function "F" steps times on the input x using the outputs of the PRNG "G".
[in]start_idxThe start index.
[in]stepsA number of steps.
[in]adrsAn OTS Hash Address.
[in]seedA Seed.

Definition at line 16 of file xmss_wots_common_ops.cpp.

References Botan::XMSS_Address::bytes(), Botan::XMSS_Hash::f(), Botan::XMSS_Address::Key_Mode, m_hash, m_wots_params, Botan::XMSS_Address::Mask_Mode, Botan::XMSS_Hash::prf(), Botan::XMSS_Address::set_hash_address(), Botan::XMSS_Address::set_key_mask_mode(), Botan::XMSS_WOTS_Parameters::wots_parameter(), and Botan::xor_buf().

21  {
22  for(size_t i = start_idx;
23  i < (start_idx + steps) && i < m_wots_params.wots_parameter();
24  i++)
25  {
26  adrs.set_hash_address(i);
27 
28  //Calculate tmp XOR bitmask
29  adrs.set_key_mask_mode(XMSS_Address::Key_Mask::Mask_Mode);
30  xor_buf(result, m_hash.prf(seed, adrs.bytes()), result.size());
31 
32  // Calculate key
33  adrs.set_key_mask_mode(XMSS_Address::Key_Mask::Key_Mode);
34 
35  //Calculate f(key, tmp XOR bitmask)
36  m_hash.f(result, m_hash.prf(seed, adrs.bytes()), result);
37  }
38  }
void xor_buf(T out[], const T in[], size_t length)
Definition: mem_ops.h:115
void f(secure_vector< uint8_t > &result, const secure_vector< uint8_t > &key, const secure_vector< uint8_t > &data)
Definition: xmss_hash.h:74
XMSS_WOTS_Parameters m_wots_params
void prf(secure_vector< uint8_t > &result, const secure_vector< uint8_t > &key, const secure_vector< uint8_t > &data)
Definition: xmss_hash.h:38

Member Data Documentation

XMSS_Hash Botan::XMSS_WOTS_Common_Ops::m_hash
protected

Definition at line 50 of file xmss_wots_common_ops.h.

Referenced by chain().

XMSS_WOTS_Parameters Botan::XMSS_WOTS_Common_Ops::m_wots_params
protected

Definition at line 49 of file xmss_wots_common_ops.h.

Referenced by chain(), and Botan::XMSS_WOTS_Signature_Operation::sign().


The documentation for this class was generated from the following files: