|
openaliro
Aliro reader: UWB/CCC core and ESP32-S3/C5/C6 port
|
UWB ranging key schedule + SP0 frame crypto (CONFIG_WOZ_ALIRO). More...
#include <stddef.h>#include <stdint.h>Go to the source code of this file.
Functions | |
| int | crypto_aes_ecb_encrypt (const uint8_t *key, size_t key_bits, const uint8_t in[16], uint8_t out[16]) |
| AES block-cipher seam: one 128-bit ECB block encrypt (out may alias in). | |
| int | ccc_aes_cmac (const uint8_t *key, size_t key_bits, const uint8_t *msg, size_t msg_len, uint8_t tag[CCC_CMAC_TAG_LEN]) |
AES-CMAC over msg (msg may be NULL iff msg_len is 0). | |
| int | ccc_derive_mupsk1 (const uint8_t ursk[CCC_URSK_LEN], uint8_t out[CCC_MUPSK1_LEN]) |
| Derive mUPSK1 — the SP0 Pre-POLL AES-CCM* key. | |
| int | ccc_derive_mupsk2 (const uint8_t ursk[CCC_URSK_LEN], uint8_t out[CCC_MUPSK2_LEN]) |
| Derive mUPSK2 — the seed for the UWB-address KDF. | |
| int | ccc_derive_mursk (const uint8_t ursk[CCC_URSK_LEN], uint8_t out[CCC_MURSK_LEN]) |
| Derive mURSK — the ranging-key seed feeding URSK_KT. | |
| int | ccc_derive_salted_hash (const uint8_t ursk[CCC_URSK_LEN], const uint8_t *ranging_config, size_t rc_len, uint8_t out[CCC_SALTED_HASH_LEN]) |
| Derive SaltedHash from the serialized ranging configuration. | |
| int | ccc_derive_ursk_kt (const uint8_t mursk[CCC_MURSK_LEN], uint32_t sts_index, uint8_t out[CCC_URSK_KT_LEN]) |
| Derive URSK_KT — once per ranging cycle, keyed by the STS index. | |
| int | ccc_derive_dursk (const uint8_t ursk_kt[CCC_URSK_KT_LEN], const uint8_t salted_hash[CCC_SALTED_HASH_LEN], uint8_t out[CCC_DURSK_LEN]) |
| Derive dURSK — per-cycle STS key material. | |
| int | ccc_derive_dudsk (const uint8_t ursk_kt[CCC_URSK_KT_LEN], const uint8_t salted_hash[CCC_SALTED_HASH_LEN], uint8_t out[CCC_DUDSK_LEN]) |
| Derive dUDSK — per-cycle SP0 timestamp-frame key. | |
| int | ccc_derive_sts_v (const uint8_t salted_hash[CCC_SALTED_HASH_LEN], uint32_t sts_index, uint8_t out[CCC_STS_V_LEN]) |
| Derive STS-V (phyHrpUwbStsV) — the per-PPDU STS IV for the DW3000 (out may alias salted_hash). | |
| int | ccc_derive_uad (const uint8_t mupsk2[CCC_MUPSK2_LEN], uint32_t sts_index0, uint8_t out[CCC_UAD_LEN]) |
| Derive UAD — the raw UWB-address derivation output. | |
| int | ccc_uad_addresses (const uint8_t uad[CCC_UAD_LEN], uint8_t keysource[CCC_KEYSOURCE_LEN], uint8_t dest_short_addr[CCC_DEST_SHORT_ADDR_LEN], uint8_t src_long_addr[CCC_SRC_LONG_ADDR_LEN]) |
| Split UAD into the UWB addresses (KeySource, dest short, src long). | |
| int | ccc_sp0_encrypt (const uint8_t key[CCC_MUPSK1_LEN], const uint8_t src_long_addr[CCC_SRC_LONG_ADDR_LEN], uint32_t frame_counter, const uint8_t *mhr, size_t mhr_len, const uint8_t *payload, size_t payload_len, uint8_t *ciphertext_out, uint8_t mic_out[CCC_SP0_MIC_LEN]) |
| Encrypt + authenticate an SP0 data frame (AES-CCM*, ENC-MIC-64). | |
| int | ccc_sp0_decrypt (const uint8_t key[CCC_MUPSK1_LEN], const uint8_t src_long_addr[CCC_SRC_LONG_ADDR_LEN], uint32_t frame_counter, const uint8_t *mhr, size_t mhr_len, const uint8_t *ciphertext, size_t ciphertext_len, const uint8_t mic[CCC_SP0_MIC_LEN], uint8_t *payload_out) |
| Decrypt + verify an SP0 data frame; zeroes plaintext and returns -EBADMSG on MIC failure. | |
UWB ranging key schedule + SP0 frame crypto (CONFIG_WOZ_ALIRO).
Turns the 32-byte URSK into the per-ranging-cycle keys the DW3000 STS engine and the SP0 frames consume, over a single AES block-encrypt primitive.
| int ccc_aes_cmac | ( | const uint8_t * | key, |
| size_t | key_bits, | ||
| const uint8_t * | msg, | ||
| size_t | msg_len, | ||
| uint8_t | tag[CCC_CMAC_TAG_LEN] | ||
| ) |
AES-CMAC over msg (msg may be NULL iff msg_len is 0).
AES-CMAC over msg (msg may be NULL iff msg_len is 0).
| int ccc_derive_dudsk | ( | const uint8_t | ursk_kt[CCC_URSK_KT_LEN], |
| const uint8_t | salted_hash[CCC_SALTED_HASH_LEN], | ||
| uint8_t | out[CCC_DUDSK_LEN] | ||
| ) |
Derive dUDSK — per-cycle SP0 timestamp-frame key.
Derive dUDSK — per-cycle SP0 timestamp-frame key.
| int ccc_derive_dursk | ( | const uint8_t | ursk_kt[CCC_URSK_KT_LEN], |
| const uint8_t | salted_hash[CCC_SALTED_HASH_LEN], | ||
| uint8_t | out[CCC_DURSK_LEN] | ||
| ) |
Derive dURSK — per-cycle STS key material.
Derive dURSK — per-cycle STS key material.
| int ccc_derive_mupsk1 | ( | const uint8_t | ursk[CCC_URSK_LEN], |
| uint8_t | out[CCC_MUPSK1_LEN] | ||
| ) |
Derive mUPSK1 — the SP0 Pre-POLL AES-CCM* key.
Derive mUPSK1 — the SP0 Pre-POLL AES-CCM* key.
| int ccc_derive_mupsk2 | ( | const uint8_t | ursk[CCC_URSK_LEN], |
| uint8_t | out[CCC_MUPSK2_LEN] | ||
| ) |
Derive mUPSK2 — the seed for the UWB-address KDF.
Derive mUPSK2 — the seed for the UWB-address KDF.
| int ccc_derive_mursk | ( | const uint8_t | ursk[CCC_URSK_LEN], |
| uint8_t | out[CCC_MURSK_LEN] | ||
| ) |
Derive mURSK — the ranging-key seed feeding URSK_KT.
Derive mURSK — the ranging-key seed feeding URSK_KT.
| int ccc_derive_sts_v | ( | const uint8_t | salted_hash[CCC_SALTED_HASH_LEN], |
| uint32_t | sts_index, | ||
| uint8_t | out[CCC_STS_V_LEN] | ||
| ) |
Derive STS-V (phyHrpUwbStsV) — the per-PPDU STS IV for the DW3000 (out may alias salted_hash).
Derive STS-V (phyHrpUwbStsV) — the per-PPDU STS IV for the DW3000 (out may alias salted_hash).
| int ccc_derive_uad | ( | const uint8_t | mupsk2[CCC_MUPSK2_LEN], |
| uint32_t | sts_index0, | ||
| uint8_t | out[CCC_UAD_LEN] | ||
| ) |
Derive UAD — the raw UWB-address derivation output.
Derive UAD — the raw UWB-address derivation output.
| int ccc_derive_ursk_kt | ( | const uint8_t | mursk[CCC_MURSK_LEN], |
| uint32_t | sts_index, | ||
| uint8_t | out[CCC_URSK_KT_LEN] | ||
| ) |
Derive URSK_KT — once per ranging cycle, keyed by the STS index.
Derive URSK_KT — once per ranging cycle, keyed by the STS index.
| int ccc_uad_addresses | ( | const uint8_t | uad[CCC_UAD_LEN], |
| uint8_t | keysource[CCC_KEYSOURCE_LEN], | ||
| uint8_t | dest_short_addr[CCC_DEST_SHORT_ADDR_LEN], | ||
| uint8_t | src_long_addr[CCC_SRC_LONG_ADDR_LEN] | ||
| ) |
Split UAD into the UWB addresses (KeySource, dest short, src long).
Split UAD into the UWB addresses (KeySource, dest short, src long).
| int crypto_aes_ecb_encrypt | ( | const uint8_t * | key, |
| size_t | key_bits, | ||
| const uint8_t | in[16], | ||
| uint8_t | out[16] | ||
| ) |
AES block-cipher seam: one 128-bit ECB block encrypt (out may alias in).
AES block-cipher seam: one 128-bit ECB block encrypt (out may alias in).