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 | List of all members
Botan::ECIES_System_Params Class Reference

`#include <ecies.h>`

Inheritance diagram for Botan::ECIES_System_Params:

## Public Member Functions
bool | check_mode () const
bool | cofactor_mode () const
PointGFp::Compression_Type | compression_type () const
std::unique_ptr< Cipher_Mode > | create_cipher (Botan::Cipher_Dir direction) const
| creates an instance of the data encryption method More...
std::unique_ptr< MessageAuthenticationCode > | create_mac () const
| creates an instance of the message authentication code More...
size_t | dem_keylen () const
| returns the length of the key used by the data encryption method More...
const EC_Group & | domain () const
| ECIES_System_Params (const EC_Group &domain, const std::string &kdf_spec, const std::string &dem_algo_spec, size_t dem_key_len, const std::string &mac_spec, size_t mac_key_len)
| ECIES_System_Params (const EC_Group &domain, const std::string &kdf_spec, const std::string &dem_algo_spec, size_t dem_key_len, const std::string &mac_spec, size_t mac_key_len, PointGFp::Compression_Type compression_type, ECIES_Flags flags)
| ECIES_System_Params (const ECIES_System_Params &)=default
const std::string & | kdf_spec () const
size_t | mac_keylen () const
| returns the length of the key used by the message authentication code More...
bool | old_cofactor_mode () const
ECIES_System_Params & | operator= (const ECIES_System_Params &)=default
size_t | secret_length () const
bool | single_hash_mode () const
virtual | ~ECIES_System_Params ()=default

## Detailed Description

Definition at line 124 of file ecies.h.

## Constructor & Destructor Documentation

Botan::ECIES_System_Params::ECIES_System_Params | ( | const EC_Group & | domain,
|  | const std::string & | kdf_spec,
|  | const std::string & | dem_algo_spec,
|  | size_t | dem_key_len,
|  | const std::string & | mac_spec,
|  | size_t | mac_key_len
| ) |  |

Parameters

  domain | ec domain parameters of the involved ec keys
  kdf_spec | name of the key derivation function
  dem_algo_spec | name of the data encryption method
  dem_key_len | length of the key used for the data encryption method
  mac_spec | name of the message authentication code
  mac_key_len | length of the key used for the message authentication code

Definition at line 201 of file ecies.cpp.

203 :
204 ECIES_System_Params(domain, kdf_spec, dem_algo_spec, dem_key_len, mac_spec, mac_key_len, PointGFp::UNCOMPRESSED,
205 ECIES_Flags::NONE)
206 {
207 }
Botan::PointGFp::UNCOMPRESSED
Definition: point_gfp.h:45
Botan::ECIES_Flags::NONE
Botan::ECIES_KA_Params::domain
const EC_Group & domain() const
Definition: ecies.h:75
Botan::ECIES_System_Params::ECIES_System_Params
ECIES_System_Params(const EC_Group &domain, const std::string &kdf_spec, const std::string &dem_algo_spec, size_t dem_key_len, const std::string &mac_spec, size_t mac_key_len)
Definition: ecies.cpp:201
Botan::ECIES_KA_Params::kdf_spec
const std::string & kdf_spec() const
Definition: ecies.h:110

Botan::ECIES_System_Params::ECIES_System_Params | ( | const EC_Group & | domain,
|  | const std::string & | kdf_spec,
|  | const std::string & | dem_algo_spec,
|  | size_t | dem_key_len,
|  | const std::string & | mac_spec,
|  | size_t | mac_key_len,
|  | PointGFp::Compression_Type | compression_type,
|  | ECIES_Flags | flags
| ) |  |

Parameters

  domain | ec domain parameters of the involved ec keys
  kdf_spec | name of the key derivation function
  dem_algo_spec | name of the data encryption method
  dem_key_len | length of the key used for the data encryption method
  mac_spec | name of the message authentication code
  mac_key_len | length of the key used for the message authentication code
  compression_type | format of encoded keys (affects the secret derivation if single_hash_mode is used)
  flags | options, see documentation of ECIES_Flags

Definition at line 184 of file ecies.cpp.

References Botan::ECIES_KA_Params::check_mode(), Botan::ECIES_KA_Params::cofactor_mode(), and Botan::ECIES_KA_Params::old_cofactor_mode().

187 :
188 ECIES_KA_Params(domain, kdf_spec, dem_key_len + mac_key_len, compression_type, flags),
189 m_dem_spec(dem_algo_spec),
190 m_dem_keylen(dem_key_len),
191 m_mac_spec(mac_spec),
192 m_mac_keylen(mac_key_len)
193 {
194 // ISO 18033: "At most one of CofactorMode, OldCofactorMode, and CheckMode may be 1."
195 if(cofactor_mode() + old_cofactor_mode() + check_mode() > 1)
196 {
197 throw Invalid_Argument("ECIES: only one of cofactor_mode, old_cofactor_mode and check_mode can be set");
198 }
199 }
Botan::ECIES_KA_Params::ECIES_KA_Params
ECIES_KA_Params(const EC_Group &domain, const std::string &kdf_spec, size_t length, PointGFp::Compression_Type compression_type, ECIES_Flags flags)
Definition: ecies.cpp:174
Botan::PKCS11::flags
Flags flags(Flag flags)
Definition: p11.h:858
Botan::ECIES_KA_Params::domain
const EC_Group & domain() const
Definition: ecies.h:75
Botan::ECIES_KA_Params::check_mode
bool check_mode() const
Definition: ecies.h:100
Botan::ECIES_KA_Params::cofactor_mode
bool cofactor_mode() const
Definition: ecies.h:90
Botan::ECIES_KA_Params::kdf_spec
const std::string & kdf_spec() const
Definition: ecies.h:110
Botan::ECIES_KA_Params::compression_type
PointGFp::Compression_Type compression_type() const
Definition: ecies.h:105
Botan::ECIES_KA_Params::old_cofactor_mode
bool old_cofactor_mode() const
Definition: ecies.h:95

Botan::ECIES_System_Params::ECIES_System_Params | ( | const ECIES_System_Params & |  | ) |
| default

virtual Botan::ECIES_System_Params::~ECIES_System_Params | ( |  | ) |
| virtual default

## Member Function Documentation

bool Botan::ECIES_KA_Params::check_mode | ( |  | ) | const
| inline inherited

Definition at line 100 of file ecies.h.

References Botan::CHECK_MODE.

Referenced by Botan::ECIES_Decryptor::ECIES_Decryptor(), and ECIES_System_Params().

101 {
102 return (m_flags & ECIES_Flags::CHECK_MODE) == ECIES_Flags::CHECK_MODE;
103 }
Botan::ECIES_Flags::CHECK_MODE
(decryption only) if set: test if the (ephemeral) public key is on the curve

bool Botan::ECIES_KA_Params::cofactor_mode | ( |  | ) | const
| inline inherited

Definition at line 90 of file ecies.h.

References Botan::COFACTOR_MODE.

Referenced by ECIES_System_Params().

91 {
92 return (m_flags & ECIES_Flags::COFACTOR_MODE) == ECIES_Flags::COFACTOR_MODE;
93 }
Botan::ECIES_Flags::COFACTOR_MODE
(decryption only) if set: use cofactor multiplication during (ecdh) key agreement ...

PointGFp::Compression_Type Botan::ECIES_KA_Params::compression_type | ( |  | ) | const
| inline inherited

Definition at line 105 of file ecies.h.

Referenced by Botan::ECIES_KA_Operation::derive_secret(), and Botan::ECIES_Encryptor::ECIES_Encryptor().

106 {
107 return m_compression_mode;
108 }

std::unique_ptr< Cipher_Mode > Botan::ECIES_System_Params::create_cipher | ( | Botan::Cipher_Dir | direction | ) | const

creates an instance of the data encryption method

Definition at line 214 of file ecies.cpp.

References Botan::get_cipher_mode().

215 {
216 Cipher_Mode* cipher = get_cipher_mode(m_dem_spec, direction);
217 if(cipher == nullptr)
218 {
219 throw Algorithm_Not_Found(m_dem_spec);
220 }
221 return std::unique_ptr<Cipher_Mode>(cipher);
222 }
Botan::get_cipher_mode
Cipher_Mode * get_cipher_mode(const std::string &algo, Cipher_Dir direction)
Definition: cipher_mode.cpp:39

std::unique_ptr< MessageAuthenticationCode > Botan::ECIES_System_Params::create_mac | ( |  | ) | const

creates an instance of the message authentication code

Definition at line 209 of file ecies.cpp.

References Botan::MessageAuthenticationCode::create_or_throw().

210 {
211 return Botan::MessageAuthenticationCode::create_or_throw(m_mac_spec);
212 }
Botan::MessageAuthenticationCode::create_or_throw
static std::unique_ptr< MessageAuthenticationCode > create_or_throw(const std::string &algo_spec, const std::string &provider="")
Definition: mac.cpp:138

size_t Botan::ECIES_System_Params::dem_keylen | ( |  | ) | const
| inline

returns the length of the key used by the data encryption method

Definition at line 163 of file ecies.h.

164 {
165 return m_dem_keylen;
166 }

const EC_Group& Botan::ECIES_KA_Params::domain | ( |  | ) | const
| inline inherited

Definition at line 75 of file ecies.h.

Referenced by Botan::ECIES_KA_Operation::derive_secret(), Botan::ECIES_Decryptor::ECIES_Decryptor(), and Botan::ECIES_Encryptor::ECIES_Encryptor().

76 {
77 return m_domain;
78 }

const std::string& Botan::ECIES_KA_Params::kdf_spec | ( |  | ) | const
| inline inherited

Definition at line 110 of file ecies.h.

Referenced by Botan::ECIES_KA_Operation::derive_secret().

111 {
112 return m_kdf_spec;
113 }

size_t Botan::ECIES_System_Params::mac_keylen | ( |  | ) | const
| inline

returns the length of the key used by the message authentication code

Definition at line 169 of file ecies.h.

170 {
171 return m_mac_keylen;
172 }

bool Botan::ECIES_KA_Params::old_cofactor_mode | ( |  | ) | const
| inline inherited

Definition at line 95 of file ecies.h.

References Botan::OLD_COFACTOR_MODE.

Referenced by Botan::ECIES_KA_Operation::derive_secret(), and ECIES_System_Params().

96 {
97 return (m_flags & ECIES_Flags::OLD_COFACTOR_MODE) == ECIES_Flags::OLD_COFACTOR_MODE;
98 }
Botan::ECIES_Flags::OLD_COFACTOR_MODE
if set: use ecdhc instead of ecdh

ECIES_System_Params& Botan::ECIES_System_Params::operator= | ( | const ECIES_System_Params & |  | ) |
| default

size_t Botan::ECIES_KA_Params::secret_length | ( |  | ) | const
| inline inherited

Definition at line 80 of file ecies.h.

Referenced by Botan::ECIES_KA_Operation::derive_secret().

81 {
82 return m_length;
83 }

bool Botan::ECIES_KA_Params::single_hash_mode | ( |  | ) | const
| inline inherited

Definition at line 85 of file ecies.h.

References Botan::SINGLE_HASH_MODE.

Referenced by Botan::ECIES_KA_Operation::derive_secret().

86 {
87 return (m_flags & ECIES_Flags::SINGLE_HASH_MODE) == ECIES_Flags::SINGLE_HASH_MODE;
88 }
Botan::ECIES_Flags::SINGLE_HASH_MODE
if set: prefix the input of the (ecdh) key agreement with the encoded (ephemeral) public key ...

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

- src/lib/pubkey/ecies/ecies.h
- src/lib/pubkey/ecies/ecies.cpp