MYNEWT-687: Reduce encryption scratchpad size on nrf51

The nrf51 only required the maximum encrypted packet length (plus 16)
for its encryption scratchpad register. The code was using the max
PDU length of 251. The nrf51 can only support 27 byte encrypted frames.

X-Original-Commit: e7934fafce21fd27138fd9e15373ce44e30da682
This commit is contained in:
William San Filippo
2017-03-24 14:04:04 -07:00
parent e3833ef145
commit 3d7ef4b5e9
+2 -3
View File
@@ -161,9 +161,8 @@ STATS_NAME_END(ble_phy_stats)
*/
#if (MYNEWT_VAL(BLE_LL_CFG_FEAT_LE_ENCRYPTION) == 1)
/* XXX: test this. only needs 43 bytes. Should just not use the macro for this*/
/* Per nordic, the number of bytes needed for scratch is 16 + MAX_PKT_SIZE */
#define NRF_ENC_SCRATCH_WORDS (((MYNEWT_VAL(BLE_LL_MAX_PKT_SIZE) + 16) + 3) / 4)
/* Per nordic, the number of bytes needed for scratch is 16 + MAX_PKT_SIZE. */
#define NRF_ENC_SCRATCH_WORDS (((NRF_MAX_ENCRYPTED_PYLD_LEN + 16) + 3) / 4)
uint32_t g_nrf_encrypt_scratchpad[NRF_ENC_SCRATCH_WORDS];