Vanetza
Loading...
Searching...
No Matches
fndsa512.hpp
1#pragma once
2
3#include <vanetza/common/byte_buffer.hpp>
4#include <cstddef>
5#include <memory>
6
7namespace vanetza
8{
9namespace security
10{
11namespace pqc
12{
13
14constexpr std::size_t fndsa512_public_key_size = 897;
15constexpr std::size_t fndsa512_private_key_size = 1281;
16constexpr std::size_t fndsa512_signature_size = 666;
17
19{
20 ByteBuffer bytes;
21};
22
24{
25 ByteBuffer bytes;
26};
27
29{
30 ByteBuffer bytes;
31};
32
33struct KeyPair
34{
35 PublicKey public_key;
36 PrivateKey private_key;
37};
38
39/**
40 * Cryptographic operations for the experimental FN-DSA-512 profile.
41 *
42 * The interface is intentionally separate from security::Backend. Enabling
43 * the experimental profile therefore does not alter the established ECC
44 * backend contract or its key types.
45 */
47{
48public:
49 virtual KeyPair generate_key_pair() = 0;
50 virtual Signature sign(const PrivateKey&, const ByteBuffer& data) = 0;
51 virtual bool verify(const PublicKey&, const ByteBuffer& data, const Signature&) = 0;
52 virtual ~Backend() = default;
53};
54
55/**
56 * Create the liboqs-backed implementation used by the experimental profile.
57 */
58std::unique_ptr<Backend> create_fndsa512_backend();
59
60} // namespace pqc
61} // namespace security
62} // namespace vanetza