Botan 3.9.0
Crypto and TLS for C&
Botan::ECIES_System_Params Class Referencefinal

#include <ecies.h>

Inheritance diagram for Botan::ECIES_System_Params:
Botan::ECIES_KA_Params

Public Member Functions

bool check_mode () const
bool cofactor_mode () const
EC_Point_Format compression_type () const
std::unique_ptr< Cipher_Modecreate_cipher (Cipher_Dir direction) const
 creates an instance of the data encryption method
std::unique_ptr< MessageAuthenticationCodecreate_mac () const
 creates an instance of the message authentication code
size_t dem_keylen () const
 returns the length of the key used by the data encryption method
const EC_Groupdomain () const
 ECIES_System_Params (const EC_Group &group, std::string_view kdf_spec, std::string_view dem_algo_spec, size_t dem_key_len, std::string_view mac_spec, size_t mac_key_len, EC_Point_Format point_format, ECIES_Flags flags)
 ECIES_System_Params (const EC_Group &group, std::string_view kdf_spec, std::string_view dem_algo_spec, size_t dem_key_len, std::string_view mac_spec, size_t mac_key_len, EC_Point_Format point_format=EC_Point_Format::Uncompressed, bool single_hash_mode=false)
 ECIES_System_Params (const ECIES_System_Params &)=default
 ECIES_System_Params (ECIES_System_Params &&)=default
const EC_Groupgroup () const
const std::string & kdf () const
const std::string & kdf_spec () const
size_t mac_keylen () const
 returns the length of the key used by the message authentication code
bool old_cofactor_mode () const
ECIES_System_Paramsoperator= (const ECIES_System_Params &)=delete
ECIES_System_Paramsoperator= (ECIES_System_Params &&)=delete
EC_Point_Format point_format () const
size_t secret_length () const
bool single_hash_mode () const
 ~ECIES_System_Params () override=default

Detailed Description

Definition at line 155 of file ecies.h.

Constructor & Destructor Documentation

◆ ECIES_System_Params() [1/4]

Botan::ECIES_System_Params::ECIES_System_Params ( const EC_Group & group,
std::string_view kdf_spec,
std::string_view dem_algo_spec,
size_t dem_key_len,
std::string_view mac_spec,
size_t mac_key_len,
EC_Point_Format point_format = EC_Point_Format::Uncompressed,
bool single_hash_mode = false )
Parameters
groupec domain parameters of the involved ec keys
kdf_specname of the key derivation function
dem_algo_specname of the data encryption method
dem_key_lenlength of the key used for the data encryption method
mac_specname of the message authentication code
mac_key_lenlength of the key used for the message authentication code

Definition at line 256 of file ecies.cpp.

263 :
264 ECIES_KA_Params(group, kdf, dem_key_len + mac_key_len, point_format, single_hash_mode),
265 m_dem_spec(dem_algo_spec),
266 m_dem_keylen(dem_key_len),
267 m_mac_spec(mac_spec),
268 m_mac_keylen(mac_key_len) {}
ECIES_KA_Params(const EC_Group &group, std::string_view kdf_spec, size_t length, EC_Point_Format point_format=EC_Point_Format::Uncompressed, bool single_hash_mode=true)
Definition ecies.cpp:226
bool single_hash_mode() const
Definition ecies.h:123
const EC_Group & group() const
Definition ecies.h:119
const std::string & kdf() const
Definition ecies.h:136
EC_Point_Format point_format() const
Definition ecies.h:134

References Botan::ECIES_KA_Params::ECIES_KA_Params(), Botan::ECIES_KA_Params::group(), Botan::ECIES_KA_Params::kdf(), Botan::ECIES_KA_Params::point_format(), and Botan::ECIES_KA_Params::single_hash_mode().

Referenced by ECIES_System_Params(), ECIES_System_Params(), operator=(), and operator=().

◆ ECIES_System_Params() [2/4]

Botan::ECIES_System_Params::ECIES_System_Params ( const EC_Group & group,
std::string_view kdf_spec,
std::string_view dem_algo_spec,
size_t dem_key_len,
std::string_view mac_spec,
size_t mac_key_len,
EC_Point_Format point_format,
ECIES_Flags flags )
Parameters
groupec domain parameters of the involved ec keys
kdf_specname of the key derivation function
dem_algo_specname of the data encryption method
dem_key_lenlength of the key used for the data encryption method
mac_specname of the message authentication code
mac_key_lenlength of the key used for the message authentication code
point_formatformat of encoded keys (affects the secret derivation if single_hash_mode is used)
flagsoptions, see documentation of ECIES_Flags

This constructor makes sense only if you are using the CofactorMode or OldCofactorMode flags. Support for cofactors in EC_Group is deprecated and will be removed in Botan4.

TODO(Botan4) remove this constructor when cofactor support is removed

Definition at line 237 of file ecies.cpp.

244 :
245 ECIES_KA_Params(group, kdf, dem_key_len + mac_key_len, point_format, flags),
246 m_dem_spec(dem_algo_spec),
247 m_dem_keylen(dem_key_len),
248 m_mac_spec(mac_spec),
249 m_mac_keylen(mac_key_len) {
250 // ISO 18033: "At most one of CofactorMode, OldCofactorMode, and CheckMode may be 1."
251 if(size_t(cofactor_mode()) + size_t(old_cofactor_mode()) + size_t(check_mode()) > 1) {
252 throw Invalid_Argument("ECIES: only one of cofactor_mode, old_cofactor_mode and check_mode can be set");
253 }
254}
bool check_mode() const
Definition ecies.h:132
bool old_cofactor_mode() const
Definition ecies.h:129
bool cofactor_mode() const
Definition ecies.h:126

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

◆ ECIES_System_Params() [3/4]

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

References ECIES_System_Params().

◆ ECIES_System_Params() [4/4]

Botan::ECIES_System_Params::ECIES_System_Params ( ECIES_System_Params && )
default

References ECIES_System_Params().

◆ ~ECIES_System_Params()

Botan::ECIES_System_Params::~ECIES_System_Params ( )
overridedefault

References create_cipher(), and create_mac().

Member Function Documentation

◆ check_mode()

bool Botan::ECIES_KA_Params::check_mode ( ) const
inlineinherited

Definition at line 132 of file ecies.h.

132{ return m_check_mode; }

Referenced by Botan::ECIES_System_Params::ECIES_System_Params().

◆ cofactor_mode()

bool Botan::ECIES_KA_Params::cofactor_mode ( ) const
inlineinherited

Definition at line 126 of file ecies.h.

126{ return m_cofactor_mode; }

Referenced by Botan::ECIES_System_Params::ECIES_System_Params().

◆ compression_type()

EC_Point_Format Botan::ECIES_KA_Params::compression_type ( ) const
inlineinherited

Definition at line 142 of file ecies.h.

142{ return point_format(); }

References compression_type(), and point_format().

Referenced by compression_type().

◆ create_cipher()

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

creates an instance of the data encryption method

Definition at line 274 of file ecies.cpp.

274 {
275 return Cipher_Mode::create_or_throw(m_dem_spec, direction);
276}
static std::unique_ptr< Cipher_Mode > create_or_throw(std::string_view algo, Cipher_Dir direction, std::string_view provider="")

References Botan::Cipher_Mode::create_or_throw().

Referenced by ~ECIES_System_Params().

◆ create_mac()

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

creates an instance of the message authentication code

Definition at line 270 of file ecies.cpp.

270 {
272}
static std::unique_ptr< MessageAuthenticationCode > create_or_throw(std::string_view algo_spec, std::string_view provider="")
Definition mac.cpp:148

References Botan::MessageAuthenticationCode::create_or_throw().

Referenced by ~ECIES_System_Params().

◆ dem_keylen()

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 213 of file ecies.h.

213{ return m_dem_keylen; }

◆ domain()

const EC_Group & Botan::ECIES_KA_Params::domain ( ) const
inlineinherited

Definition at line 140 of file ecies.h.

140{ return group(); }

References domain(), and group().

Referenced by domain().

◆ group()

const EC_Group & Botan::ECIES_KA_Params::group ( ) const
inlineinherited

◆ kdf()

const std::string & Botan::ECIES_KA_Params::kdf ( ) const
inlineinherited

◆ kdf_spec()

const std::string & Botan::ECIES_KA_Params::kdf_spec ( ) const
inlineinherited

Definition at line 138 of file ecies.h.

138{ return kdf(); }

References kdf(), and kdf_spec().

Referenced by kdf_spec().

◆ mac_keylen()

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 216 of file ecies.h.

216{ return m_mac_keylen; }

◆ old_cofactor_mode()

bool Botan::ECIES_KA_Params::old_cofactor_mode ( ) const
inlineinherited

Definition at line 129 of file ecies.h.

129{ return m_old_cofactor_mode; }

Referenced by Botan::ECIES_System_Params::ECIES_System_Params().

◆ operator=() [1/2]

ECIES_System_Params & Botan::ECIES_System_Params::operator= ( const ECIES_System_Params & )
delete

References ECIES_System_Params().

◆ operator=() [2/2]

ECIES_System_Params & Botan::ECIES_System_Params::operator= ( ECIES_System_Params && )
delete

References ECIES_System_Params().

◆ point_format()

EC_Point_Format Botan::ECIES_KA_Params::point_format ( ) const
inlineinherited

◆ secret_length()

size_t Botan::ECIES_KA_Params::secret_length ( ) const
inlineinherited

Definition at line 121 of file ecies.h.

121{ return m_length; }

◆ single_hash_mode()

bool Botan::ECIES_KA_Params::single_hash_mode ( ) const
inlineinherited

Definition at line 123 of file ecies.h.

123{ return m_single_hash_mode; }

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


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