#include <LoRaMacCrypto.h>
Public Member Functions | |
LoRaMacCrypto () | |
Constructor. More... | |
~LoRaMacCrypto () | |
Destructor. More... | |
int | compute_mic (const uint8_t *buffer, uint16_t size, const uint8_t *key, uint32_t key_length, uint32_t address, uint8_t dir, uint32_t seq_counter, uint32_t *mic) |
Computes the LoRaMAC frame MIC field. More... | |
int | encrypt_payload (const uint8_t *buffer, uint16_t size, const uint8_t *key, uint32_t key_length, uint32_t address, uint8_t dir, uint32_t seq_counter, uint8_t *enc_buffer) |
Performs payload encryption. More... | |
int | decrypt_payload (const uint8_t *buffer, uint16_t size, const uint8_t *key, uint32_t key_length, uint32_t address, uint8_t dir, uint32_t seq_counter, uint8_t *dec_buffer) |
Performs payload decryption. More... | |
int | compute_join_frame_mic (const uint8_t *buffer, uint16_t size, const uint8_t *key, uint32_t key_length, uint32_t *mic) |
Computes the LoRaMAC Join Request frame MIC field. More... | |
int | decrypt_join_frame (const uint8_t *buffer, uint16_t size, const uint8_t *key, uint32_t key_length, uint8_t *dec_buffer) |
Computes the LoRaMAC join frame decryption. More... | |
int | compute_skeys_for_join_frame (const uint8_t *key, uint32_t key_length, const uint8_t *app_nonce, uint16_t dev_nonce, uint8_t *nwk_skey, uint8_t *app_skey) |
Computes the LoRaMAC join frame decryption. More... | |
Description: LoRa MAC Crypto implementation
License: Revised BSD License, see LICENSE.TXT file include in the project
Maintainer: Miguel Luis ( Semtech ), Gregory Cristian ( Semtech ) and Daniel Jaeckle ( STACKFORCE )
Copyright (c) 2017, Arm Limited and affiliates.
SPDX-License-Identifier: BSD-3-Clause
Definition at line 37 of file LoRaMacCrypto.h.
LoRaMacCrypto | ( | ) |
Constructor.
~LoRaMacCrypto | ( | ) |
Destructor.
int compute_join_frame_mic | ( | const uint8_t * | buffer, |
uint16_t | size, | ||
const uint8_t * | key, | ||
uint32_t | key_length, | ||
uint32_t * | mic | ||
) |
Computes the LoRaMAC Join Request frame MIC field.
[in] | buffer | - Data buffer |
[in] | size | - Data buffer size |
[in] | key | - AES key to be used |
[in] | key_length | - Length of the key (bits) |
[out] | mic | - Computed MIC field |
int compute_mic | ( | const uint8_t * | buffer, |
uint16_t | size, | ||
const uint8_t * | key, | ||
uint32_t | key_length, | ||
uint32_t | address, | ||
uint8_t | dir, | ||
uint32_t | seq_counter, | ||
uint32_t * | mic | ||
) |
Computes the LoRaMAC frame MIC field.
[in] | buffer | - Data buffer |
[in] | size | - Data buffer size |
[in] | key | - AES key to be used |
[in] | key_length | - Length of the key (bits) |
[in] | address | - Frame address |
[in] | dir | - Frame direction [0: uplink, 1: downlink] |
[in] | seq_counter | - Frame sequence counter |
[out] | mic | - Computed MIC field |
int compute_skeys_for_join_frame | ( | const uint8_t * | key, |
uint32_t | key_length, | ||
const uint8_t * | app_nonce, | ||
uint16_t | dev_nonce, | ||
uint8_t * | nwk_skey, | ||
uint8_t * | app_skey | ||
) |
Computes the LoRaMAC join frame decryption.
[in] | key | - AES key to be used |
[in] | key_length | - Length of the key (bits) |
[in] | app_nonce | - Application nonce |
[in] | dev_nonce | - Device nonce |
[out] | nwk_skey | - Network session key |
[out] | app_skey | - Application session key |
int decrypt_join_frame | ( | const uint8_t * | buffer, |
uint16_t | size, | ||
const uint8_t * | key, | ||
uint32_t | key_length, | ||
uint8_t * | dec_buffer | ||
) |
Computes the LoRaMAC join frame decryption.
[in] | buffer | - Data buffer |
[in] | size | - Data buffer size |
[in] | key | - AES key to be used |
[in] | key_length | - Length of the key (bits) |
[out] | dec_buffer | - Decrypted buffer |
int decrypt_payload | ( | const uint8_t * | buffer, |
uint16_t | size, | ||
const uint8_t * | key, | ||
uint32_t | key_length, | ||
uint32_t | address, | ||
uint8_t | dir, | ||
uint32_t | seq_counter, | ||
uint8_t * | dec_buffer | ||
) |
Performs payload decryption.
[in] | buffer | - Data buffer |
[in] | size | - Data buffer size |
[in] | key | - AES key to be used |
[in] | key_length | - Length of the key (bits) |
[in] | address | - Frame address |
[in] | dir | - Frame direction [0: uplink, 1: downlink] |
[in] | seq_counter | - Frame sequence counter |
[out] | dec_buffer | - Decrypted buffer |
int encrypt_payload | ( | const uint8_t * | buffer, |
uint16_t | size, | ||
const uint8_t * | key, | ||
uint32_t | key_length, | ||
uint32_t | address, | ||
uint8_t | dir, | ||
uint32_t | seq_counter, | ||
uint8_t * | enc_buffer | ||
) |
Performs payload encryption.
[in] | buffer | - Data buffer |
[in] | size | - Data buffer size |
[in] | key | - AES key to be used |
[in] | key_length | - Length of the key (bits) |
[in] | address | - Frame address |
[in] | dir | - Frame direction [0: uplink, 1: downlink] |
[in] | seq_counter | - Frame sequence counter |
[out] | enc_buffer | - Encrypted buffer |