Vanetza
Loading...
Searching...
No Matches
ecdsa256.hpp
1
#ifndef ECDSA256_HPP_IOXLJFVZ
2
#define ECDSA256_HPP_IOXLJFVZ
3
4
#include <array>
5
#include <cstdint>
6
#include <functional>
7
8
namespace
vanetza
9
{
10
namespace
security
11
{
12
13
// forward declaration
14
struct
Uncompressed
;
15
16
namespace
ecdsa256
17
{
18
19
constexpr
unsigned
digest_octets = 32;
20
21
struct
PublicKey
22
{
23
std::array<uint8_t, digest_octets> x;
24
std::array<uint8_t, digest_octets> y;
25
};
26
27
bool
operator==(
const
PublicKey
& lhs,
const
PublicKey
& rhs);
28
bool
operator!=(
const
PublicKey
& lhs,
const
PublicKey
& rhs);
29
30
31
struct
PrivateKey
32
{
33
std::array<uint8_t, digest_octets> key;
34
};
35
36
bool
operator==(
const
PrivateKey
& lhs,
const
PrivateKey
& rhs);
37
bool
operator!=(
const
PrivateKey
& lhs,
const
PrivateKey
& rhs);
38
39
40
struct
KeyPair
41
{
42
PrivateKey
private_key;
43
PublicKey
public_key;
44
};
45
46
/**
47
* Create generic public key from uncompressed ECC point
48
* \param unc Uncompressed ECC point
49
* \return public key
50
*/
51
PublicKey
create_public_key(
const
Uncompressed
&);
52
53
}
// namespace ecdsa256
54
}
// namespace security
55
}
// namespace vanetza
56
57
58
namespace
std
59
{
60
61
template
<>
62
struct
hash<vanetza::security::ecdsa256::PublicKey>
63
{
64
size_t
operator()(
const
vanetza::security::ecdsa256::PublicKey
&)
const
;
65
};
66
67
template
<>
68
struct
hash<vanetza::security::ecdsa256::PrivateKey>
69
{
70
size_t
operator()(
const
vanetza::security::ecdsa256::PrivateKey&)
const
;
71
};
72
73
}
// namespace std
74
75
#endif
/* ECDSA256_HPP_IOXLJFVZ */
76
std
STL namespace.
vanetza::security::Uncompressed
Uncompressed specified in TS 103 097 v1.2.1 in section 4.2.5.
Definition
ecc_point.hpp:36
vanetza::security::ecdsa256::KeyPair
Definition
ecdsa256.hpp:41
vanetza::security::ecdsa256::PrivateKey
Definition
ecdsa256.hpp:32
vanetza::security::ecdsa256::PublicKey
Definition
ecdsa256.hpp:22
vanetza
security
ecdsa256.hpp
Generated on
for Vanetza by
1.14.0