Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CASESession] Factoring Out Sigma2 and Sigma3 Parsing Functions for Improved Testability #36941

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

Alami-Amine
Copy link
Contributor

@Alami-Amine Alami-Amine commented Dec 27, 2024

Overview:

This PR continues the CASESession refactoring efforts to improve testability and robustness, building on:

Key Changes:

1. Refactoring:

  • Factoring out Sigma2 and Sigma3 parsing functions for better modularity and testability.

2. Hardening and Fixes:

  • Added maximum size checks of received NOC and ICAC within decrypted Sigma2 and Sigma3 payloads.
  • Added minimum size checks for TBSData2Signature and TBSData3Signature.
  • Addressing risk of uninitialized memory access: verifying that the read TLV data has the expected number of bytes. Previously, missing checks could result in underfilled buffers, resulting in uninitialized memory used as CASE parameters.
  • Added checks for EndOfContainer TLV elements by ensuring ExitContainer is called after TLV-Reading containers TLV Reading of Containers often missed a call to ExitContainer #36959.
  • Use symbolic names for TLV tags in CASE #10091.

Testing

  • Added Unit Tests for all new methods

…sionParameters as an outparam and does not touch PairingSession class member mRemoteSessionParameters

- a utility SetRemoteSessionParameters to be able to set PairingSession class member mRemoteSessionParameters
Copy link

semanticdiff-com bot commented Dec 27, 2024

Review changes with  SemanticDiff

@Alami-Amine Alami-Amine force-pushed the AA/CASERefactorSigma2 branch from 9351204 to 403d4ee Compare December 27, 2024 19:52
Copy link

github-actions bot commented Dec 27, 2024

PR #36941: Size comparison from 2249628 to 403d4ee

Full report (69 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
platform target config section 2249628 403d4ee change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1354912 1356022 1110 0.1
RAM 104160 104160 0 0.0
bl702 lighting-app bl702+eth FLASH 652134 652736 602 0.1
RAM 25353 25353 0 0.0
bl702+wifi FLASH 829738 830340 602 0.1
RAM 14093 14093 0 0.0
bl706+mfd+rpc+littlefs FLASH 1058210 1058812 602 0.1
RAM 23933 23933 0 0.0
bl702l lighting-app bl702l+mfd+littlefs FLASH 979328 979930 602 0.1
RAM 16596 16596 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 840208 840656 448 0.1
RAM 123696 123696 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 825748 826196 448 0.1
RAM 125584 125584 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 772568 773024 456 0.1
RAM 114060 114060 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 756748 757204 456 0.1
RAM 114260 114260 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 540049 540505 456 0.1
RAM 205800 205800 0 0.0
lock CC3235SF_LAUNCHXL FLASH 574209 574681 472 0.1
RAM 205944 205944 0 0.0
cyw30739 light CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 681745 682209 464 0.1
RAM 78756 78756 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 701597 702061 464 0.1
RAM 81396 81396 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 701597 702061 464 0.1
RAM 81396 81396 0 0.0
CYW930739M2EVB-02 unknown 2040 2040 0 0.0
FLASH 658525 658989 464 0.1
RAM 73824 73824 0 0.0
light-switch CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 618369 618833 464 0.1
RAM 71748 71748 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 637997 638461 464 0.1
RAM 74292 74292 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 637997 638461 464 0.1
RAM 74292 74292 0 0.0
lock CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 637769 638233 464 0.1
RAM 74756 74756 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 657477 657941 464 0.1
RAM 77300 77300 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 657477 657941 464 0.1
RAM 77300 77300 0 0.0
thermostat CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 614389 614853 464 0.1
RAM 68844 68844 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 634241 634697 456 0.1
RAM 71476 71476 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 634241 634697 456 0.1
RAM 71476 71476 0 0.0
efr32 lock-app BRD4187C FLASH 932676 933156 480 0.1
RAM 160228 160228 0 0.0
BRD4338a FLASH 747160 747768 608 0.1
RAM 233356 233356 0 0.0
window-app BRD4187C FLASH 1025592 1026192 600 0.1
RAM 128332 128332 0 0.0
esp32 all-clusters-app c3devkit DRAM 95352 95352 0 0.0
FLASH 1541938 1542492 554 0.0
IRAM 82552 82552 0 0.0
m5stack DRAM 116332 116332 0 0.0
FLASH 1548142 1548590 448 0.0
IRAM 117039 117039 0 0.0
linux air-purifier-app debug unknown 4752 4752 0 0.0
FLASH 2730129 2735343 5214 0.2
RAM 133096 133096 0 0.0
all-clusters-app debug unknown 5560 5560 0 0.0
FLASH 6018718 6023942 5224 0.1
RAM 524024 524024 0 0.0
all-clusters-minimal-app debug unknown 5456 5456 0 0.0
FLASH 5355196 5360388 5192 0.1
RAM 243008 243008 0 0.0
bridge-app debug unknown 5472 5472 0 0.0
FLASH 4703610 4708802 5192 0.1
RAM 221760 221760 0 0.0
chip-tool debug unknown 5992 5992 0 0.0
FLASH 1286854 12873768 5224 0.0
RAM 582650 582650 0 0.0
chip-tool-ipv6only arm64 unknown 21408 21408 0 0.0
FLASH 10997280 11000288 3008 0.0
RAM 633664 633736 72 0.0
fabric-admin debug unknown 5816 5816 0 0.0
FLASH 11274255 11279479 5224 0.0
RAM 582994 582994 0 0.0
fabric-bridge-app debug unknown 4728 4728 0 0.0
FLASH 4528844 4534068 5224 0.1
RAM 208880 208880 0 0.0
fabric-sync debug unknown 4968 4968 0 0.0
FLASH 5639429 5644629 5200 0.1
RAM 475912 475912 0 0.0
lighting-app debug+rpc+ui unknown 6136 6136 0 0.0
FLASH 5639393 5644593 5200 0.1
RAM 232008 232008 0 0.0
lock-app debug unknown 5408 5408 0 0.0
FLASH 4751978 4757202 5224 0.1
RAM 208008 208008 0 0.0
ota-provider-app debug unknown 4768 4768 0 0.0
FLASH 4378604 4383826 5222 0.1
RAM 201696 201696 0 0.0
ota-requestor-app debug unknown 4720 4720 0 0.0
FLASH 4517512 4522734 5222 0.1
RAM 206280 206280 0 0.0
shell debug unknown 4248 4248 0 0.0
FLASH 3036685 3041901 5216 0.2
RAM 160736 160736 0 0.0
thermostat-no-ble arm64 unknown 9584 9584 0 0.0
FLASH 4118952 4121960 3008 0.1
RAM 246296 246368 72 0.0
tv-app debug unknown 5736 5736 0 0.0
FLASH 5988677 5993909 5232 0.1
RAM 599344 599344 0 0.0
tv-casting-app debug unknown 5320 5320 0 0.0
FLASH 11094605 11099805 5200 0.0
RAM 695608 695608 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 918100 918580 480 0.1
RAM 143332 143332 0 0.0
nrf7002dk_nrf5340_cpuapp FLASH 890592 890996 404 0.0
RAM 141519 141519 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 FLASH 852164 852644 480 0.1
RAM 142244 142244 0 0.0
nxp contact k32w0+release FLASH 585952 586448 496 0.1
RAM 71112 71112 0 0.0
mcxw71+release FLASH 600512 600968 456 0.1
RAM 63208 63208 0 0.0
light k32w0+release FLASH 612700 613196 496 0.1
RAM 70504 70504 0 0.0
k32w1+release FLASH 686920 687368 448 0.1
RAM 48840 48840 0 0.0
lock mcxw71+release FLASH 763264 763720 456 0.1
RAM 70876 70876 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1647500 1648108 608 0.0
RAM 212128 212128 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1555132 1555748 616 0.0
RAM 208944 208944 0 0.0
light cy8ckit_062s2_43012 FLASH 1470236 1470852 616 0.0
RAM 200912 200912 0 0.0
lock cy8ckit_062s2_43012 FLASH 1467956 1468572 616 0.0
RAM 225272 225272 0 0.0
qpg lighting-app qpg6105+debug FLASH 664328 664808 480 0.1
RAM 105456 105456 0 0.0
lock-app qpg6105+debug FLASH 622156 622644 488 0.1
RAM 99908 99908 0 0.0
stm32 light STM32WB5MM-DK FLASH 485072 485560 488 0.1
RAM 144912 144912 0 0.0
telink bridge-app tlsr9258a FLASH 683634 684210 576 0.1
RAM 91248 91248 0 0.0
contact-sensor-app tlsr9528a_retention FLASH 623874 624450 576 0.1
RAM 31488 31488 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 772784 773362 578 0.1
RAM 49348 49348 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 711316 711892 576 0.1
RAM 73544 73544 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 628320 628896 576 0.1
RAM 142180 142180 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 814338 814914 576 0.1
RAM 99724 99724 0 0.0
tizen all-clusters-app arm unknown 5160 5160 0 0.0
FLASH 1780976 1782824 1848 0.1
RAM 93684 93684 0 0.0
chip-tool-ubsan arm unknown 10848 10848 0 0.0
FLASH 18003486 18012582 9096 0.1
RAM 7858000 7862488 4488 0.1

Copy link

github-actions bot commented Dec 29, 2024

PR #36941: Size comparison from 2249628 to ea053d8

Increases above 0.2%:

platform target config section 2249628 ea053d86 change % change
linux air-purifier-app debug FLASH 2730129 2735735 5606 0.2
Full report (69 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
platform target config section 2249628 ea053d86 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1354912 1356128 1216 0.1
RAM 104160 104160 0 0.0
bl702 lighting-app bl702+eth FLASH 652134 652782 648 0.1
RAM 25353 25353 0 0.0
bl702+wifi FLASH 829738 830386 648 0.1
RAM 14093 14093 0 0.0
bl706+mfd+rpc+littlefs FLASH 1058210 1058858 648 0.1
RAM 23933 23933 0 0.0
bl702l lighting-app bl702l+mfd+littlefs FLASH 979328 979976 648 0.1
RAM 16596 16596 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 840208 840704 496 0.1
RAM 123696 123696 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 825748 826236 488 0.1
RAM 125584 125584 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 772568 773064 496 0.1
RAM 114060 114060 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 756748 757252 504 0.1
RAM 114260 114260 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 540049 540545 496 0.1
RAM 205800 205800 0 0.0
lock CC3235SF_LAUNCHXL FLASH 574209 574721 512 0.1
RAM 205944 205944 0 0.0
cyw30739 light CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 681745 682249 504 0.1
RAM 78756 78756 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 701597 702101 504 0.1
RAM 81396 81396 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 701597 702101 504 0.1
RAM 81396 81396 0 0.0
CYW930739M2EVB-02 unknown 2040 2040 0 0.0
FLASH 658525 659029 504 0.1
RAM 73824 73824 0 0.0
light-switch CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 618369 618873 504 0.1
RAM 71748 71748 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 637997 638501 504 0.1
RAM 74292 74292 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 637997 638501 504 0.1
RAM 74292 74292 0 0.0
lock CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 637769 638273 504 0.1
RAM 74756 74756 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 657477 657981 504 0.1
RAM 77300 77300 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 657477 657981 504 0.1
RAM 77300 77300 0 0.0
thermostat CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 614389 614893 504 0.1
RAM 68844 68844 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 634241 634737 496 0.1
RAM 71476 71476 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 634241 634737 496 0.1
RAM 71476 71476 0 0.0
efr32 lock-app BRD4187C FLASH 932676 933188 512 0.1
RAM 160228 160228 0 0.0
BRD4338a FLASH 747160 747816 656 0.1
RAM 233356 233356 0 0.0
window-app BRD4187C FLASH 1025592 1026256 664 0.1
RAM 128332 128332 0 0.0
esp32 all-clusters-app c3devkit DRAM 95352 95352 0 0.0
FLASH 1541938 1542538 600 0.0
IRAM 82552 82552 0 0.0
m5stack DRAM 116332 116332 0 0.0
FLASH 1548142 1548646 504 0.0
IRAM 117039 117039 0 0.0
linux air-purifier-app debug unknown 4752 4752 0 0.0
FLASH 2730129 2735735 5606 0.2
RAM 133096 133096 0 0.0
all-clusters-app debug unknown 5560 5560 0 0.0
FLASH 6018718 6024334 5616 0.1
RAM 524024 524024 0 0.0
all-clusters-minimal-app debug unknown 5456 5456 0 0.0
FLASH 5355196 5360780 5584 0.1
RAM 243008 243008 0 0.0
bridge-app debug unknown 5472 5472 0 0.0
FLASH 4703610 4709194 5584 0.1
RAM 221760 221760 0 0.0
chip-tool debug unknown 5992 5992 0 0.0
FLASH 1286854 12874160 5616 0.0
RAM 582650 582650 0 0.0
chip-tool-ipv6only arm64 unknown 21408 21408 0 0.0
FLASH 10997280 11000624 3344 0.0
RAM 633664 633736 72 0.0
fabric-admin debug unknown 5816 5816 0 0.0
FLASH 11274255 11279871 5616 0.0
RAM 582994 582994 0 0.0
fabric-bridge-app debug unknown 4728 4728 0 0.0
FLASH 4528844 4534460 5616 0.1
RAM 208880 208880 0 0.0
fabric-sync debug unknown 4968 4968 0 0.0
FLASH 5639429 5645013 5584 0.1
RAM 475912 475912 0 0.0
lighting-app debug+rpc+ui unknown 6136 6136 0 0.0
FLASH 5639393 5644977 5584 0.1
RAM 232008 232008 0 0.0
lock-app debug unknown 5408 5408 0 0.0
FLASH 4751978 4757594 5616 0.1
RAM 208008 208008 0 0.0
ota-provider-app debug unknown 4768 4768 0 0.0
FLASH 4378604 4384218 5614 0.1
RAM 201696 201696 0 0.0
ota-requestor-app debug unknown 4720 4720 0 0.0
FLASH 4517512 4523126 5614 0.1
RAM 206280 206280 0 0.0
shell debug unknown 4248 4248 0 0.0
FLASH 3036685 3042285 5600 0.2
RAM 160736 160736 0 0.0
thermostat-no-ble arm64 unknown 9584 9584 0 0.0
FLASH 4118952 4122296 3344 0.1
RAM 246296 246368 72 0.0
tv-app debug unknown 5736 5736 0 0.0
FLASH 5988677 5994309 5632 0.1
RAM 599344 599344 0 0.0
tv-casting-app debug unknown 5320 5320 0 0.0
FLASH 11094605 11100189 5584 0.1
RAM 695608 695608 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 918100 918620 520 0.1
RAM 143332 143332 0 0.0
nrf7002dk_nrf5340_cpuapp FLASH 890592 891204 612 0.1
RAM 141519 141519 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 FLASH 852164 852684 520 0.1
RAM 142244 142244 0 0.0
nxp contact k32w0+release FLASH 585952 586480 528 0.1
RAM 71112 71112 0 0.0
mcxw71+release FLASH 600512 601008 496 0.1
RAM 63208 63208 0 0.0
light k32w0+release FLASH 612700 613228 528 0.1
RAM 70504 70504 0 0.0
k32w1+release FLASH 686920 687408 488 0.1
RAM 48840 48840 0 0.0
lock mcxw71+release FLASH 763264 763760 496 0.1
RAM 70876 70876 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1647500 1648172 672 0.0
RAM 212128 212128 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1555132 1555796 664 0.0
RAM 208944 208944 0 0.0
light cy8ckit_062s2_43012 FLASH 1470236 1470900 664 0.0
RAM 200912 200912 0 0.0
lock cy8ckit_062s2_43012 FLASH 1467956 1468620 664 0.0
RAM 225272 225272 0 0.0
qpg lighting-app qpg6105+debug FLASH 664328 664848 520 0.1
RAM 105456 105456 0 0.0
lock-app qpg6105+debug FLASH 622156 622684 528 0.1
RAM 99908 99908 0 0.0
stm32 light STM32WB5MM-DK FLASH 485072 485600 528 0.1
RAM 144912 144912 0 0.0
telink bridge-app tlsr9258a FLASH 683634 684256 622 0.1
RAM 91248 91248 0 0.0
contact-sensor-app tlsr9528a_retention FLASH 623874 624496 622 0.1
RAM 31488 31488 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 772784 773408 624 0.1
RAM 49348 49348 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 711316 711938 622 0.1
RAM 73544 73544 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 628320 628942 622 0.1
RAM 142180 142180 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 814338 814960 622 0.1
RAM 99724 99724 0 0.0
tizen all-clusters-app arm unknown 5160 5160 0 0.0
FLASH 1780976 1783016 2040 0.1
RAM 93684 93684 0 0.0
chip-tool-ubsan arm unknown 10848 10848 0 0.0
FLASH 18003486 18013254 9768 0.1
RAM 7858000 7862752 4752 0.1

@Alami-Amine Alami-Amine force-pushed the AA/CASERefactorSigma2 branch from ea053d8 to cc77e8c Compare December 30, 2024 19:05
Copy link

github-actions bot commented Dec 30, 2024

PR #36941: Size comparison from 2249628 to cc77e8c

Increases above 0.2%:

platform target config section 2249628 cc77e8c change % change
linux air-purifier-app debug FLASH 2730129 2736317 6188 0.2
shell debug FLASH 3036685 3042861 6176 0.2
Full report (69 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
platform target config section 2249628 cc77e8c change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1354912 1356552 1640 0.1
RAM 104160 104160 0 0.0
bl702 lighting-app bl702+eth FLASH 652134 652858 724 0.1
RAM 25353 25353 0 0.0
bl702+wifi FLASH 829738 830462 724 0.1
RAM 14093 14093 0 0.0
bl706+mfd+rpc+littlefs FLASH 1058210 1058934 724 0.1
RAM 23933 23933 0 0.0
bl702l lighting-app bl702l+mfd+littlefs FLASH 979328 980052 724 0.1
RAM 16596 16596 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 840208 840760 552 0.1
RAM 123696 123696 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 825748 826292 544 0.1
RAM 125584 125584 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 772568 773120 552 0.1
RAM 114060 114060 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 756748 757308 560 0.1
RAM 114260 114260 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 540049 540617 568 0.1
RAM 205800 205800 0 0.0
lock CC3235SF_LAUNCHXL FLASH 574209 574785 576 0.1
RAM 205944 205944 0 0.0
cyw30739 light CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 681745 682313 568 0.1
RAM 78756 78756 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 701597 702165 568 0.1
RAM 81396 81396 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 701597 702165 568 0.1
RAM 81396 81396 0 0.0
CYW930739M2EVB-02 unknown 2040 2040 0 0.0
FLASH 658525 659093 568 0.1
RAM 73824 73824 0 0.0
light-switch CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 618369 618945 576 0.1
RAM 71748 71748 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 637997 638573 576 0.1
RAM 74292 74292 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 637997 638573 576 0.1
RAM 74292 74292 0 0.0
lock CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 637769 638345 576 0.1
RAM 74756 74756 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 657477 658053 576 0.1
RAM 77300 77300 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 657477 658053 576 0.1
RAM 77300 77300 0 0.0
thermostat CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 614389 614965 576 0.1
RAM 68844 68844 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 634241 634809 568 0.1
RAM 71476 71476 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 634241 634809 568 0.1
RAM 71476 71476 0 0.0
efr32 lock-app BRD4187C FLASH 932676 933252 576 0.1
RAM 160228 160228 0 0.0
BRD4338a FLASH 747160 747912 752 0.1
RAM 233356 233356 0 0.0
window-app BRD4187C FLASH 1025592 1026352 760 0.1
RAM 128332 128332 0 0.0
esp32 all-clusters-app c3devkit DRAM 95352 95352 0 0.0
FLASH 1541938 1542638 700 0.0
IRAM 82552 82552 0 0.0
m5stack DRAM 116332 116332 0 0.0
FLASH 1548142 1548690 548 0.0
IRAM 117039 117039 0 0.0
linux air-purifier-app debug unknown 4752 4752 0 0.0
FLASH 2730129 2736317 6188 0.2
RAM 133096 133096 0 0.0
all-clusters-app debug unknown 5560 5560 0 0.0
FLASH 6018718 6024902 6184 0.1
RAM 524024 524024 0 0.0
all-clusters-minimal-app debug unknown 5456 5456 0 0.0
FLASH 5355196 5361348 6152 0.1
RAM 243008 243008 0 0.0
bridge-app debug unknown 5472 5472 0 0.0
FLASH 4703610 4709762 6152 0.1
RAM 221760 221760 0 0.0
chip-tool debug unknown 5992 5992 0 0.0
FLASH 1286854 12874728 6184 0.0
RAM 582650 582650 0 0.0
chip-tool-ipv6only arm64 unknown 21408 21408 0 0.0
FLASH 10997280 11000704 3424 0.0
RAM 633664 633760 96 0.0
fabric-admin debug unknown 5816 5816 0 0.0
FLASH 11274255 1128043 6184 0.1
RAM 582994 582994 0 0.0
fabric-bridge-app debug unknown 4728 4728 0 0.0
FLASH 4528844 4535028 6184 0.1
RAM 208880 208880 0 0.0
fabric-sync debug unknown 4968 4968 0 0.0
FLASH 5639429 5645589 6160 0.1
RAM 475912 475912 0 0.0
lighting-app debug+rpc+ui unknown 6136 6136 0 0.0
FLASH 5639393 5645553 6160 0.1
RAM 232008 232008 0 0.0
lock-app debug unknown 5408 5408 0 0.0
FLASH 4751978 4758162 6184 0.1
RAM 208008 208008 0 0.0
ota-provider-app debug unknown 4768 4768 0 0.0
FLASH 4378604 4384786 6182 0.1
RAM 201696 201696 0 0.0
ota-requestor-app debug unknown 4720 4720 0 0.0
FLASH 4517512 4523694 6182 0.1
RAM 206280 206280 0 0.0
shell debug unknown 4248 4248 0 0.0
FLASH 3036685 3042861 6176 0.2
RAM 160736 160736 0 0.0
thermostat-no-ble arm64 unknown 9584 9584 0 0.0
FLASH 4118952 4122376 3424 0.1
RAM 246296 246392 96 0.0
tv-app debug unknown 5736 5736 0 0.0
FLASH 5988677 5994869 6192 0.1
RAM 599344 599344 0 0.0
tv-casting-app debug unknown 5320 5320 0 0.0
FLASH 11094605 11100765 6160 0.1
RAM 695608 695608 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 918100 918680 580 0.1
RAM 143332 143332 0 0.0
nrf7002dk_nrf5340_cpuapp FLASH 890592 891300 708 0.1
RAM 141519 141519 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 FLASH 852164 852744 580 0.1
RAM 142244 142244 0 0.0
nxp contact k32w0+release FLASH 585952 586544 592 0.1
RAM 71112 71112 0 0.0
mcxw71+release FLASH 600512 601064 552 0.1
RAM 63208 63208 0 0.0
light k32w0+release FLASH 612700 613292 592 0.1
RAM 70504 70504 0 0.0
k32w1+release FLASH 686920 687464 544 0.1
RAM 48840 48840 0 0.0
lock mcxw71+release FLASH 763264 763816 552 0.1
RAM 70876 70876 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1647500 1648252 752 0.0
RAM 212128 212128 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1555132 1555876 744 0.0
RAM 208944 208944 0 0.0
light cy8ckit_062s2_43012 FLASH 1470236 1470980 744 0.1
RAM 200912 200912 0 0.0
lock cy8ckit_062s2_43012 FLASH 1467956 1468716 760 0.1
RAM 225272 225272 0 0.0
qpg lighting-app qpg6105+debug FLASH 664328 664912 584 0.1
RAM 105456 105456 0 0.0
lock-app qpg6105+debug FLASH 622156 622740 584 0.1
RAM 99908 99908 0 0.0
stm32 light STM32WB5MM-DK FLASH 485072 485656 584 0.1
RAM 144912 144912 0 0.0
telink bridge-app tlsr9258a FLASH 683634 684350 716 0.1
RAM 91248 91248 0 0.0
contact-sensor-app tlsr9528a_retention FLASH 623874 624590 716 0.1
RAM 31488 31488 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 772784 773502 718 0.1
RAM 49348 49348 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 711316 712032 716 0.1
RAM 73544 73544 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 628320 629036 716 0.1
RAM 142180 142180 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 814338 815054 716 0.1
RAM 99724 99724 0 0.0
tizen all-clusters-app arm unknown 5160 5160 0 0.0
FLASH 1780976 1783164 2188 0.1
RAM 93684 93684 0 0.0
chip-tool-ubsan arm unknown 10848 10848 0 0.0
FLASH 18003486 18014622 11136 0.1
RAM 7858000 7863740 5740 0.1

@mergify mergify bot added the conflict label Jan 11, 2025
@Alami-Amine Alami-Amine force-pushed the AA/CASERefactorSigma2 branch from df9a3e8 to 5c9281b Compare January 11, 2025 18:45
@mergify mergify bot removed the conflict label Jan 11, 2025
@Alami-Amine Alami-Amine force-pushed the AA/CASERefactorSigma2 branch from 0fe56e3 to 1a6f27b Compare January 11, 2025 19:05
Copy link

github-actions bot commented Jan 11, 2025

PR #36941: Size comparison from d5e9829 to 1a6f27b

Full report (70 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
platform target config section d5e9829 1a6f27b change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1355350 1356120 770 0.1
RAM 103952 103952 0 0.0
bl702 lighting-app bl702+eth FLASH 726034 726316 282 0.0
RAM 25353 25353 0 0.0
bl702+wifi FLASH 912904 913186 282 0.0
RAM 14093 14093 0 0.0
bl706+mfd+rpc+littlefs FLASH 1173762 1174044 282 0.0
RAM 23933 23933 0 0.0
bl702l lighting-app bl702l+mfd+littlefs FLASH 1082790 1083072 282 0.0
RAM 16604 16604 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 840224 840320 96 0.0
RAM 123552 123552 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 825724 825820 96 0.0
RAM 125440 125440 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 772620 772708 88 0.0
RAM 113916 113916 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 756816 756904 88 0.0
RAM 114116 114116 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 540041 540177 136 0.0
RAM 205304 205304 0 0.0
lock CC3235SF_LAUNCHXL FLASH 574209 574345 136 0.0
RAM 205448 205448 0 0.0
cyw30739 light CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 681601 681737 136 0.0
RAM 78596 78596 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 701453 701589 136 0.0
RAM 81236 81236 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 701453 701589 136 0.0
RAM 81236 81236 0 0.0
CYW930739M2EVB-02 unknown 2040 2040 0 0.0
FLASH 658389 658525 136 0.0
RAM 73664 73664 0 0.0
light-switch CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 618153 618289 136 0.0
RAM 71588 71588 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 637789 637925 136 0.0
RAM 74132 74132 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 637789 637925 136 0.0
RAM 74132 74132 0 0.0
lock CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 637601 637737 136 0.0
RAM 74596 74596 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 657317 657453 136 0.0
RAM 77140 77140 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 657317 657453 136 0.0
RAM 77140 77140 0 0.0
thermostat CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 614213 614341 128 0.0
RAM 68684 68684 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 634065 634193 128 0.0
RAM 71316 71316 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 634065 634193 128 0.0
RAM 71316 71316 0 0.0
efr32 lock-app BRD4187C FLASH 932500 932660 160 0.0
RAM 160068 160068 0 0.0
BRD4338a FLASH 749232 749488 256 0.0
RAM 233196 233196 0 0.0
window-app BRD4187C FLASH 1026896 1027136 240 0.0
RAM 128172 128172 0 0.0
esp32 all-clusters-app c3devkit DRAM 95192 95192 0 0.0
FLASH 1541904 1542260 356 0.0
IRAM 82552 82552 0 0.0
m5stack DRAM 116172 116172 0 0.0
FLASH 1548458 1548526 68 0.0
IRAM 117039 117039 0 0.0
linux air-purifier-app debug unknown 4752 4752 0 0.0
FLASH 2723229 2724053 824 0.0
2723229 2724053 824 0.0
RAM 133160 133160 0 0.0
all-clusters-app debug unknown 5560 5560 0 0.0
FLASH 5996466 5997260 794 0.0
5996466 5997260 794 0.0
RAM 526072 526072 0 0.0
all-clusters-minimal-app debug unknown 5456 5456 0 0.0
FLASH 5341652 5342446 794 0.0
5341652 5342446 794 0.0
RAM 243072 243072 0 0.0
bridge-app debug unknown 5472 5472 0 0.0
FLASH 4696806 4697600 794 0.0
4696806 4697600 794 0.0
RAM 221824 221824 0 0.0
chip-tool debug unknown 5984 5984 0 0.0
FLASH 12867152 12867978 826 0.0
12867152 12867978 826 0.0
RAM 587002 587002 0 0.0
chip-tool-ipv6only arm64 unknown 21536 21536 0 0.0
FLASH 10989440 10988176 -1264 -0.0
RAM 638048 638000 -48 -0.0
fabric-admin debug unknown 5808 5808 0 0.0
FLASH 11274263 11275089 826 0.0
11274263 11275089 826 0.0
RAM 587346 587346 0 0.0
fabric-bridge-app debug unknown 4728 4728 0 0.0
FLASH 4521756 4522582 826 0.0
4521756 4522582 826 0.0
RAM 208928 208928 0 0.0
fabric-sync debug unknown 4968 4968 0 0.0
FLASH 5622981 5623781 800 0.0
5622981 5623781 800 0.0
RAM 477880 477880 0 0.0
lighting-app debug+rpc+ui unknown 6136 6136 0 0.0
FLASH 5631329 5632129 800 0.0
5631329 5632129 800 0.0
RAM 232072 232072 0 0.0
lock-app debug unknown 5408 5408 0 0.0
FLASH 4744568 4745394 826 0.0
4744568 4745394 826 0.0
RAM 208072 208072 0 0.0
ota-provider-app debug unknown 4768 4768 0 0.0
FLASH 4372108 4372934 826 0.0
4372108 4372934 826 0.0
RAM 201744 201744 0 0.0
ota-requestor-app debug unknown 4720 4720 0 0.0
FLASH 4510120 4510946 826 0.0
4510120 4510946 826 0.0
RAM 206312 206312 0 0.0
shell debug unknown 4248 4248 0 0.0
FLASH 3023197 3024029 832 0.0
3023197 3024029 832 0.0
RAM 160792 160792 0 0.0
thermostat-no-ble arm64 unknown 9552 9552 0 0.0
FLASH 4110296 4109016 -1280 -0.0
RAM 246368 246320 -48 -0.0
tv-app debug unknown 5736 5736 0 0.0
FLASH 5966741 5967573 832 0.0
5966741 5967573 832 0.0
RAM 601312 601312 0 0.0
tv-casting-app debug unknown 5312 5312 0 0.0
FLASH 11102349 11103133 784 0.0
11102349 11103133 784 0.0
RAM 700496 700496 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 917804 917960 156 0.0
RAM 143172 143172 0 0.0
nrf7002dk_nrf5340_cpuapp FLASH 890868 891036 168 0.0
RAM 141359 141359 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 FLASH 851932 852088 156 0.0
RAM 142084 142084 0 0.0
nxp contact k32w0+release FLASH 585968 586112 144 0.0
RAM 70952 70952 0 0.0
mcxw71+release FLASH 601488 601584 96 0.0
RAM 63168 63168 0 0.0
light k32w0+release FLASH 612588 612748 160 0.0
RAM 70344 70344 0 0.0
k32w1+release FLASH 687184 687272 88 0.0
RAM 48760 48760 0 0.0
lock mcxw71+release FLASH 763456 763552 96 0.0
RAM 70796 70796 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1652124 1652396 272 0.0
RAM 211632 211632 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1557884 1558164 280 0.0
RAM 208448 208448 0 0.0
light cy8ckit_062s2_43012 FLASH 1472492 1472756 264 0.0
RAM 200416 200416 0 0.0
lock cy8ckit_062s2_43012 FLASH 1470276 1470540 264 0.0
RAM 224768 224768 0 0.0
qpg lighting-app qpg6105+debug FLASH 664176 664320 144 0.0
RAM 105296 105296 0 0.0
lock-app qpg6105+debug FLASH 622004 622148 144 0.0
RAM 99748 99748 0 0.0
stm32 light STM32WB5MM-DK FLASH 484976 485112 136 0.0
RAM 144752 144752 0 0.0
telink bridge-app tlsr9258a FLASH 683564 683914 350 0.1
RAM 91088 91088 0 0.0
contact-sensor-app tlsr9528a_retention FLASH 623810 624160 350 0.1
RAM 31488 31488 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 772664 773016 352 0.0
RAM 49348 49348 0 0.0
light-app-ota-shell-factory-data tl7218x FLASH 777268 777618 350 0.0
RAM 99652 99652 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 711250 711600 350 0.0
RAM 73384 73384 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 628264 628614 350 0.1
RAM 142020 142020 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 814278 814628 350 0.0
RAM 99564 99564 0 0.0
tizen all-clusters-app arm unknown 5120 5120 0 0.0
FLASH 1767272 1768008 736 0.0
RAM 93708 93708 0 0.0
chip-tool-ubsan arm unknown 10904 10904 0 0.0
FLASH 17949774 17949862 88 0.0
RAM 7842672 7842880 208 0.0


if (data.keystore != nullptr)
{
SuccessOrExit(err = helper->ScheduleWork());
ReturnErrorOnFailure(helper->ScheduleWork());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is async and will swithc context. It is certain that there is nothing here that will be out of scope later?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not change the scope of any of the decoded elements, so it should be fine.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well that assumes it was fine before... Do we run the unit tests with asan?


SuccessOrExit(err = ConstructTBSData(data.initiatorNOC, data.initiatorICAC, ByteSpan(mRemotePubKey, mRemotePubKey.Length()),
ByteSpan(mEphemeralKey->Pubkey(), mEphemeralKey->Pubkey().Length()),
data.msg_R3_Signed.Get(), data.msg_r3_signed_len));
data.msgR3Signed.Get(), data.msgR3SignedLen));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we passed a mutable span instead to the ConstructTBSData, then it may be clearer that it's a max length in msgR3SignedLen?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean I should modify ConstructTBSData to take a MutableByteSpan instead of a Pointer + length? that would require more changes in the other parts of the code, it might be better to do it as a follow up.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, we can do a follow-up.

@@ -2018,6 +2006,71 @@ CHIP_ERROR CASESession::HandleSigma3a(System::PacketBufferHandle && msg)
return err;
}

CHIP_ERROR CASESession::ParseSigma3(ContiguousBufferTLVReader & tlvReader,
Platform::ScopedMemoryBufferWithSize<uint8_t> & msgR3Encrypted)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest passing a MutableByteSpan. The fact that we are mutating the payload to decrypt in place was never really stated, but it's actually what's happening.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, it looks like even the alloc is done by this method on the provided msgR3Encrypted. Suggest calling it outMsgR3Encrypted.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added comments to the method in the header file, as well as during instantiation of parameters passed to it
I made it like:

CHIP_ERROR CASESession::ParseSigma3(ContiguousBufferTLVReader & tlvReader,
                                    Platform::ScopedMemoryBufferWithSize<uint8_t> & outMsgR3Encrypted,
                                    MutableByteSpan & outMsgR3EncryptedPayload, ByteSpan & outMsgR3Mic)

@Alami-Amine Alami-Amine force-pushed the AA/CASERefactorSigma2 branch 2 times, most recently from 4c0fd48 to a68f2c0 Compare January 14, 2025 18:56
Copy link

github-actions bot commented Jan 14, 2025

PR #36941: Size comparison from 8a0fc4d to a68f2c0

Full report (71 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
platform target config section 8a0fc4d a68f2c0 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1094560 1095006 446 0.0
RAM 103346 103346 0 0.0
bl702 lighting-app bl702+eth FLASH 652366 652812 446 0.1
RAM 25353 25353 0 0.0
bl702+wifi FLASH 830546 830992 446 0.1
RAM 14093 14093 0 0.0
bl706+mfd+rpc+littlefs FLASH 1057832 1058278 446 0.0
RAM 23949 23949 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 890856 891302 446 0.1
RAM 18624 18624 0 0.0
lighting-app bl702l+mfd+littlefs FLASH 973816 974262 446 0.0
RAM 16472 16472 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 840176 840344 168 0.0
RAM 123552 123552 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 825692 825852 160 0.0
RAM 125440 125440 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 772620 772780 160 0.0
RAM 113916 113916 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 756816 756976 160 0.0
RAM 114116 114116 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 540041 540233 192 0.0
RAM 205304 205304 0 0.0
lock CC3235SF_LAUNCHXL FLASH 574209 574409 200 0.0
RAM 205448 205448 0 0.0
cyw30739 light CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 681569 681753 184 0.0
RAM 78596 78596 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 701413 701597 184 0.0
RAM 81236 81236 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 701413 701597 184 0.0
RAM 81236 81236 0 0.0
CYW930739M2EVB-02 unknown 2040 2040 0 0.0
FLASH 658357 658541 184 0.0
RAM 73664 73664 0 0.0
light-switch CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 618153 618345 192 0.0
RAM 71588 71588 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 637789 637981 192 0.0
RAM 74132 74132 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 637789 637981 192 0.0
RAM 74132 74132 0 0.0
lock CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 637601 637793 192 0.0
RAM 74596 74596 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 657317 657509 192 0.0
RAM 77140 77140 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 657317 657509 192 0.0
RAM 77140 77140 0 0.0
thermostat CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 614213 614397 184 0.0
RAM 68684 68684 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 634065 634249 184 0.0
RAM 71316 71316 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 634065 634249 184 0.0
RAM 71316 71316 0 0.0
efr32 lock-app BRD4187C FLASH 932468 932692 224 0.0
RAM 160068 160068 0 0.0
BRD4338a FLASH 749232 749664 432 0.1
RAM 233196 233196 0 0.0
window-app BRD4187C FLASH 1026864 1027296 432 0.0
RAM 128172 128172 0 0.0
esp32 all-clusters-app c3devkit DRAM 95192 95192 0 0.0
FLASH 1541904 1542400 496 0.0
IRAM 82552 82552 0 0.0
m5stack DRAM 116172 116172 0 0.0
FLASH 1548458 1548646 188 0.0
IRAM 117039 117039 0 0.0
linux air-purifier-app debug unknown 4752 4752 0 0.0
FLASH 2723229 2724531 1302 0.0
RAM 133160 133160 0 0.0
all-clusters-app debug unknown 5560 5560 0 0.0
FLASH 5996466 5997726 1260 0.0
RAM 526072 526072 0 0.0
all-clusters-minimal-app debug unknown 5456 5456 0 0.0
FLASH 5341652 5342912 1260 0.0
RAM 243072 243072 0 0.0
bridge-app debug unknown 5472 5472 0 0.0
FLASH 4696806 4698066 1260 0.0
RAM 221824 221824 0 0.0
chip-tool debug unknown 5984 5984 0 0.0
FLASH 12867152 12868446 1294 0.0
RAM 587002 587002 0 0.0
chip-tool-ipv6only arm64 unknown 21536 21536 0 0.0
FLASH 10989440 10988784 -656 -0.0
RAM 638048 638000 -48 -0.0
fabric-admin debug unknown 5808 5808 0 0.0
FLASH 11274263 11275557 1294 0.0
RAM 587346 587346 0 0.0
fabric-bridge-app debug unknown 4728 4728 0 0.0
FLASH 4521756 4523048 1292 0.0
RAM 208928 208928 0 0.0
fabric-sync debug unknown 4968 4968 0 0.0
FLASH 5622981 5624245 1264 0.0
RAM 477880 477880 0 0.0
lighting-app debug+rpc+ui unknown 6136 6136 0 0.0
FLASH 5631329 5632593 1264 0.0
RAM 232072 232072 0 0.0
lock-app debug unknown 5408 5408 0 0.0
FLASH 4744568 4745860 1292 0.0
RAM 208072 208072 0 0.0
ota-provider-app debug unknown 4768 4768 0 0.0
FLASH 4372108 4373400 1292 0.0
RAM 201744 201744 0 0.0
ota-requestor-app debug unknown 4720 4720 0 0.0
FLASH 4510120 4511412 1292 0.0
RAM 206312 206312 0 0.0
shell debug unknown 4248 4248 0 0.0
FLASH 3023197 3024509 1312 0.0
RAM 160792 160792 0 0.0
thermostat-no-ble arm64 unknown 9552 9552 0 0.0
FLASH 4110296 4109640 -656 -0.0
RAM 246368 246320 -48 -0.0
tv-app debug unknown 5736 5736 0 0.0
FLASH 5966741 5968037 1296 0.0
RAM 601312 601312 0 0.0
tv-casting-app debug unknown 5312 5312 0 0.0
FLASH 11102349 11103597 1248 0.0
RAM 700496 700496 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 917804 918024 220 0.0
RAM 143172 143172 0 0.0
nrf7002dk_nrf5340_cpuapp FLASH 890868 891148 280 0.0
RAM 141359 141359 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 FLASH 851932 852152 220 0.0
RAM 142084 142084 0 0.0
nxp contact k32w0+release FLASH 585968 586176 208 0.0
RAM 70952 70952 0 0.0
mcxw71+release FLASH 601488 601656 168 0.0
RAM 63168 63168 0 0.0
light k32w0+release FLASH 612588 612812 224 0.0
RAM 70344 70344 0 0.0
k32w1+release FLASH 687152 687312 160 0.0
RAM 48760 48760 0 0.0
lock mcxw71+release FLASH 763464 763632 168 0.0
RAM 70796 70796 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1652124 1652572 448 0.0
RAM 211632 211632 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1557884 1558324 440 0.0
RAM 208448 208448 0 0.0
light cy8ckit_062s2_43012 FLASH 1472492 1472932 440 0.0
RAM 200416 200416 0 0.0
lock cy8ckit_062s2_43012 FLASH 1470276 1470716 440 0.0
RAM 224768 224768 0 0.0
qpg lighting-app qpg6105+debug FLASH 664144 664360 216 0.0
RAM 105296 105296 0 0.0
lock-app qpg6105+debug FLASH 622004 622220 216 0.0
RAM 99748 99748 0 0.0
stm32 light STM32WB5MM-DK FLASH 484976 485184 208 0.0
RAM 144752 144752 0 0.0
telink bridge-app tlsr9258a FLASH 683552 684038 486 0.1
RAM 91088 91088 0 0.0
contact-sensor-app tlsr9528a_retention FLASH 623810 624296 486 0.1
RAM 31488 31488 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 772652 773140 488 0.1
RAM 49348 49348 0 0.0
light-app-ota-shell-factory-data tl7218x FLASH 777256 777742 486 0.1
RAM 99652 99652 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 711250 711736 486 0.1
RAM 73384 73384 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 628264 628750 486 0.1
RAM 142020 142020 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 814266 814752 486 0.1
RAM 99564 99564 0 0.0
tizen all-clusters-app arm unknown 5120 5120 0 0.0
FLASH 1767272 1768316 1044 0.1
RAM 93708 93708 0 0.0
chip-tool-ubsan arm unknown 10904 10904 0 0.0
FLASH 17949774 17951310 1536 0.0
RAM 7842672 7843468 796 0.0

@Alami-Amine Alami-Amine force-pushed the AA/CASERefactorSigma2 branch from a68f2c0 to 386d4b9 Compare January 15, 2025 18:55
@Alami-Amine Alami-Amine force-pushed the AA/CASERefactorSigma2 branch from 386d4b9 to f7b8166 Compare January 15, 2025 18:56
Copy link

github-actions bot commented Jan 15, 2025

PR #36941: Size comparison from 958c1cb to f7b8166

Full report (71 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
platform target config section 958c1cb f7b8166 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1094560 1095006 446 0.0
RAM 103346 103346 0 0.0
bl702 lighting-app bl702+eth FLASH 652366 652812 446 0.1
RAM 25353 25353 0 0.0
bl702+wifi FLASH 830546 830992 446 0.1
RAM 14093 14093 0 0.0
bl706+mfd+rpc+littlefs FLASH 1057832 1058278 446 0.0
RAM 23949 23949 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 890856 891302 446 0.1
RAM 18624 18624 0 0.0
lighting-app bl702l+mfd+littlefs FLASH 973816 974262 446 0.0
RAM 16472 16472 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 840084 840244 160 0.0
RAM 123536 123536 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 825600 825752 152 0.0
RAM 125424 125424 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 772528 772696 168 0.0
RAM 113900 113900 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 756724 756892 168 0.0
RAM 114100 114100 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 540021 540213 192 0.0
RAM 205288 205288 0 0.0
lock CC3235SF_LAUNCHXL FLASH 574189 574389 200 0.0
RAM 205432 205432 0 0.0
cyw30739 light CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 681569 681753 184 0.0
RAM 78596 78596 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 701413 701597 184 0.0
RAM 81236 81236 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 701413 701597 184 0.0
RAM 81236 81236 0 0.0
CYW930739M2EVB-02 unknown 2040 2040 0 0.0
FLASH 658357 658541 184 0.0
RAM 73664 73664 0 0.0
light-switch CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 618153 618345 192 0.0
RAM 71588 71588 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 637789 637981 192 0.0
RAM 74132 74132 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 637789 637981 192 0.0
RAM 74132 74132 0 0.0
lock CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 637601 637793 192 0.0
RAM 74596 74596 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 657317 657509 192 0.0
RAM 77140 77140 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 657317 657509 192 0.0
RAM 77140 77140 0 0.0
thermostat CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 614213 614397 184 0.0
RAM 68684 68684 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 634065 634249 184 0.0
RAM 71316 71316 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 634065 634249 184 0.0
RAM 71316 71316 0 0.0
efr32 lock-app BRD4187C FLASH 932548 932740 192 0.0
RAM 160068 160068 0 0.0
BRD4338a FLASH 749328 749760 432 0.1
RAM 233196 233196 0 0.0
window-app BRD4187C FLASH 1027008 1027448 440 0.0
RAM 128172 128172 0 0.0
esp32 all-clusters-app c3devkit DRAM 95192 95192 0 0.0
FLASH 1541922 1542418 496 0.0
IRAM 82552 82552 0 0.0
m5stack DRAM 116172 116172 0 0.0
FLASH 1548478 1548666 188 0.0
IRAM 117039 117039 0 0.0
linux air-purifier-app debug unknown 4752 4752 0 0.0
FLASH 2722505 2723807 1302 0.0
RAM 133096 133096 0 0.0
all-clusters-app debug unknown 5560 5560 0 0.0
FLASH 5997022 5998282 1260 0.0
RAM 529752 529752 0 0.0
all-clusters-minimal-app debug unknown 5456 5456 0 0.0
FLASH 5341278 5342538 1260 0.0
RAM 243008 243008 0 0.0
bridge-app debug unknown 5472 5472 0 0.0
FLASH 4696432 4697692 1260 0.0
RAM 221760 221760 0 0.0
chip-tool debug unknown 5984 5984 0 0.0
FLASH 12986152 12987446 1294 0.0
RAM 592474 592474 0 0.0
chip-tool-ipv6only arm64 unknown 21664 21664 0 0.0
FLASH 11082640 11081968 -672 -0.0
RAM 643824 643776 -48 -0.0
fabric-admin debug unknown 5808 5808 0 0.0
FLASH 1135286 11354159 1294 0.0
RAM 592818 592818 0 0.0
fabric-bridge-app debug unknown 4728 4728 0 0.0
FLASH 4521464 4522756 1292 0.0
RAM 208880 208880 0 0.0
fabric-sync debug unknown 4968 4968 0 0.0
FLASH 5622965 5624213 1248 0.0
RAM 481576 481576 0 0.0
lighting-app debug+rpc+ui unknown 6136 6136 0 0.0
FLASH 5630609 5631873 1264 0.0
RAM 232008 232008 0 0.0
lock-app debug unknown 5408 5408 0 0.0
FLASH 4744194 4745486 1292 0.0
RAM 208008 208008 0 0.0
ota-provider-app debug unknown 4768 4768 0 0.0
FLASH 4371814 4373106 1292 0.0
RAM 201696 201696 0 0.0
ota-requestor-app debug unknown 4720 4720 0 0.0
FLASH 4509826 4511118 1292 0.0
RAM 206280 206280 0 0.0
shell debug unknown 4248 4248 0 0.0
FLASH 3022829 3024125 1296 0.0
RAM 160736 160736 0 0.0
thermostat-no-ble arm64 unknown 9552 9552 0 0.0
FLASH 4109912 4109272 -640 -0.0
RAM 246304 246256 -48 -0.0
tv-app debug unknown 5736 5736 0 0.0
FLASH 5966661 5967957 1296 0.0
RAM 605008 605008 0 0.0
tv-casting-app debug unknown 5312 5312 0 0.0
FLASH 11223949 11225197 1248 0.0
RAM 706456 706456 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 917804 918024 220 0.0
RAM 143172 143172 0 0.0
nrf7002dk_nrf5340_cpuapp FLASH 890868 891148 280 0.0
RAM 141359 141359 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 FLASH 851932 852152 220 0.0
RAM 142084 142084 0 0.0
nxp contact k32w0+release FLASH 585968 586176 208 0.0
RAM 70952 70952 0 0.0
mcxw71+release FLASH 601488 601656 168 0.0
RAM 63168 63168 0 0.0
light k32w0+release FLASH 612588 612812 224 0.0
RAM 70344 70344 0 0.0
k32w1+release FLASH 687152 687312 160 0.0
RAM 48760 48760 0 0.0
lock mcxw71+release FLASH 763464 763632 168 0.0
RAM 70796 70796 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1652092 1652540 448 0.0
RAM 211624 211624 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1557860 1558300 440 0.0
RAM 208440 208440 0 0.0
light cy8ckit_062s2_43012 FLASH 1472460 1472900 440 0.0
RAM 200408 200408 0 0.0
lock cy8ckit_062s2_43012 FLASH 1470244 1470684 440 0.0
RAM 224760 224760 0 0.0
qpg lighting-app qpg6105+debug FLASH 664144 664360 216 0.0
RAM 105296 105296 0 0.0
lock-app qpg6105+debug FLASH 622004 622220 216 0.0
RAM 99748 99748 0 0.0
stm32 light STM32WB5MM-DK FLASH 484976 485184 208 0.0
RAM 144752 144752 0 0.0
telink bridge-app tlsr9258a FLASH 683552 684038 486 0.1
RAM 91088 91088 0 0.0
contact-sensor-app tlsr9528a_retention FLASH 623810 624296 486 0.1
RAM 31488 31488 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 772652 773140 488 0.1
RAM 49348 49348 0 0.0
light-app-ota-shell-factory-data tl7218x FLASH 777256 777742 486 0.1
RAM 99652 99652 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 711250 711736 486 0.1
RAM 73384 73384 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 628264 628750 486 0.1
RAM 142020 142020 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 814266 814752 486 0.1
RAM 99564 99564 0 0.0
tizen all-clusters-app arm unknown 5120 5120 0 0.0
FLASH 1766952 1767996 1044 0.1
RAM 93672 93672 0 0.0
chip-tool-ubsan arm unknown 10968 10968 0 0.0
FLASH 18132110 18133654 1544 0.0
RAM 7923244 7924040 796 0.0

Copy link

github-actions bot commented Jan 23, 2025

PR #36941: Size comparison from 17ad72e to 1f9cd96

Full report (71 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
platform target config section 17ad72e 1f9cd96 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1092312 1092750 438 0.0
RAM 103282 103282 0 0.0
bl702 lighting-app bl702+eth FLASH 650236 650674 438 0.1
RAM 25265 25265 0 0.0
bl702+wifi FLASH 828400 828838 438 0.1
RAM 13981 13981 0 0.0
bl706+mfd+rpc+littlefs FLASH 1055136 1055574 438 0.0
RAM 23845 23845 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 888134 888572 438 0.0
RAM 18504 18504 0 0.0
lighting-app bl702l+mfd+littlefs FLASH 971120 971558 438 0.0
RAM 16368 16368 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 838000 838144 144 0.0
RAM 123464 123464 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 823412 823556 144 0.0
RAM 125344 125344 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 770636 770796 160 0.0
RAM 113804 113804 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 754888 755048 160 0.0
RAM 114012 114012 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 538433 538609 176 0.0
RAM 205192 205192 0 0.0
lock CC3235SF_LAUNCHXL FLASH 572297 572481 184 0.0
RAM 205344 205344 0 0.0
cyw30739 light CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 679401 679577 176 0.0
RAM 78532 78532 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 699253 699429 176 0.0
RAM 81172 81172 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 699253 699429 176 0.0
RAM 81172 81172 0 0.0
CYW930739M2EVB-02 unknown 2040 2040 0 0.0
FLASH 656181 656357 176 0.0
RAM 73600 73600 0 0.0
light-switch CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 615793 615969 176 0.0
RAM 71516 71516 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 635421 635597 176 0.0
RAM 74060 74060 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 635421 635597 176 0.0
RAM 74060 74060 0 0.0
lock CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 635265 635441 176 0.0
RAM 74524 74524 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 654973 655149 176 0.0
RAM 77068 77068 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 654973 655149 176 0.0
RAM 77068 77068 0 0.0
thermostat CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 611701 611877 176 0.0
RAM 68612 68612 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 631561 631737 176 0.0
RAM 71252 71252 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 631561 631737 176 0.0
RAM 71252 71252 0 0.0
efr32 lock-app BRD4187C FLASH 934672 934864 192 0.0
RAM 159904 159904 0 0.0
BRD4338a FLASH 729676 730124 448 0.1
RAM 234768 234768 0 0.0
window-app BRD4187C FLASH 1029352 1029784 432 0.0
RAM 128040 128040 0 0.0
esp32 all-clusters-app c3devkit DRAM 95104 95104 0 0.0
FLASH 1536860 1537348 488 0.0
IRAM 82552 82552 0 0.0
m5stack DRAM 116092 116092 0 0.0
FLASH 1544946 1545114 168 0.0
IRAM 117039 117039 0 0.0
linux air-purifier-app debug unknown 4752 4752 0 0.0
FLASH 2708845 2710147 1302 0.0
RAM 132800 132800 0 0.0
all-clusters-app debug unknown 5560 5560 0 0.0
FLASH 5974932 5976192 1260 0.0
RAM 531616 531616 0 0.0
all-clusters-minimal-app debug unknown 5456 5456 0 0.0
FLASH 5323618 5324878 1260 0.0
RAM 242728 242728 0 0.0
bridge-app debug unknown 5472 5472 0 0.0
FLASH 4681806 4683068 1262 0.0
RAM 221464 221464 0 0.0
chip-tool debug unknown 5984 5984 0 0.0
FLASH 13046874 13048168 1294 0.0
RAM 596178 596178 0 0.0
chip-tool-ipv6only arm64 unknown 21776 21776 0 0.0
FLASH 11124048 11123392 -656 -0.0
RAM 647920 647872 -48 -0.0
fabric-admin debug unknown 5808 5808 0 0.0
FLASH 11393881 11395175 1294 0.0
RAM 596522 596522 0 0.0
fabric-bridge-app debug unknown 4728 4728 0 0.0
FLASH 4507202 4508496 1294 0.0
RAM 208648 208648 0 0.0
fabric-sync debug unknown 4968 4968 0 0.0
FLASH 5612613 5613877 1264 0.0
RAM 483520 483520 0 0.0
lighting-app debug+rpc+ui unknown 6136 6136 0 0.0
FLASH 5615921 5617185 1264 0.0
RAM 231744 231744 0 0.0
lock-app debug unknown 5408 5408 0 0.0
FLASH 4730856 4732150 1294 0.0
RAM 207712 207712 0 0.0
ota-provider-app debug unknown 4768 4768 0 0.0
FLASH 4359432 4360726 1294 0.0
RAM 201352 201352 0 0.0
ota-requestor-app debug unknown 4720 4720 0 0.0
FLASH 4496936 4498230 1294 0.0
RAM 205936 205936 0 0.0
shell debug unknown 4248 4248 0 0.0
FLASH 3005021 3006317 1296 0.0
RAM 160504 160504 0 0.0
thermostat-no-ble arm64 unknown 9536 9536 0 0.0
FLASH 4098896 4098240 -656 -0.0
RAM 246136 246088 -48 -0.0
tv-app debug unknown 5736 5736 0 0.0
FLASH 5952245 5953541 1296 0.0
RAM 606920 606920 0 0.0
tv-casting-app debug unknown 5312 5312 0 0.0
FLASH 11272349 11273613 1264 0.0
RAM 710864 710864 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 913652 913860 208 0.0
RAM 143168 143168 0 0.0
nrf7002dk_nrf5340_cpuapp FLASH 888632 888924 292 0.0
RAM 141355 141355 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 FLASH 848696 848904 208 0.0
RAM 142080 142080 0 0.0
nxp contact k32w0+release FLASH 584288 584496 208 0.0
RAM 70860 70860 0 0.0
mcxw71+release FLASH 599632 599784 152 0.0
RAM 63080 63080 0 0.0
light k32w0+release FLASH 610716 610940 224 0.0
RAM 70252 70252 0 0.0
k32w1+release FLASH 685184 685328 144 0.0
RAM 48664 48664 0 0.0
lock mcxw71+release FLASH 748648 748808 160 0.0
RAM 67476 67476 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1646420 1646900 480 0.0
RAM 211560 211560 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1553212 1553668 456 0.0
RAM 208376 208376 0 0.0
light cy8ckit_062s2_43012 FLASH 1468876 1469332 456 0.0
RAM 200352 200352 0 0.0
lock cy8ckit_062s2_43012 FLASH 1466908 1467380 472 0.0
RAM 224688 224688 0 0.0
qpg lighting-app qpg6105+debug FLASH 661992 662192 200 0.0
RAM 105204 105204 0 0.0
lock-app qpg6105+debug FLASH 619772 619980 208 0.0
RAM 99648 99648 0 0.0
stm32 light STM32WB5MM-DK FLASH 482608 482800 192 0.0
RAM 144672 144672 0 0.0
telink bridge-app tlsr9258a FLASH 681522 682000 478 0.1
RAM 91084 91084 0 0.0
contact-sensor-app tlsr9528a_retention FLASH 621556 622034 478 0.1
RAM 31484 31484 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 770426 770906 480 0.1
RAM 49344 49344 0 0.0
light-app-ota-shell-factory-data tl7218x FLASH 774822 775300 478 0.1
RAM 99648 99648 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 708724 709202 478 0.1
RAM 73376 73376 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 625832 626310 478 0.1
RAM 142016 142016 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 811882 812360 478 0.1
RAM 99560 99560 0 0.0
tizen all-clusters-app arm unknown 5112 5112 0 0.0
FLASH 1751312 1752356 1044 0.1
RAM 93524 93524 0 0.0
chip-tool-ubsan arm unknown 11024 11024 0 0.0
FLASH 18213990 18215534 1544 0.0
RAM 7955248 7956044 796 0.0

src/protocols/secure_channel/CASESession.cpp Outdated Show resolved Hide resolved
src/protocols/secure_channel/CASESession.h Outdated Show resolved Hide resolved
src/protocols/secure_channel/CASESession.h Outdated Show resolved Hide resolved
src/protocols/secure_channel/CASESession.h Outdated Show resolved Hide resolved
MutableByteSpan msgR2EncryptedPayload;
ByteSpan msgR2Mic;
SessionParameters responderSessionParams;
uint16_t responderSessionId;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spec calls this responderSessionID. Why the random casing difference? This applies to some other bits too (resumptionId here and in EncodeSigma2ResumeInputs, responderSessionId in EncodeSigma2ResumeInputs, resumptionId and responderSessionId in ParsedSigma2Resume).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, there seems to be dispute on how should we treat abbreviations with camelCase, treat them like a word or keep them all Capital?

src/protocols/secure_channel/CASESession.cpp Outdated Show resolved Hide resolved
src/protocols/secure_channel/CASESession.cpp Outdated Show resolved Hide resolved
}
// Msg2 should only be added to MessageDigest after we construct SaltSigma2 that is used to derive S2K
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? We're not using SaltSigma2 here.... why does this ordering requirement exist?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because to construct SaltSigma2, we use the MessageDigest/TranscriptHash that only includes Msg1 and doesn't include Msg2 (this happens within CASESession::ConstructSaltSigma2)

sr2k.KeyHandle(), kTBEData2_Nonce, kTBEDataNonceLength, msg_R2_Encrypted.Get()));
if (parsedSigma2.responderSessionParamStructPresent)
{
SetRemoteSessionParameters(parsedSigma2.responderSessionParams);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This used to be after successful decrypt, no? Why the ordering change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, is it an issue if we do it before a sucessful decrypt? there seems to be nothing in spec about it?
I wanted to group all the outer sigma-2-struct parts together

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will move this after signature validation, as it was done before

SuccessOrExit(err = decryptedDataTlvReader.Get(responderICAC));
SuccessOrExit(err = decryptedDataTlvReader.Next(TLV::kTLVType_ByteString, AsTlvContextTag(TBEDataTags::kSignature)));
}
std::copy(parsedSigma2TBEData.resumptionId.begin(), parsedSigma2TBEData.resumptionId.end(), mNewResumptionId.begin());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This used to be after signature validation, right? Why the ordering change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just wanted to group the parts related to Sigma2TBEData together.

  • Looking at the spec, this is done after signature validation, I will move it there.
  • I will also move SetPeerSessionId(responderSessionId); to after signature validation, as it is like that in the spec (but wasn't the case in the code)

Copy link

github-actions bot commented Jan 24, 2025

PR #36941: Size comparison from 17ad72e to 291a38f

Increases above 0.2%:

platform target config section 17ad72e 291a38f change % change
esp32 all-clusters-app c3devkit DRAM 95104 97296 2192 2.3
FLASH 1536860 1577504 40644 2.6
IRAM 82552 83820 1268 1.5
Full report (71 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
platform target config section 17ad72e 291a38f change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1092312 1093956 1644 0.2
RAM 103282 103298 16 0.0
bl702 lighting-app bl702+eth FLASH 650236 650568 332 0.1
RAM 25265 25265 0 0.0
bl702+wifi FLASH 828400 828476 76 0.0
RAM 13981 13981 0 0.0
bl706+mfd+rpc+littlefs FLASH 1055136 1057028 1892 0.2
RAM 23845 23861 16 0.1
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 888134 888462 328 0.0
RAM 18504 18504 0 0.0
lighting-app bl702l+mfd+littlefs FLASH 971120 971448 328 0.0
RAM 16368 16368 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 838000 838128 128 0.0
RAM 123464 123464 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 823412 823532 120 0.0
RAM 125344 125344 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 770636 770756 120 0.0
RAM 113804 113804 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 754888 755016 128 0.0
RAM 114012 114012 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 538433 538589 156 0.0
RAM 205192 205192 0 0.0
lock CC3235SF_LAUNCHXL FLASH 572297 572461 164 0.0
RAM 205344 205344 0 0.0
cyw30739 light CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 679401 679545 144 0.0
RAM 78532 78532 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 699253 699397 144 0.0
RAM 81172 81172 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 699253 699397 144 0.0
RAM 81172 81172 0 0.0
CYW930739M2EVB-02 unknown 2040 2040 0 0.0
FLASH 656181 656325 144 0.0
RAM 73600 73600 0 0.0
light-switch CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 615793 615929 136 0.0
RAM 71516 71516 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 635421 635557 136 0.0
RAM 74060 74060 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 635421 635557 136 0.0
RAM 74060 74060 0 0.0
lock CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 635265 635401 136 0.0
RAM 74524 74524 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 654973 655109 136 0.0
RAM 77068 77068 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 654973 655109 136 0.0
RAM 77068 77068 0 0.0
thermostat CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 611701 611837 136 0.0
RAM 68612 68612 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 631561 631697 136 0.0
RAM 71252 71252 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 631561 631697 136 0.0
RAM 71252 71252 0 0.0
efr32 lock-app BRD4187C FLASH 934672 936424 1752 0.2
RAM 159904 159904 0 0.0
BRD4338a FLASH 729676 729932 256 0.0
RAM 234768 234768 0 0.0
window-app BRD4187C FLASH 1029352 1029592 240 0.0
RAM 128040 128040 0 0.0
esp32 all-clusters-app c3devkit DRAM 95104 97296 2192 2.3
FLASH 1536860 1577504 40644 2.6
IRAM 82552 83820 1268 1.5
m5stack DRAM 116092 116092 0 0.0
FLASH 1544946 1545154 208 0.0
IRAM 117039 117039 0 0.0
linux air-purifier-app debug unknown 4752 4760 8 0.2
FLASH 2708845 2709745 900 0.0
RAM 132800 132800 0 0.0
all-clusters-app debug unknown 5560 5568 8 0.1
FLASH 5974932 5975758 826 0.0
RAM 531616 531616 0 0.0
all-clusters-minimal-app debug unknown 5456 5464 8 0.1
FLASH 5323618 5324444 826 0.0
RAM 242728 242728 0 0.0
bridge-app debug unknown 5472 5480 8 0.1
FLASH 4681806 4682634 828 0.0
RAM 221464 221464 0 0.0
chip-tool debug unknown 5984 5984 0 0.0
FLASH 13046874 13043524 -3350 -0.0
RAM 596178 596178 0 0.0
chip-tool-ipv6only arm64 unknown 21776 21776 0 0.0
FLASH 11124048 1111833 -5712 -0.1
RAM 647920 647872 -48 -0.0
fabric-admin debug unknown 5808 5808 0 0.0
FLASH 11393881 11389605 -4276 -0.0
RAM 596522 596522 0 0.0
fabric-bridge-app debug unknown 4728 4736 8 0.2
FLASH 4507202 4507264 62 0.0
RAM 208648 208648 0 0.0
fabric-sync debug unknown 4968 4976 8 0.2
FLASH 5612613 5613477 864 0.0
RAM 483520 483520 0 0.0
lighting-app debug+rpc+ui unknown 6136 6144 8 0.1
FLASH 5615921 5625425 9504 0.2
RAM 231744 231744 0 0.0
lock-app debug unknown 5408 5416 8 0.1
FLASH 4730856 4731716 860 0.0
RAM 207712 207712 0 0.0
ota-provider-app debug unknown 4768 4776 8 0.2
FLASH 4359432 4360292 860 0.0
RAM 201352 201352 0 0.0
ota-requestor-app debug unknown 4720 4728 8 0.2
FLASH 4496936 4497796 860 0.0
RAM 205936 205936 0 0.0
shell debug unknown 4248 4256 8 0.2
FLASH 3005021 3005885 864 0.0
RAM 160504 160504 0 0.0
thermostat-no-ble arm64 unknown 9536 9536 0 0.0
FLASH 4098896 4097872 -1024 -0.0
RAM 246136 246088 -48 -0.0
tv-app debug unknown 5736 5744 8 0.1
FLASH 5952245 5953141 896 0.0
RAM 606920 606920 0 0.0
tv-casting-app debug unknown 5312 5320 8 0.2
FLASH 11272349 11270477 -1872 -0.0
RAM 710864 710864 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 913652 913828 176 0.0
RAM 143168 143168 0 0.0
nrf7002dk_nrf5340_cpuapp FLASH 888632 888788 156 0.0
RAM 141355 141355 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 FLASH 848696 848868 172 0.0
RAM 142080 142080 0 0.0
nxp contact k32w0+release FLASH 584288 584464 176 0.0
RAM 70860 70860 0 0.0
mcxw71+release FLASH 599632 599760 128 0.0
RAM 63080 63080 0 0.0
light k32w0+release FLASH 610716 610892 176 0.0
RAM 70252 70252 0 0.0
k32w1+release FLASH 685184 685304 120 0.0
RAM 48664 48664 0 0.0
lock mcxw71+release FLASH 748648 748776 128 0.0
RAM 67476 67476 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1646420 1646756 336 0.0
RAM 211560 211560 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1553212 1553508 296 0.0
RAM 208376 208376 0 0.0
light cy8ckit_062s2_43012 FLASH 1468876 1469188 312 0.0
RAM 200352 200352 0 0.0
lock cy8ckit_062s2_43012 FLASH 1466908 1467236 328 0.0
RAM 224688 224688 0 0.0
qpg lighting-app qpg6105+debug FLASH 661992 662168 176 0.0
RAM 105204 105204 0 0.0
lock-app qpg6105+debug FLASH 619772 619948 176 0.0
RAM 99648 99648 0 0.0
stm32 light STM32WB5MM-DK FLASH 482608 482776 168 0.0
RAM 144672 144672 0 0.0
telink bridge-app tlsr9258a FLASH 681522 681820 298 0.0
RAM 91084 91084 0 0.0
contact-sensor-app tlsr9528a_retention FLASH 621556 621850 294 0.0
RAM 31484 31484 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 770426 770706 280 0.0
RAM 49344 49344 0 0.0
light-app-ota-shell-factory-data tl7218x FLASH 774822 775120 298 0.0
RAM 99648 99648 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 708724 709022 298 0.0
RAM 73376 73376 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 625832 626130 298 0.0
RAM 142016 142016 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 811882 813502 1620 0.2
RAM 99560 99560 0 0.0
tizen all-clusters-app arm unknown 5112 5116 4 0.1
FLASH 1751312 1752788 1476 0.1
RAM 93524 93524 0 0.0
chip-tool-ubsan arm unknown 11024 11024 0 0.0
FLASH 18213990 18213414 -576 -0.0
RAM 7955248 7954852 -396 -0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants