Botan 2.1.0 Crypto and TLS for C++11

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

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:

## 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.

27 : m_wots_params(oid), m_hash(m_wots_params.hash_function_name()) {}
Botan::XMSS_WOTS_Common_Ops::m_hash
XMSS_Hash m_hash
Definition: xmss_wots_common_ops.h:50
Botan::XMSS_WOTS_Common_Ops::m_wots_params
XMSS_WOTS_Parameters m_wots_params
Definition: xmss_wots_common_ops.h:49
Botan::XMSS_WOTS_Parameters::hash_function_name
const std::string & hash_function_name() const
Definition: xmss_wots_parameters.h:75

## 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] | result | Contains 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_idx | The start index.
  [in] | steps | A number of steps.
  [in] | adrs | An OTS Hash Address.
  [in] | seed | A 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 }
Botan::xor_buf
void xor_buf(T out[], const T in[], size_t length)
Definition: mem_ops.h:115
Botan::XMSS_WOTS_Common_Ops::m_hash
XMSS_Hash m_hash
Definition: xmss_wots_common_ops.h:50
Botan::XMSS_Hash::f
void f(secure_vector< uint8_t > &result, const secure_vector< uint8_t > &key, const secure_vector< uint8_t > &data)
Definition: xmss_hash.h:74
Botan::XMSS_WOTS_Common_Ops::m_wots_params
XMSS_WOTS_Parameters m_wots_params
Definition: xmss_wots_common_ops.h:49
Botan::XMSS_Hash::prf
void prf(secure_vector< uint8_t > &result, const secure_vector< uint8_t > &key, const secure_vector< uint8_t > &data)
Definition: xmss_hash.h:38
Botan::XMSS_WOTS_Parameters::wots_parameter
size_t wots_parameter() const
Definition: xmss_wots_parameters.h:95
Botan::XMSS_Address::Key_Mask::Mask_Mode
Botan::XMSS_Address::Key_Mask::Key_Mode

## 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:

- src/lib/pubkey/xmss/xmss_wots_common_ops.h
- src/lib/pubkey/xmss/xmss_wots_common_ops.cpp