NFC-F definitions.
More...
#include "nfcf.hpp"
#include <M5Utility.hpp>
#include <algorithm>
|
| namespace | m5 |
| | Top level namespace of M5Stack.
|
| |
|
| uint16_t | m5::nfc::f::get_maximum_block (const Type t) |
| | Gets the maximum block.
|
| |
| uint16_t | m5::nfc::f::get_number_of_user_blocks (const Type t) |
| | Gets the number of user blocks.
|
| |
| uint16_t | m5::nfc::f::get_first_user_block (const Type t) |
| | Gets the first user area block number.
|
| |
| uint16_t | m5::nfc::f::get_last_user_block (const Type t) |
| | Gets the last user area block number.
|
| |
| uint8_t | m5::nfc::f::get_maximum_read_blocks (const Type t) |
| | Maximum number of blocks that can be read simultaneously.
|
| |
| uint8_t | m5::nfc::f::get_maximum_write_blocks (const Type t) |
| | Maximum number of blocks that can be write simultaneously.
|
| |
| bool | m5::nfc::f::is_read_only_lite (const block_t block) |
| | Is read only block (Permissions are not considered)
|
| |
| bool | m5::nfc::f::is_read_only_lite_s (const block_t block) |
| | Is read only block (Permissions are not considered)
|
| |
| bool | m5::nfc::f::can_read_lite (const block_t block) |
| | Can the value of the specified block be read? (Permissions are not considered)
|
| |
| bool | m5::nfc::f::can_read_lite_s (const block_t block) |
| | Can the value of the specified block be read? (Permissions are not considered)
|
| |
| bool | m5::nfc::f::operator== (const PICC &a, const PICC &b) |
| | Equal? (Only IDm,PMm)
|
| |
|
| bool | m5::nfc::f::make_session_key (uint8_t sk[16], const uint8_t ck[16], const uint8_t rc[16]) |
| | Make session key.
|
| |
| bool | m5::nfc::f::generate_mac (uint8_t mac[8], const uint8_t *plain, uint32_t plain_len, const uint8_t *block_data, uint32_t block_len, const uint8_t sk1[8], const uint8_t sk2[8], const uint8_t rc[16]) |
| | Generate MAC.
|
| |
| bool | m5::nfc::f::make_personalized_card_key_lite_s (uint8_t card_key[16], const uint8_t master_key[24], const uint8_t id_block[16]) |
| | Generate personalized card key for FeliCa Lite-S.
|
| |
◆ can_read_lite()
| bool m5::nfc::f::can_read_lite |
( |
const block_t | block | ) |
|
Can the value of the specified block be read? (Permissions are not considered)
- Parameters
-
- Returns
- True if the FeliCa Lite block can be read
◆ can_read_lite_s()
| bool m5::nfc::f::can_read_lite_s |
( |
const block_t | block | ) |
|
Can the value of the specified block be read? (Permissions are not considered)
- Parameters
-
- Returns
- True if the FeliCa Lite-S block can be read
◆ generate_mac()
| bool m5::nfc::f::generate_mac |
( |
uint8_t | mac[8], |
|
|
const uint8_t * | plain, |
|
|
uint32_t | plain_len, |
|
|
const uint8_t * | block_data, |
|
|
uint32_t | block_len, |
|
|
const uint8_t | sk1[8], |
|
|
const uint8_t | sk2[8], |
|
|
const uint8_t | rc[16] ) |
Generate MAC.
- Parameters
-
| [out] | mac | MAC |
| plain | Plain blocks (If nullptr, do not use) |
| plain_len | Length of plain (If zero, do not use) |
| block_data | Block data |
| block_len | Length of block_data |
| sk1 | Session key 1 |
| sk2 | Session key 2 |
| rc | Random challenge |
- Returns
- True if successful
◆ get_first_user_block()
| uint16_t m5::nfc::f::get_first_user_block |
( |
const Type | t | ) |
|
Gets the first user area block number.
- Parameters
-
- Returns
- First user block number
◆ get_last_user_block()
| uint16_t m5::nfc::f::get_last_user_block |
( |
const Type | t | ) |
|
Gets the last user area block number.
- Parameters
-
- Returns
- Last user block number
◆ get_maximum_block()
| uint16_t m5::nfc::f::get_maximum_block |
( |
const Type | t | ) |
|
Gets the maximum block.
- Parameters
-
- Returns
- Maximum block number
◆ get_maximum_read_blocks()
| uint8_t m5::nfc::f::get_maximum_read_blocks |
( |
const Type | t | ) |
|
Maximum number of blocks that can be read simultaneously.
- Parameters
-
- Returns
- Maximum readable block count
◆ get_maximum_write_blocks()
| uint8_t m5::nfc::f::get_maximum_write_blocks |
( |
const Type | t | ) |
|
Maximum number of blocks that can be write simultaneously.
- Parameters
-
- Returns
- Maximum writable block count
◆ get_number_of_user_blocks()
| uint16_t m5::nfc::f::get_number_of_user_blocks |
( |
const Type | t | ) |
|
Gets the number of user blocks.
- Parameters
-
- Returns
- Number of user blocks
◆ is_read_only_lite()
| bool m5::nfc::f::is_read_only_lite |
( |
const block_t | block | ) |
|
Is read only block (Permissions are not considered)
- Parameters
-
- Returns
- True if the FeliCa Lite block is read-only
◆ is_read_only_lite_s()
| bool m5::nfc::f::is_read_only_lite_s |
( |
const block_t | block | ) |
|
Is read only block (Permissions are not considered)
- Parameters
-
- Returns
- True if the FeliCa Lite-S block is read-only
◆ make_personalized_card_key_lite_s()
| bool m5::nfc::f::make_personalized_card_key_lite_s |
( |
uint8_t | card_key[16], |
|
|
const uint8_t | master_key[24], |
|
|
const uint8_t | id_block[16] ) |
Generate personalized card key for FeliCa Lite-S.
- Parameters
-
| [out] | card_key | Personalized card key (16 bytes) |
| master_key | Personalized master key (24 bytes) |
| id_block | ID block value (16 bytes) |
- Returns
- True if successful
◆ make_session_key()
| bool m5::nfc::f::make_session_key |
( |
uint8_t | sk[16], |
|
|
const uint8_t | ck[16], |
|
|
const uint8_t | rc[16] ) |
Make session key.
- Parameters
-
| [out] | sk | Session key (sk1 8byte + sk2 8byte) |
| ck | Card key |
| rc | Random challenge |
- Returns
- True if successful
◆ operator==()
| bool m5::nfc::f::operator== |
( |
const PICC & | a, |
|
|
const PICC & | b ) |
Equal? (Only IDm,PMm)
- Parameters
-
- Returns
- True if IDm and PMm are equal