Direct-BT
v3.3.0-1-gc2d430c
Direct-BT - Direct Bluetooth Programming.
api
direct_bt
SMPCrypto.hpp
Go to the documentation of this file.
1
/*
2
* Author: Sven Gothel <sgothel@jausoft.com>
3
* Copyright (c) 2020 Gothel Software e.K.
4
* Copyright (c) 2020 ZAFENA AB
5
*
6
* Permission is hereby granted, free of charge, to any person obtaining
7
* a copy of this software and associated documentation files (the
8
* "Software"), to deal in the Software without restriction, including
9
* without limitation the rights to use, copy, modify, merge, publish,
10
* distribute, sublicense, and/or sell copies of the Software, and to
11
* permit persons to whom the Software is furnished to do so, subject to
12
* the following conditions:
13
*
14
* The above copyright notice and this permission notice shall be
15
* included in all copies or substantial portions of the Software.
16
*
17
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
21
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
22
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
23
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24
*/
25
26
#ifndef SMP_CRYPTO_HPP_
27
#define SMP_CRYPTO_HPP_
28
29
#include <
jau/int_types.hpp
>
30
#include <
jau/byte_util.hpp
>
31
#include <
jau/eui48.hpp
>
32
33
#include "
BTAddress.hpp
"
34
35
namespace
direct_bt
{
36
/** Returns true if the given IRK matches the given random private address (RPA). */
37
bool
smp_crypto_rpa_irk_matches
(
const
jau::uint128dp_t
irk,
const
EUI48
& rpa)
noexcept
;
38
39
bool
smp_crypto_f5
(
const
jau::uint256dp_t
w,
const
jau::uint128dp_t
n1,
const
jau::uint128dp_t
n2,
40
const
BDAddressAndType
& a1,
const
BDAddressAndType
& a2,
41
jau::uint128dp_t
& mackey,
jau::uint128dp_t
& ltk)
noexcept
;
42
43
}
// namespace direct_bt
44
45
#endif
/* SMP_CRYPTO_HPP_ */
BTAddress.hpp
byte_util.hpp
direct_bt::BDAddressAndType
Unique Bluetooth EUI48 address and BDAddressType tuple.
Definition:
BTAddress.hpp:175
eui48.hpp
int_types.hpp
direct_bt
Definition:
ATTPDUTypes.hpp:197
direct_bt::smp_crypto_rpa_irk_matches
bool smp_crypto_rpa_irk_matches(const jau::uint128dp_t irk, const EUI48 &rpa) noexcept
Returns true if the given IRK matches the given random private address (RPA).
Definition:
SMPCrypto.cpp:167
direct_bt::smp_crypto_f5
bool smp_crypto_f5(const jau::uint256dp_t w, const jau::uint128dp_t n1, const jau::uint128dp_t n2, const BDAddressAndType &a1, const BDAddressAndType &a2, jau::uint128dp_t &mackey, jau::uint128dp_t <k) noexcept
jau::EUI48
A packed 48 bit EUI-48 identifier, formerly known as MAC-48 or simply network device MAC address (Med...
Definition:
eui48.hpp:324
jau::uint128dp_t
A 128-bit packed uint8_t data array.
Definition:
int_types.hpp:114
jau::uint256dp_t
A 256-bit packed uint8_t data array.
Definition:
int_types.hpp:158
Generated on Sun May 12 2024 09:25:36 for Direct-BT by
1.9.4