1#ifndef BACKEND_CRYPTOPP_HPP_JQWA9MLZ
2#define BACKEND_CRYPTOPP_HPP_JQWA9MLZ
4#include <vanetza/common/lru_cache.hpp>
5#include <vanetza/security/backend.hpp>
6#include <cryptopp/eccrypto.h>
7#include <cryptopp/osrng.h>
8#include <cryptopp/sha.h>
18 using Ecdsa256 = CryptoPP::ECDSA<CryptoPP::ECP, CryptoPP::SHA256>;
19 using Ecdsa384 = CryptoPP::ECDSA<CryptoPP::ECP, CryptoPP::SHA384>;
21 static constexpr auto backend_name =
"CryptoPP";
35 boost::optional<Uncompressed>
decompress_point(
const EccPoint& ecc_point)
override;
51 bool verify_data(
const Ecdsa256::PublicKey& key,
const ByteBuffer& data,
const ByteBuffer& sig);
65 CryptoPP::AutoSeededRandomPool m_prng;
Least-Recently-Used cache.
Ecdsa256::PrivateKey generate_private_key()
create private key
Ecdsa256::PublicKey internal_public_key(const ecdsa256::PublicKey &)
adapt generic public key to internal structure
boost::optional< Uncompressed > decompress_point(const EccPoint &ecc_point) override
ByteBuffer calculate_hash(KeyType, const ByteBuffer &) override
Ecdsa256::PublicKey generate_public_key(const Ecdsa256::PrivateKey &)
derive public key from private key
bool verify_data(const ecdsa256::PublicKey &public_key, const ByteBuffer &data, const EcdsaSignature &sig) override
EcdsaSignature sign_data(const ecdsa256::PrivateKey &private_key, const ByteBuffer &data_buffer) override
bool verify_digest(const PublicKey &, const ByteBuffer &digest, const Signature &) override
ecdsa256::KeyPair generate_key_pair()
generate a private key and the corresponding public key
Ecdsa256::PrivateKey internal_private_key(const ecdsa256::PrivateKey &)
adapt generic private key to internal structure
EcdsaSignature specified in TS 103 097 v1.2.1, section 4.2.9.