Vanetza
Loading...
Searching...
No Matches
vanetza::security::BackendCryptoPP Class Reference
Inheritance diagram for vanetza::security::BackendCryptoPP:

Public Types

using Ecdsa256 = CryptoPP::ECDSA<CryptoPP::ECP, CryptoPP::SHA256>
using Ecdsa384 = CryptoPP::ECDSA<CryptoPP::ECP, CryptoPP::SHA384>

Public Member Functions

EcdsaSignature sign_data (const ecdsa256::PrivateKey &private_key, const ByteBuffer &data_buffer) override
Signature sign_digest (const PrivateKey &, const ByteBuffer &digest) override
bool verify_data (const ecdsa256::PublicKey &public_key, const ByteBuffer &data, const EcdsaSignature &sig) override
bool verify_digest (const PublicKey &, const ByteBuffer &digest, const Signature &) override
boost::optional< Uncompresseddecompress_point (const EccPoint &ecc_point) override
ByteBuffer calculate_hash (HashAlgorithm, const ByteBuffer &) override
ecdsa256::KeyPair generate_key_pair ()
 generate a private key and the corresponding public key

Static Public Attributes

static constexpr auto backend_name = "CryptoPP"

Private Member Functions

EcdsaSignature sign_data (const Ecdsa256::PrivateKey &key, const ByteBuffer &data)
 internal sign method using crypto++ private key
bool verify_data (const Ecdsa256::PublicKey &key, const ByteBuffer &data, const ByteBuffer &sig)
 internal verify method using crypto++ public key
Ecdsa256::PrivateKey generate_private_key ()
 create private key
Ecdsa256::PublicKey generate_public_key (const Ecdsa256::PrivateKey &)
 derive public key from private key
Ecdsa256::PublicKey internal_public_key (const ecdsa256::PublicKey &)
 adapt generic public key to internal structure
Ecdsa256::PrivateKey internal_private_key (const ecdsa256::PrivateKey &)
 adapt generic private key to internal structure

Private Attributes

CryptoPP::AutoSeededRandomPool m_prng

Detailed Description

Definition at line 14 of file backend_cryptopp.hpp.

Member Typedef Documentation

◆ Ecdsa256

using vanetza::security::BackendCryptoPP::Ecdsa256 = CryptoPP::ECDSA<CryptoPP::ECP, CryptoPP::SHA256>

Definition at line 17 of file backend_cryptopp.hpp.

◆ Ecdsa384

using vanetza::security::BackendCryptoPP::Ecdsa384 = CryptoPP::ECDSA<CryptoPP::ECP, CryptoPP::SHA384>

Definition at line 18 of file backend_cryptopp.hpp.

Constructor & Destructor Documentation

◆ BackendCryptoPP()

vanetza::security::BackendCryptoPP::BackendCryptoPP ( )

Definition at line 182 of file backend_cryptopp.cpp.

Member Function Documentation

◆ calculate_hash()

ByteBuffer vanetza::security::BackendCryptoPP::calculate_hash ( HashAlgorithm algo_id,
const ByteBuffer & buffer )
overridevirtual
See also
Backend::calculate_hash

Implements vanetza::security::Backend.

Definition at line 352 of file backend_cryptopp.cpp.

◆ decompress_point()

boost::optional< Uncompressed > vanetza::security::BackendCryptoPP::decompress_point ( const EccPoint & ecc_point)
overridevirtual
See also
Backend::decompress_point

Implements vanetza::security::Backend.

Definition at line 298 of file backend_cryptopp.cpp.

◆ generate_key_pair()

ecdsa256::KeyPair vanetza::security::BackendCryptoPP::generate_key_pair ( )

generate a private key and the corresponding public key

Returns
generated key pair

Definition at line 367 of file backend_cryptopp.cpp.

◆ generate_private_key()

BackendCryptoPP::Ecdsa256::PrivateKey vanetza::security::BackendCryptoPP::generate_private_key ( )
private

create private key

Definition at line 384 of file backend_cryptopp.cpp.

◆ generate_public_key()

BackendCryptoPP::Ecdsa256::PublicKey vanetza::security::BackendCryptoPP::generate_public_key ( const Ecdsa256::PrivateKey & private_key)
private

derive public key from private key

Definition at line 393 of file backend_cryptopp.cpp.

◆ internal_private_key()

BackendCryptoPP::Ecdsa256::PrivateKey vanetza::security::BackendCryptoPP::internal_private_key ( const ecdsa256::PrivateKey & generic)
private

adapt generic private key to internal structure

Definition at line 413 of file backend_cryptopp.cpp.

◆ internal_public_key()

BackendCryptoPP::Ecdsa256::PublicKey vanetza::security::BackendCryptoPP::internal_public_key ( const ecdsa256::PublicKey & generic)
private

adapt generic public key to internal structure

Definition at line 401 of file backend_cryptopp.cpp.

◆ sign_data() [1/2]

EcdsaSignature vanetza::security::BackendCryptoPP::sign_data ( const Ecdsa256::PrivateKey & key,
const ByteBuffer & data )
private

internal sign method using crypto++ private key

Definition at line 191 of file backend_cryptopp.cpp.

◆ sign_data() [2/2]

EcdsaSignature vanetza::security::BackendCryptoPP::sign_data ( const ecdsa256::PrivateKey & private_key,
const ByteBuffer & data_buffer )
overridevirtual
See also
Backend::sign_data

Implements vanetza::security::Backend.

Definition at line 186 of file backend_cryptopp.cpp.

◆ sign_digest()

Signature vanetza::security::BackendCryptoPP::sign_digest ( const PrivateKey & private_key,
const ByteBuffer & digest )
overridevirtual
See also
Backend::sign_digest

Implements vanetza::security::Backend.

Definition at line 214 of file backend_cryptopp.cpp.

◆ verify_data() [1/2]

bool vanetza::security::BackendCryptoPP::verify_data ( const Ecdsa256::PublicKey & key,
const ByteBuffer & data,
const ByteBuffer & sig )
private

internal verify method using crypto++ public key

Definition at line 292 of file backend_cryptopp.cpp.

◆ verify_data() [2/2]

bool vanetza::security::BackendCryptoPP::verify_data ( const ecdsa256::PublicKey & public_key,
const ByteBuffer & data,
const EcdsaSignature & sig )
overridevirtual
See also
Backend::verify_data

Implements vanetza::security::Backend.

Definition at line 262 of file backend_cryptopp.cpp.

◆ verify_digest()

bool vanetza::security::BackendCryptoPP::verify_digest ( const PublicKey & public_key,
const ByteBuffer & digest,
const Signature & sig )
overridevirtual
See also
Backend::verify_digest

Implements vanetza::security::Backend.

Definition at line 268 of file backend_cryptopp.cpp.

Member Data Documentation

◆ backend_name

auto vanetza::security::BackendCryptoPP::backend_name = "CryptoPP"
staticconstexpr

Definition at line 20 of file backend_cryptopp.hpp.

◆ m_prng

CryptoPP::AutoSeededRandomPool vanetza::security::BackendCryptoPP::m_prng
private

Definition at line 67 of file backend_cryptopp.hpp.


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