Zephyr API
4.4.99
A Scalable Open Source RTOS
Toggle main menu visibility
Loading...
Searching...
No Matches
crypto.h
Go to the documentation of this file.
1
4
5
/*
6
* Copyright (c) 2017-2020 Nordic Semiconductor ASA
7
* Copyright (c) 2015-2017 Intel Corporation
8
*
9
* SPDX-License-Identifier: Apache-2.0
10
*/
11
#ifndef ZEPHYR_INCLUDE_BLUETOOTH_CRYPTO_H_
12
#define ZEPHYR_INCLUDE_BLUETOOTH_CRYPTO_H_
13
20
21
#include <
stdbool.h
>
22
#include <stddef.h>
23
#include <
stdint.h
>
24
25
#ifdef __cplusplus
26
extern
"C"
{
27
#endif
28
40
int
bt_rand
(
void
*buf,
size_t
len);
41
54
int
bt_encrypt_le
(
const
uint8_t
key[16],
const
uint8_t
plaintext[16],
55
uint8_t
enc_data[16]);
56
69
int
bt_encrypt_be
(
const
uint8_t
key[16],
const
uint8_t
plaintext[16],
70
uint8_t
enc_data[16]);
71
72
93
int
bt_ccm_decrypt
(
const
uint8_t
key[16],
uint8_t
nonce[13],
const
uint8_t
*enc_data,
94
size_t
len,
const
uint8_t
*aad,
size_t
aad_len,
95
uint8_t
*plaintext,
size_t
mic_size);
96
97
117
int
bt_ccm_encrypt
(
const
uint8_t
key[16],
uint8_t
nonce[13],
118
const
uint8_t
*plaintext,
size_t
len,
const
uint8_t
*aad,
119
size_t
aad_len,
uint8_t
*enc_data,
size_t
mic_size);
120
121
#ifdef __cplusplus
122
}
123
#endif
127
128
#endif
/* ZEPHYR_INCLUDE_BLUETOOTH_CRYPTO_H_ */
bt_rand
int bt_rand(void *buf, size_t len)
Generate random data.
bt_ccm_decrypt
int bt_ccm_decrypt(const uint8_t key[16], uint8_t nonce[13], const uint8_t *enc_data, size_t len, const uint8_t *aad, size_t aad_len, uint8_t *plaintext, size_t mic_size)
Decrypt big-endian data with AES-CCM.
bt_encrypt_le
int bt_encrypt_le(const uint8_t key[16], const uint8_t plaintext[16], uint8_t enc_data[16])
AES encrypt little-endian data.
bt_ccm_encrypt
int bt_ccm_encrypt(const uint8_t key[16], uint8_t nonce[13], const uint8_t *plaintext, size_t len, const uint8_t *aad, size_t aad_len, uint8_t *enc_data, size_t mic_size)
Encrypt big-endian data with AES-CCM.
bt_encrypt_be
int bt_encrypt_be(const uint8_t key[16], const uint8_t plaintext[16], uint8_t enc_data[16])
AES encrypt big-endian data.
stdbool.h
stdint.h
uint8_t
__UINT8_TYPE__ uint8_t
Definition
stdint.h:88
zephyr
bluetooth
crypto.h
Generated on
for Zephyr API by
1.17.0