Skip to content

Commit

Permalink
tn_aes_128() -> aes_encrypt()
Browse files Browse the repository at this point in the history
  • Loading branch information
pvvx committed Jan 2, 2023
1 parent 8e08ee2 commit 1b9ae32
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Binary file added CGDK2_test.bin
Binary file not shown.
6 changes: 3 additions & 3 deletions src/app_att.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

static const u16 clientCharacterCfgUUID = GATT_UUID_CLIENT_CHAR_CFG; // 2902

static const u16 extReportRefUUID = GATT_UUID_EXT_REPORT_REF;
//static const u16 extReportRefUUID = GATT_UUID_EXT_REPORT_REF; // 2907 External Report Reference

static const u16 reportRefUUID = GATT_UUID_REPORT_REF;
//static const u16 reportRefUUID = GATT_UUID_REPORT_REF; // 2908 Report Reference

static const u16 characterPresentFormatUUID = GATT_UUID_CHAR_PRESENT_FORMAT;
//static const u16 characterPresentFormatUUID = GATT_UUID_CHAR_PRESENT_FORMAT; // 2904 Characteristic Present Format

static const u16 userdesc_UUID = GATT_UUID_CHAR_USER_DESC; // 2901

Expand Down
6 changes: 3 additions & 3 deletions src/ccm.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
#include "tl_common.h"
#if USE_SECURITY_BEACON
#include "ccm.h"
#include "drivers/8258/aes.h"
#include "stack/ble/crypt/aes/aes_att.h"


/*
* Macros for common operations.
* Results in smaller compiled code than static inline functions.
Expand All @@ -47,15 +47,15 @@
#define UPDATE_CBC_MAC \
for (i = 0; i < 16; i++) \
y[i] ^= b[i]; \
tn_aes_128((u8*)key, y, y);
aes_encrypt((u8*)key, y, y);

/*
* Encrypt or decrypt a partial block with CTR
* Warning: using b for temporary storage! src and dst must not be b!
* This avoids allocating one more 16 bytes buffer while allowing src == dst.
*/
#define CTR_CRYPT(dst, src, len) \
tn_aes_128((u8*) key, ctr, b); \
aes_encrypt((u8*) key, ctr, b); \
for (i = 0; i < len; i++) \
dst[i] = src[i] ^ b[i];

Expand Down

0 comments on commit 1b9ae32

Please sign in to comment.