PLATFORM values for CW308 UFO STM32F

Hello,

While working with SCA201, LAB2_1-CPA on 32-bit AES, I noticed some differences in the traces and CPA by changing the ‘PLATFORM’ value.

For the 1st case, with the following values,

SCOPETYPE = ‘OPENADC’
PLATFORM = ‘CWLITEARM’
VERSION = ‘HARDWARE’
SS_VER=‘SS_VER_1_1’

I have a different set of traces and the CPA is unable to recover any subkeys.

However, with

SCOPETYPE = ‘OPENADC’
PLATFORM = ‘CW308_STM32F3’
VERSION = ‘HARDWARE’
SS_VER=‘SS_VER_1_1’

I see a different set of traces and the CPA recovers almost 50-60% of the subkeys (using the CPA analyzer in the notebook) and ~70% for the improved attack (using T-table).

FYI, for both the cases, the CRYPTO_TARGET = ‘MBEDTLS’

Additionally, for the ‘CWLITE’ case, the binary is 6087 bytes

Welcome to another exciting ChipWhisperer target build!!
arm-none-eabi-gcc (Arm GNU Toolchain 13.3.Rel1 (Build arm-13.24)) 13.3.1 20240614
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Size after:
text data bss dec hex filename
5552 536 1632 7720 1e28 simpleserial-aes-CWLITEARM.elf
±-------------------------------------------------------

  • Built for platform CW-Lite Arm (STM32F3) with:
  • CRYPTO_TARGET = MBEDTLS
  • CRYPTO_OPTIONS = AES128C
    ±-------------------------------------------------------
    Detected known STMF32: STM32F302xB(C)/303xB(C)
    Extended erase (0x44), this can take ten seconds or more
    Attempting to program 6087 bytes at 0x8000000
    STM32F Programming flash…
    STM32F Reading flash…
    Verified flash OK, 6087 bytes

whereas for the ‘CW308_STM32F3’ it’s 16043 bytes.

Welcome to another exciting ChipWhisperer target build!!
arm-none-eabi-gcc (Arm GNU Toolchain 13.3.Rel1 (Build arm-13.24)) 13.3.1 20240614
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Size after:
text data bss dec hex filename
16032 12 1716 17760 4560 simpleserial-aes-CW308_STM32F3.elf
±-------------------------------------------------------

  • Built for platform CW308T: STM32F3 Target with:
  • CRYPTO_TARGET = MBEDTLS
  • CRYPTO_OPTIONS = AES128C
    ±-------------------------------------------------------
    Detected known STMF32: STM32F302xB(C)/303xB(C)
    Extended erase (0x44), this can take ten seconds or more
    Attempting to program 16043 bytes at 0x8000000
    STM32F Programming flash…
    STM32F Reading flash…
    Verified flash OK, 16043 bytes

What am I missing here? The differences by simply changing the ‘PLATFORM’ value for the same board are significant.

For a CW308-UFO board with STM32F(303) target, what is the ‘PLATFORM’ value to be used?

Thanks!

There shouldn’t be any major differences here (just some extra functions for LEDs). It looks like all the same files are being compiled with the same settings and optimization level, so this is indeed very strange.

Indeed, that was my initial impression as well. But the traces also differed considerably which was confusing.

Do you recommend to continue with ‘CWLITEARM’ or the ‘CW308_STM32xx’ as the PLATFORM name?

I’d say just use whichever works best. Out of curiosity, do you get a difference between the two if you do a full build (running make PLATFORM=CW308_STM32F3 clean or make PLATFORM=CWLITEARM clean then a build)?