You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by we...@apache.org on 2017/03/24 23:16:09 UTC

[47/50] [abbrv] incubator-mynewt-core git commit: MYNEWT-687: Reduce encryption scratchpad size on nrf51

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.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/e7934faf
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/e7934faf
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/e7934faf

Branch: refs/heads/nrf_cputime
Commit: e7934fafce21fd27138fd9e15373ce44e30da682
Parents: c6ad1e1
Author: William San Filippo <wi...@runtime.io>
Authored: Fri Mar 24 14:02:31 2017 -0700
Committer: William San Filippo <wi...@runtime.io>
Committed: Fri Mar 24 14:04:04 2017 -0700

----------------------------------------------------------------------
 hw/drivers/nimble/nrf51/src/ble_phy.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/e7934faf/hw/drivers/nimble/nrf51/src/ble_phy.c
----------------------------------------------------------------------
diff --git a/hw/drivers/nimble/nrf51/src/ble_phy.c b/hw/drivers/nimble/nrf51/src/ble_phy.c
index a18e73c..d6ca388 100644
--- a/hw/drivers/nimble/nrf51/src/ble_phy.c
+++ b/hw/drivers/nimble/nrf51/src/ble_phy.c
@@ -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];