Botan 3.3.0
Crypto and TLS for C&
Public Member Functions | List of all members
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 &domain, 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)
 
 ECIES_System_Params (const EC_Group &domain, 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 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
 
bool old_cofactor_mode () const
 
ECIES_System_Paramsoperator= (const ECIES_System_Params &)=delete
 
size_t secret_length () const
 
bool single_hash_mode () const
 
 ~ECIES_System_Params () override=default
 

Detailed Description

Definition at line 104 of file ecies.h.

Constructor & Destructor Documentation

◆ ECIES_System_Params() [1/3]

Botan::ECIES_System_Params::ECIES_System_Params ( const EC_Group & domain,
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 )
Parameters
domainec 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 195 of file ecies.cpp.

200 :
202 kdf_spec,
203 dem_algo_spec,
204 dem_key_len,
205 mac_spec,
206 mac_key_len,
const std::string & kdf_spec() const
Definition ecies.h:94
const EC_Group & domain() const
Definition ecies.h:76
ECIES_System_Params(const EC_Group &domain, 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)
Definition ecies.cpp:195

◆ ECIES_System_Params() [2/3]

Botan::ECIES_System_Params::ECIES_System_Params ( const EC_Group & domain,
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 compression_type,
ECIES_Flags flags )
Parameters
domainec 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
compression_typeformat of encoded keys (affects the secret derivation if single_hash_mode is used)
flagsoptions, see documentation of ECIES_Flags

Definition at line 176 of file ecies.cpp.

183 :
184 ECIES_KA_Params(domain, kdf_spec, dem_key_len + mac_key_len, compression_type, flags),
185 m_dem_spec(dem_algo_spec),
186 m_dem_keylen(dem_key_len),
187 m_mac_spec(mac_spec),
188 m_mac_keylen(mac_key_len) {
189 // ISO 18033: "At most one of CofactorMode, OldCofactorMode, and CheckMode may be 1."
190 if(size_t(cofactor_mode()) + size_t(old_cofactor_mode()) + size_t(check_mode()) > 1) {
191 throw Invalid_Argument("ECIES: only one of cofactor_mode, old_cofactor_mode and check_mode can be set");
192 }
193}
ECIES_KA_Params(const EC_Group &domain, std::string_view kdf_spec, size_t length, EC_Point_Format compression_type, ECIES_Flags flags)
Definition ecies.cpp:169
bool check_mode() const
Definition ecies.h:90
bool old_cofactor_mode() const
Definition ecies.h:86
EC_Point_Format compression_type() const
Definition ecies.h:92
bool cofactor_mode() const
Definition ecies.h:84

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

◆ ECIES_System_Params() [3/3]

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

◆ ~ECIES_System_Params()

Botan::ECIES_System_Params::~ECIES_System_Params ( )
overridedefault

Member Function Documentation

◆ check_mode()

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

Definition at line 90 of file ecies.h.

90{ return (m_flags & ECIES_Flags::CheckMode) == ECIES_Flags::CheckMode; }
@ CheckMode
(decryption only) if set: test if the (ephemeral) public key is on the curve

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

◆ cofactor_mode()

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

Definition at line 84 of file ecies.h.

@ CofactorMode
(decryption only) if set: use cofactor multiplication during (ecdh) key agreement

Referenced by ECIES_System_Params().

◆ compression_type()

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

Definition at line 92 of file ecies.h.

92{ return m_compression_mode; }

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

◆ 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 214 of file ecies.cpp.

214 {
215 return Cipher_Mode::create_or_throw(m_dem_spec, direction);
216}
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 Botan::ECIES_Decryptor::ECIES_Decryptor(), and Botan::ECIES_Encryptor::ECIES_Encryptor().

◆ create_mac()

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

creates an instance of the message authentication code

Definition at line 210 of file ecies.cpp.

210 {
212}
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 Botan::ECIES_Decryptor::ECIES_Decryptor(), and Botan::ECIES_Encryptor::ECIES_Encryptor().

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

151{ return m_dem_keylen; }

◆ domain()

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

◆ kdf_spec()

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

Definition at line 94 of file ecies.h.

94{ return m_kdf_spec; }

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

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

154{ return m_mac_keylen; }

◆ old_cofactor_mode()

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

Definition at line 86 of file ecies.h.

86 {
88 }
@ OldCofactorMode
if set: use ecdhc instead of ecdh

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

◆ operator=()

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

◆ secret_length()

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

Definition at line 78 of file ecies.h.

78{ return m_length; }

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

◆ single_hash_mode()

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

Definition at line 80 of file ecies.h.

80 {
82 }
@ SingleHashMode
if set: prefix the input of the (ecdh) key agreement with the encoded (ephemeral) public key

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


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