Botan 3.7.1
Crypto and TLS for C&
Botan::Classic_McEliece_KeyPair_Internal Struct Reference

Representation of a Classic McEliece key pair. More...

#include <cmce_keys_internal.h>

Public Member Functions

std::pair< std::shared_ptr< Classic_McEliece_PrivateKeyInternal >, std::shared_ptr< Classic_McEliece_PublicKeyInternal > > decompose_to_pair () &&
 Decompose the key pair into a pair of shared pointers to the private and public key.
 

Static Public Member Functions

static Classic_McEliece_KeyPair_Internal generate (const Classic_McEliece_Parameters &params, StrongSpan< const CmceInitialSeed > seed)
 Generate a Classic McEliece key pair using the algorithm described in Classic McEliece ISO Section 8.3.
 

Public Attributes

std::shared_ptr< Classic_McEliece_PrivateKeyInternalprivate_key
 
std::shared_ptr< Classic_McEliece_PublicKeyInternalpublic_key
 

Detailed Description

Representation of a Classic McEliece key pair.

Definition at line 189 of file cmce_keys_internal.h.

Member Function Documentation

◆ decompose_to_pair()

std::pair< std::shared_ptr< Classic_McEliece_PrivateKeyInternal >, std::shared_ptr< Classic_McEliece_PublicKeyInternal > > Botan::Classic_McEliece_KeyPair_Internal::decompose_to_pair ( ) &&
inline

Decompose the key pair into a pair of shared pointers to the private and public key.

Definition at line 205 of file cmce_keys_internal.h.

205 {
206 return {std::move(private_key), std::move(public_key)};
207 }
std::shared_ptr< Classic_McEliece_PublicKeyInternal > public_key
std::shared_ptr< Classic_McEliece_PrivateKeyInternal > private_key

Referenced by Botan::Classic_McEliece_PrivateKey::Classic_McEliece_PrivateKey().

◆ generate()

Classic_McEliece_KeyPair_Internal Botan::Classic_McEliece_KeyPair_Internal::generate ( const Classic_McEliece_Parameters & params,
StrongSpan< const CmceInitialSeed > seed )
static

Generate a Classic McEliece key pair using the algorithm described in Classic McEliece ISO Section 8.3.

Definition at line 149 of file cmce_keys_internal.cpp.

150 {
151 BOTAN_ASSERT_EQUAL(seed.size(), params.seed_len(), "Valid seed length");
152
153 CmceKeyGenSeed next_seed(seed.size());
154 CmceKeyGenSeed current_seed(seed.begin(), seed.end());
155
156 while(true) {
157 if(auto keypair = try_generate_keypair(next_seed, params, std::move(current_seed))) {
158 return keypair.value();
159 }
160 current_seed = next_seed;
161 }
162}
#define BOTAN_ASSERT_EQUAL(expr1, expr2, assertion_made)
Definition assert.h:68
Strong< secure_vector< uint8_t >, struct CmceKeyGenSeed_ > CmceKeyGenSeed
Represents a delta (can be altered; final value stored in private key)
Definition cmce_types.h:34

References Botan::StrongSpan< T >::begin(), BOTAN_ASSERT_EQUAL, Botan::StrongSpan< T >::end(), Botan::Classic_McEliece_Parameters::seed_len(), and Botan::StrongSpan< T >::size().

Referenced by Botan::Classic_McEliece_PrivateKey::Classic_McEliece_PrivateKey().

Member Data Documentation

◆ private_key

std::shared_ptr<Classic_McEliece_PrivateKeyInternal> Botan::Classic_McEliece_KeyPair_Internal::private_key

Definition at line 190 of file cmce_keys_internal.h.

◆ public_key

std::shared_ptr<Classic_McEliece_PublicKeyInternal> Botan::Classic_McEliece_KeyPair_Internal::public_key

Definition at line 191 of file cmce_keys_internal.h.


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