{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "b8d3658f-b697-4a72-833b-1e43a237cbae",
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "from scipy import stats"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "ffd8541e-b2a9-4b0b-8206-50b1f15887f6",
   "metadata": {},
   "outputs": [],
   "source": [
    "PLATFORM = 'CWLITEARM'\n",
    "CRYPTO_TARGET = 'NONE'\n",
    "SS_VER = 'SS_VER_1_1'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "12634820-8232-4da3-ad60-d6a3b385bb84",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "INFO: Found ChipWhisperer😍\n",
      "scope.gain.mode                          changed from low                       to high                     \n",
      "scope.gain.gain                          changed from 0                         to 30                       \n",
      "scope.gain.db                            changed from 5.5                       to 24.8359375               \n",
      "scope.adc.basic_mode                     changed from low                       to rising_edge              \n",
      "scope.adc.samples                        changed from 24400                     to 5000                     \n",
      "scope.adc.trig_count                     changed from 6911217                   to 30047492                 \n",
      "scope.clock.adc_src                      changed from clkgen_x1                 to clkgen_x4                \n",
      "scope.clock.adc_freq                     changed from 0                         to 29538459                 \n",
      "scope.clock.adc_rate                     changed from 0.0                       to 29538459.0               \n",
      "scope.clock.clkgen_div                   changed from 1                         to 26                       \n",
      "scope.clock.clkgen_freq                  changed from 192000000.0               to 7384615.384615385        \n",
      "scope.io.tio1                            changed from serial_tx                 to serial_rx                \n",
      "scope.io.tio2                            changed from serial_rx                 to serial_tx                \n",
      "scope.io.hs2                             changed from None                      to clkgen                   \n",
      "scope.io.cdc_settings                    changed from bytearray(b'\\x01\\x00\\x00\\x00') to bytearray(b'\\x00\\x00\\x00\\x00')\n"
     ]
    }
   ],
   "source": [
    "import time\n",
    "import chipwhisperer as cw\n",
    "\n",
    "scope = cw.scope()\n",
    "\n",
    "target_type = cw.targets.SimpleSerial\n",
    "try:\n",
    "    target = cw.target(scope, target_type)\n",
    "except:\n",
    "    print(\"INFO: Caught exception on reconnecting to target - attempting to reconnect to scope first.\")\n",
    "    print(\"INFO: This is a work-around when USB has died without Python knowing. Ignore errors above this line.\")\n",
    "    scope = cw.scope()\n",
    "    target = cw.target(scope, target_type)\n",
    "\n",
    "print(\"INFO: Found ChipWhisperer😍\")\n",
    "\n",
    "prog = cw.programmers.STM32FProgrammer\n",
    "\n",
    "time.sleep(0.05)\n",
    "scope.default_setup()\n",
    "def reset_target(scope):\n",
    "    scope.io.nrst = 'low'\n",
    "    time.sleep(0.05)\n",
    "    scope.io.nrst = 'high_z'\n",
    "    time.sleep(0.05)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "id": "b767f3c6-5a13-44a8-9513-62768be57fee",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Building for platform CWLITEARM with CRYPTO_TARGET=NONE\n",
      "SS_VER set to SS_VER_1_1\n",
      "SS_VER set to SS_VER_1_1\n",
      "mkdir -p .dep\n",
      ".\n",
      "Welcome to another exciting ChipWhisperer target build!!\n",
      "arm-none-eabi-gcc (Arch Repository) 14.2.0\n",
      "Copyright (C) 2024 Free Software Foundation, Inc.\n",
      "This is free software; see the source for copying conditions.  There is NO\n",
      "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n",
      "\n",
      "mkdir -p objdir-CWLITEARM \n",
      ".\n",
      "Compiling C: main.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/main.lst -MMD -MP -MF .dep/main.o.d main.c -o objdir-CWLITEARM/main.o\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "main.c: In function 'scarsa_test_grp2':\n",
      "main.c:1422:13: warning: variable 'ret' set but not used [-Wunused-but-set-variable]\n",
      " 1422 |         int ret = -1;\n",
      "      |             ^~~\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      ".\n",
      "Compiling C: src/int/i31_add.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/i31_add.lst -MMD -MP -MF .dep/i31_add.o.d src/int/i31_add.c -o objdir-CWLITEARM/src/int/i31_add.o\n",
      ".\n",
      "Compiling C: src/int/i31_bitlen.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/i31_bitlen.lst -MMD -MP -MF .dep/i31_bitlen.o.d src/int/i31_bitlen.c -o objdir-CWLITEARM/src/int/i31_bitlen.o\n",
      ".\n",
      "Compiling C: src/int/i31_decmod.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/i31_decmod.lst -MMD -MP -MF .dep/i31_decmod.o.d src/int/i31_decmod.c -o objdir-CWLITEARM/src/int/i31_decmod.o\n",
      ".\n",
      "Compiling C: src/int/i31_decode.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/i31_decode.lst -MMD -MP -MF .dep/i31_decode.o.d src/int/i31_decode.c -o objdir-CWLITEARM/src/int/i31_decode.o\n",
      ".\n",
      "Compiling C: src/int/i31_decred.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/i31_decred.lst -MMD -MP -MF .dep/i31_decred.o.d src/int/i31_decred.c -o objdir-CWLITEARM/src/int/i31_decred.o\n",
      ".\n",
      "Compiling C: src/int/i31_encode.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/i31_encode.lst -MMD -MP -MF .dep/i31_encode.o.d src/int/i31_encode.c -o objdir-CWLITEARM/src/int/i31_encode.o\n",
      ".\n",
      "Compiling C: src/int/i31_fmont.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/i31_fmont.lst -MMD -MP -MF .dep/i31_fmont.o.d src/int/i31_fmont.c -o objdir-CWLITEARM/src/int/i31_fmont.o\n",
      ".\n",
      "Compiling C: src/int/i31_iszero.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/i31_iszero.lst -MMD -MP -MF .dep/i31_iszero.o.d src/int/i31_iszero.c -o objdir-CWLITEARM/src/int/i31_iszero.o\n",
      ".\n",
      "Compiling C: src/int/i31_moddiv.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/i31_moddiv.lst -MMD -MP -MF .dep/i31_moddiv.o.d src/int/i31_moddiv.c -o objdir-CWLITEARM/src/int/i31_moddiv.o\n",
      ".\n",
      "Compiling C: src/int/i31_modpow2.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/i31_modpow2.lst -MMD -MP -MF .dep/i31_modpow2.o.d src/int/i31_modpow2.c -o objdir-CWLITEARM/src/int/i31_modpow2.o\n",
      ".\n",
      "Compiling C: src/int/i31_modpow.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/i31_modpow.lst -MMD -MP -MF .dep/i31_modpow.o.d src/int/i31_modpow.c -o objdir-CWLITEARM/src/int/i31_modpow.o\n",
      ".\n",
      "Compiling C: src/int/i31_montmul.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/i31_montmul.lst -MMD -MP -MF .dep/i31_montmul.o.d src/int/i31_montmul.c -o objdir-CWLITEARM/src/int/i31_montmul.o\n",
      ".\n",
      "Compiling C: src/int/i31_mulacc.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/i31_mulacc.lst -MMD -MP -MF .dep/i31_mulacc.o.d src/int/i31_mulacc.c -o objdir-CWLITEARM/src/int/i31_mulacc.o\n",
      ".\n",
      "Compiling C: src/int/i31_muladd.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/i31_muladd.lst -MMD -MP -MF .dep/i31_muladd.o.d src/int/i31_muladd.c -o objdir-CWLITEARM/src/int/i31_muladd.o\n",
      ".\n",
      "Compiling C: src/int/i31_ninv31.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/i31_ninv31.lst -MMD -MP -MF .dep/i31_ninv31.o.d src/int/i31_ninv31.c -o objdir-CWLITEARM/src/int/i31_ninv31.o\n",
      ".\n",
      "Compiling C: src/int/i31_reduce.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/i31_reduce.lst -MMD -MP -MF .dep/i31_reduce.o.d src/int/i31_reduce.c -o objdir-CWLITEARM/src/int/i31_reduce.o\n",
      ".\n",
      "Compiling C: src/int/i31_rshift.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/i31_rshift.lst -MMD -MP -MF .dep/i31_rshift.o.d src/int/i31_rshift.c -o objdir-CWLITEARM/src/int/i31_rshift.o\n",
      ".\n",
      "Compiling C: src/int/i31_sub.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/i31_sub.lst -MMD -MP -MF .dep/i31_sub.o.d src/int/i31_sub.c -o objdir-CWLITEARM/src/int/i31_sub.o\n",
      ".\n",
      "Compiling C: src/int/i31_tmont.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/i31_tmont.lst -MMD -MP -MF .dep/i31_tmont.o.d src/int/i31_tmont.c -o objdir-CWLITEARM/src/int/i31_tmont.o\n",
      ".\n",
      "Compiling C: src/int/i32_div32.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/i32_div32.lst -MMD -MP -MF .dep/i32_div32.o.d src/int/i32_div32.c -o objdir-CWLITEARM/src/int/i32_div32.o\n",
      ".\n",
      "Compiling C: src/int/mod_rand_pow.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/mod_rand_pow.lst -MMD -MP -MF .dep/mod_rand_pow.o.d src/int/mod_rand_pow.c -o objdir-CWLITEARM/src/int/mod_rand_pow.o\n",
      ".\n",
      "Compiling C: src/rsa/FI-countermeasure.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/FI-countermeasure.lst -MMD -MP -MF .dep/FI-countermeasure.o.d src/rsa/FI-countermeasure.c -o objdir-CWLITEARM/src/rsa/FI-countermeasure.o\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "src/rsa/FI-countermeasure.c: In function 'br_rsa_i31_private_FI':\n",
      "src/rsa/FI-countermeasure.c:337:39: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]\n",
      "  337 |         memcpy(t2 + 1, t1 + 1, (t1[0] + 7 >> 3));\n",
      "      |                                 ~~~~~~^~~\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      ".\n",
      "Compiling C: src/rsa/message_and_exp_blind.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/message_and_exp_blind.lst -MMD -MP -MF .dep/message_and_exp_blind.o.d src/rsa/message_and_exp_blind.c -o objdir-CWLITEARM/src/rsa/message_and_exp_blind.o\n",
      ".\n",
      "Compiling C: src/rsa/modulus_randomization.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/modulus_randomization.lst -MMD -MP -MF .dep/modulus_randomization.o.d src/rsa/modulus_randomization.c -o objdir-CWLITEARM/src/rsa/modulus_randomization.o\n",
      ".\n",
      "Compiling C: src/rsa/pre_randomization.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/pre_randomization.lst -MMD -MP -MF .dep/pre_randomization.o.d src/rsa/pre_randomization.c -o objdir-CWLITEARM/src/rsa/pre_randomization.o\n",
      ".\n",
      "Compiling C: src/rsa/rsa_i31_priv.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/rsa_i31_priv.lst -MMD -MP -MF .dep/rsa_i31_priv.o.d src/rsa/rsa_i31_priv.c -o objdir-CWLITEARM/src/rsa/rsa_i31_priv.o\n",
      ".\n",
      "Compiling C: src/rsa/rsa_i31_pub.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/rsa_i31_pub.lst -MMD -MP -MF .dep/rsa_i31_pub.o.d src/rsa/rsa_i31_pub.c -o objdir-CWLITEARM/src/rsa/rsa_i31_pub.o\n",
      ".\n",
      "Compiling C: src/rsa/rsa_i31_randkey.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/rsa_i31_randkey.lst -MMD -MP -MF .dep/rsa_i31_randkey.o.d src/rsa/rsa_i31_randkey.c -o objdir-CWLITEARM/src/rsa/rsa_i31_randkey.o\n",
      ".\n",
      "Compiling C: src/codec/ccopy.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/ccopy.lst -MMD -MP -MF .dep/ccopy.o.d src/codec/ccopy.c -o objdir-CWLITEARM/src/codec/ccopy.o\n",
      ".\n",
      "Compiling C: src/codec/dec16be.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/dec16be.lst -MMD -MP -MF .dep/dec16be.o.d src/codec/dec16be.c -o objdir-CWLITEARM/src/codec/dec16be.o\n",
      ".\n",
      "Compiling C: src/codec/dec16le.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/dec16le.lst -MMD -MP -MF .dep/dec16le.o.d src/codec/dec16le.c -o objdir-CWLITEARM/src/codec/dec16le.o\n",
      ".\n",
      "Compiling C: src/codec/dec32be.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/dec32be.lst -MMD -MP -MF .dep/dec32be.o.d src/codec/dec32be.c -o objdir-CWLITEARM/src/codec/dec32be.o\n",
      ".\n",
      "Compiling C: src/codec/dec32le.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/dec32le.lst -MMD -MP -MF .dep/dec32le.o.d src/codec/dec32le.c -o objdir-CWLITEARM/src/codec/dec32le.o\n",
      ".\n",
      "Compiling C: src/codec/dec64be.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/dec64be.lst -MMD -MP -MF .dep/dec64be.o.d src/codec/dec64be.c -o objdir-CWLITEARM/src/codec/dec64be.o\n",
      ".\n",
      "Compiling C: src/codec/dec64le.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/dec64le.lst -MMD -MP -MF .dep/dec64le.o.d src/codec/dec64le.c -o objdir-CWLITEARM/src/codec/dec64le.o\n",
      ".\n",
      "Compiling C: src/codec/enc16be.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/enc16be.lst -MMD -MP -MF .dep/enc16be.o.d src/codec/enc16be.c -o objdir-CWLITEARM/src/codec/enc16be.o\n",
      ".\n",
      "Compiling C: src/codec/enc16le.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/enc16le.lst -MMD -MP -MF .dep/enc16le.o.d src/codec/enc16le.c -o objdir-CWLITEARM/src/codec/enc16le.o\n",
      ".\n",
      "Compiling C: src/codec/enc32be.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/enc32be.lst -MMD -MP -MF .dep/enc32be.o.d src/codec/enc32be.c -o objdir-CWLITEARM/src/codec/enc32be.o\n",
      ".\n",
      "Compiling C: src/codec/enc32le.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/enc32le.lst -MMD -MP -MF .dep/enc32le.o.d src/codec/enc32le.c -o objdir-CWLITEARM/src/codec/enc32le.o\n",
      ".\n",
      "Compiling C: src/codec/enc64be.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/enc64be.lst -MMD -MP -MF .dep/enc64be.o.d src/codec/enc64be.c -o objdir-CWLITEARM/src/codec/enc64be.o\n",
      ".\n",
      "Compiling C: src/codec/enc64le.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/enc64le.lst -MMD -MP -MF .dep/enc64le.o.d src/codec/enc64le.c -o objdir-CWLITEARM/src/codec/enc64le.o\n",
      ".\n",
      "Compiling C: src/rand/rand/aesctr_drbg.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/aesctr_drbg.lst -MMD -MP -MF .dep/aesctr_drbg.o.d src/rand/rand/aesctr_drbg.c -o objdir-CWLITEARM/src/rand/rand/aesctr_drbg.o\n",
      ".\n",
      "Compiling C: src/rand/rand/hmac_drbg.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/hmac_drbg.lst -MMD -MP -MF .dep/hmac_drbg.o.d src/rand/rand/hmac_drbg.c -o objdir-CWLITEARM/src/rand/rand/hmac_drbg.o\n",
      ".\n",
      "Compiling C: src/rand/mac/hmac.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/hmac.lst -MMD -MP -MF .dep/hmac.o.d src/rand/mac/hmac.c -o objdir-CWLITEARM/src/rand/mac/hmac.o\n",
      ".\n",
      "Compiling C: src/rand/mac/hmac_ct.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/hmac_ct.lst -MMD -MP -MF .dep/hmac_ct.o.d src/rand/mac/hmac_ct.c -o objdir-CWLITEARM/src/rand/mac/hmac_ct.o\n",
      ".\n",
      "Compiling C: src/rand/hash/dig_oid.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/dig_oid.lst -MMD -MP -MF .dep/dig_oid.o.d src/rand/hash/dig_oid.c -o objdir-CWLITEARM/src/rand/hash/dig_oid.o\n",
      ".\n",
      "Compiling C: src/rand/hash/dig_size.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/dig_size.lst -MMD -MP -MF .dep/dig_size.o.d src/rand/hash/dig_size.c -o objdir-CWLITEARM/src/rand/hash/dig_size.o\n",
      ".\n",
      "Compiling C: src/rand/hash/ghash_ctmul32.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/ghash_ctmul32.lst -MMD -MP -MF .dep/ghash_ctmul32.o.d src/rand/hash/ghash_ctmul32.c -o objdir-CWLITEARM/src/rand/hash/ghash_ctmul32.o\n",
      ".\n",
      "Compiling C: src/rand/hash/ghash_ctmul64.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/ghash_ctmul64.lst -MMD -MP -MF .dep/ghash_ctmul64.o.d src/rand/hash/ghash_ctmul64.c -o objdir-CWLITEARM/src/rand/hash/ghash_ctmul64.o\n",
      ".\n",
      "Compiling C: src/rand/hash/ghash_ctmul.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/ghash_ctmul.lst -MMD -MP -MF .dep/ghash_ctmul.o.d src/rand/hash/ghash_ctmul.c -o objdir-CWLITEARM/src/rand/hash/ghash_ctmul.o\n",
      ".\n",
      "Compiling C: src/rand/hash/ghash_pclmul.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/ghash_pclmul.lst -MMD -MP -MF .dep/ghash_pclmul.o.d src/rand/hash/ghash_pclmul.c -o objdir-CWLITEARM/src/rand/hash/ghash_pclmul.o\n",
      ".\n",
      "Compiling C: src/rand/hash/ghash_pwr8.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/ghash_pwr8.lst -MMD -MP -MF .dep/ghash_pwr8.o.d src/rand/hash/ghash_pwr8.c -o objdir-CWLITEARM/src/rand/hash/ghash_pwr8.o\n",
      ".\n",
      "Compiling C: src/rand/hash/md5.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/md5.lst -MMD -MP -MF .dep/md5.o.d src/rand/hash/md5.c -o objdir-CWLITEARM/src/rand/hash/md5.o\n",
      ".\n",
      "Compiling C: src/rand/hash/md5sha1.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/md5sha1.lst -MMD -MP -MF .dep/md5sha1.o.d src/rand/hash/md5sha1.c -o objdir-CWLITEARM/src/rand/hash/md5sha1.o\n",
      ".\n",
      "Compiling C: src/rand/hash/mgf1.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/mgf1.lst -MMD -MP -MF .dep/mgf1.o.d src/rand/hash/mgf1.c -o objdir-CWLITEARM/src/rand/hash/mgf1.o\n",
      ".\n",
      "Compiling C: src/rand/hash/multihash.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/multihash.lst -MMD -MP -MF .dep/multihash.o.d src/rand/hash/multihash.c -o objdir-CWLITEARM/src/rand/hash/multihash.o\n",
      ".\n",
      "Compiling C: src/rand/hash/sha1.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/sha1.lst -MMD -MP -MF .dep/sha1.o.d src/rand/hash/sha1.c -o objdir-CWLITEARM/src/rand/hash/sha1.o\n",
      ".\n",
      "Compiling C: src/rand/hash/sha2big.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/sha2big.lst -MMD -MP -MF .dep/sha2big.o.d src/rand/hash/sha2big.c -o objdir-CWLITEARM/src/rand/hash/sha2big.o\n",
      ".\n",
      "Compiling C: src/rand/hash/sha2small.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/sha2small.lst -MMD -MP -MF .dep/sha2small.o.d src/rand/hash/sha2small.c -o objdir-CWLITEARM/src/rand/hash/sha2small.o\n",
      ".\n",
      "Compiling C: .././simpleserial/simpleserial.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/simpleserial.lst -MMD -MP -MF .dep/simpleserial.o.d .././simpleserial/simpleserial.c -o objdir-CWLITEARM/simpleserial.o\n",
      ".\n",
      "Compiling C: .././hal//stm32f3/stm32f3_hal.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/stm32f3_hal.lst -MMD -MP -MF .dep/stm32f3_hal.o.d .././hal//stm32f3/stm32f3_hal.c -o objdir-CWLITEARM/stm32f3_hal.o\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "In file included from .././hal//stm32f3/stm32f3xx_hal_def.h:49,\n",
      "                 from .././hal//stm32f3/stm32f3xx_hal_rcc.h:47,\n",
      "                 from .././hal//stm32f3/stm32f3_hal.c:4:\n",
      ".././hal//stm32f3/Legacy/stm32_hal_legacy.h:452:11: warning: \"GPIO_SPEED_HIGH\" redefined\n",
      "  452 |  #define  GPIO_SPEED_HIGH   GPIO_SPEED_FREQ_HIGH\n",
      "      |           ^~~~~~~~~~~~~~~\n",
      ".././hal//stm32f3/Legacy/stm32_hal_legacy.h:439:10: note: this is the location of the previous definition\n",
      "  439 | #define  GPIO_SPEED_HIGH                          GPIO_SPEED_FREQ_VERY_HIGH\n",
      "      |          ^~~~~~~~~~~~~~~\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      ".\n",
      "Compiling C: .././hal//stm32f3/stm32f3_hal_lowlevel.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/stm32f3_hal_lowlevel.lst -MMD -MP -MF .dep/stm32f3_hal_lowlevel.o.d .././hal//stm32f3/stm32f3_hal_lowlevel.c -o objdir-CWLITEARM/stm32f3_hal_lowlevel.o\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "In file included from .././hal//stm32f3/stm32f3xx_hal_def.h:49,\n",
      "                 from .././hal//stm32f3/stm32f3xx_hal_rcc.h:47,\n",
      "                 from .././hal//stm32f3/stm32f3_hal_lowlevel.c:40:\n",
      ".././hal//stm32f3/Legacy/stm32_hal_legacy.h:452:11: warning: \"GPIO_SPEED_HIGH\" redefined\n",
      "  452 |  #define  GPIO_SPEED_HIGH   GPIO_SPEED_FREQ_HIGH\n",
      "      |           ^~~~~~~~~~~~~~~\n",
      ".././hal//stm32f3/Legacy/stm32_hal_legacy.h:439:10: note: this is the location of the previous definition\n",
      "  439 | #define  GPIO_SPEED_HIGH                          GPIO_SPEED_FREQ_VERY_HIGH\n",
      "      |          ^~~~~~~~~~~~~~~\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      ".\n",
      "Compiling C: .././hal//stm32f3/stm32f3_sysmem.c\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I.  -g -I./inc -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSTM32F4 -DCORTEX_M4 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16   -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DSS_VER=SS_VER_1_1 -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -O2 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ -std=gnu99 -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-variable -Wno-strict-prototypes -Wno-missing-prototypes -Wno-pointer-sign -Wno-unused-value -Wno-implicit-function-declaration  -Wa,-adhlns=objdir-CWLITEARM/stm32f3_sysmem.lst -MMD -MP -MF .dep/stm32f3_sysmem.o.d .././hal//stm32f3/stm32f3_sysmem.c -o objdir-CWLITEARM/stm32f3_sysmem.o\n",
      ".\n",
      "Assembling: .././hal//stm32f3/stm32f3_startup.S\n",
      "arm-none-eabi-gcc -c -mcpu=cortex-m4 -I. -x assembler-with-cpp -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -DF_CPU=7372800 -Wa,-gstabs,-adhlns=objdir-CWLITEARM/stm32f3_startup.lst -I.././simpleserial/ -I.././hal/ -I.././hal/ -I.././hal//stm32f3 -I.././hal//stm32f3/CMSIS -I.././hal//stm32f3/CMSIS/core -I.././hal//stm32f3/CMSIS/device -I.././hal//stm32f4/Legacy -I.././simpleserial/ -I.././crypto/ .././hal//stm32f3/stm32f3_startup.S -o objdir-CWLITEARM/stm32f3_startup.o\n",
      ".\n",
      "LINKING:\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/usr/lib/gcc/arm-none-eabi/14.2.0/../../../../arm-none-eabi/bin/ld: /usr/lib/gcc/arm-none-eabi/14.2.0/../../../../arm-none-eabi/lib/thumb/v7e-m/nofp/libg_nano.a(libc_a-closer.o): in function `_close_r':\n",
      "/build/arm-none-eabi-newlib/src/build-nano/arm-none-eabi/thumb/v7e-m/nofp/newlib/../../../../../../newlib-4.5.0.20241231/newlib/libc/reent/closer.c:47:(.text._close_r+0xc): warning: _close is not implemented and will always fail\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "    simpleserial_sca_rsa-CWLITEARM.elf .../usr/lib/gcc/arm-none-eabi/14.2.0/../../../../arm-none-eabi/bin/ld: /usr/lib/gcc/arm-none-eabi/14.2.0/../../../../arm-none-eabi/lib/thumb/v7e-m/nofp/libg_nano.a(libc_a-closer.o): note: the message above does not take linker garbage collection into account\n",
      "/usr/lib/gcc/arm-none-eabi/14.2.0/../../../../arm-none-eabi/bin/ld: /usr/lib/gcc/arm-none-eabi/14.2.0/../../../../arm-none-eabi/lib/thumb/v7e-m/nofp/libg_nano.a(libc_a-fstatr.o): note: the message above does not take linker garbage collection into account\n",
      "/usr/lib/gcc/arm-none-eabi/14.2.0/../../../../arm-none-eabi/bin/ld: /usr/lib/gcc/arm-none-eabi/14.2.0/../../../../arm-none-eabi/lib/thumb/v7e-m/nofp/libg_nano.a(libc_a-signalr.o): note: the message above does not take linker garbage collection into account\n",
      "/usr/lib/gcc/arm-none-eabi/14.2.0/../../../../arm-none-eabi/bin/ld: /usr/lib/gcc/arm-none-eabi/14.2.0/../../../../arm-none-eabi/lib/thumb/v7e-m/nofp/libg_nano.a(libc_a-gettimeofdayr.o): note: the message above does not take linker garbage collection into account\n",
      "/usr/lib/gcc/arm-none-eabi/14.2.0/../../../../arm-none-eabi/bin/ld: /usr/lib/gcc/arm-none-eabi/14.2.0/../../../../arm-none-eabi/lib/thumb/v7e-m/nofp/libg_nano.a(libc_a-isattyr.o): note: the message above does not take linker garbage collection into account\n",
      "/usr/lib/gcc/arm-none-eabi/14.2.0/../../../../arm-none-eabi/bin/ld: /usr/lib/gcc/arm-none-eabi/14.2.0/../../../../arm-none-eabi/lib/thumb/v7e-m/nofp/libg_nano.a(libc_a-signalr.o): note: the message above does not take linker garbage collection into account\n",
      "/usr/lib/gcc/arm-none-eabi/14.2.0/../../../../arm-none-eabi/bin/ld: /usr/lib/gcc/arm-none-eabi/14.2.0/../../../../arm-none-eabi/lib/thumb/v7e-m/nofp/libg_nano.a(libc_a-lseekr.o): note: the message above does not take linker garbage collection into account\n",
      "/usr/lib/gcc/arm-none-eabi/14.2.0/../../../../arm-none-eabi/bin/ld: /usr/lib/gcc/arm-none-eabi/14.2.0/../../../../arm-none-eabi/lib/thumb/v7e-m/nofp/libg_nano.a(libc_a-readr.o): note: the message above does not take linker garbage collection into account\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/usr/lib/gcc/arm-none-eabi/14.2.0/../../../../arm-none-eabi/bin/ld: /usr/lib/gcc/arm-none-eabi/14.2.0/../../../../arm-none-eabi/lib/thumb/v7e-m/nofp/libg_nano.a(libc_a-fstatr.o): in function `_fstat_r':\n",
      "/build/arm-none-eabi-newlib/src/build-nano/arm-none-eabi/thumb/v7e-m/nofp/newlib/../../../../../../newlib-4.5.0.20241231/newlib/libc/reent/fstatr.c:55:(.text._fstat_r+0xe): warning: _fstat is not implemented and will always fail\n",
      "/usr/lib/gcc/arm-none-eabi/14.2.0/../../../../arm-none-eabi/bin/ld: /usr/lib/gcc/arm-none-eabi/14.2.0/../../../../arm-none-eabi/lib/thumb/v7e-m/nofp/libg_nano.a(libc_a-signalr.o): in function `_getpid_r':\n",
      "/build/arm-none-eabi-newlib/src/build-nano/arm-none-eabi/thumb/v7e-m/nofp/newlib/../../../../../../newlib-4.5.0.20241231/newlib/libc/reent/signalr.c:83:(.text._getpid_r+0x0): warning: _getpid is not implemented and will always fail\n",
      "/usr/lib/gcc/arm-none-eabi/14.2.0/../../../../arm-none-eabi/bin/ld: /usr/lib/gcc/arm-none-eabi/14.2.0/../../../../arm-none-eabi/lib/thumb/v7e-m/nofp/libg_nano.a(libc_a-gettimeofdayr.o): in function `_gettimeofday_r':\n",
      "/build/arm-none-eabi-newlib/src/build-nano/arm-none-eabi/thumb/v7e-m/nofp/newlib/../../../../../../newlib-4.5.0.20241231/newlib/libc/reent/gettimeofdayr.c:62:(.text._gettimeofday_r+0xe): warning: _gettimeofday is not implemented and will always fail\n",
      "/usr/lib/gcc/arm-none-eabi/14.2.0/../../../../arm-none-eabi/bin/ld: /usr/lib/gcc/arm-none-eabi/14.2.0/../../../../arm-none-eabi/lib/thumb/v7e-m/nofp/libg_nano.a(libc_a-isattyr.o): in function `_isatty_r':\n",
      "/build/arm-none-eabi-newlib/src/build-nano/arm-none-eabi/thumb/v7e-m/nofp/newlib/../../../../../../newlib-4.5.0.20241231/newlib/libc/reent/isattyr.c:52:(.text._isatty_r+0xc): warning: _isatty is not implemented and will always fail\n",
      "/usr/lib/gcc/arm-none-eabi/14.2.0/../../../../arm-none-eabi/bin/ld: /usr/lib/gcc/arm-none-eabi/14.2.0/../../../../arm-none-eabi/lib/thumb/v7e-m/nofp/libg_nano.a(libc_a-signalr.o): in function `_kill_r':\n",
      "/build/arm-none-eabi-newlib/src/build-nano/arm-none-eabi/thumb/v7e-m/nofp/newlib/../../../../../../newlib-4.5.0.20241231/newlib/libc/reent/signalr.c:53:(.text._kill_r+0xe): warning: _kill is not implemented and will always fail\n",
      "/usr/lib/gcc/arm-none-eabi/14.2.0/../../../../arm-none-eabi/bin/ld: /usr/lib/gcc/arm-none-eabi/14.2.0/../../../../arm-none-eabi/lib/thumb/v7e-m/nofp/libg_nano.a(libc_a-lseekr.o): in function `_lseek_r':\n",
      "/build/arm-none-eabi-newlib/src/build-nano/arm-none-eabi/thumb/v7e-m/nofp/newlib/../../../../../../newlib-4.5.0.20241231/newlib/libc/reent/lseekr.c:49:(.text._lseek_r+0x10): warning: _lseek is not implemented and will always fail\n",
      "/usr/lib/gcc/arm-none-eabi/14.2.0/../../../../arm-none-eabi/bin/ld: /usr/lib/gcc/arm-none-eabi/14.2.0/../../../../arm-none-eabi/lib/thumb/v7e-m/nofp/libg_nano.a(libc_a-readr.o): in function `_read_r':\n",
      "/build/arm-none-eabi-newlib/src/build-nano/arm-none-eabi/thumb/v7e-m/nofp/newlib/../../../../../../newlib-4.5.0.20241231/newlib/libc/reent/readr.c:49:(.text._read_r+0x10): warning: _read is not implemented and will always fail\n",
      "/usr/lib/gcc/arm-none-eabi/14.2.0/../../../../arm-none-eabi/bin/ld: /usr/lib/gcc/arm-none-eabi/14.2.0/../../../../arm-none-eabi/lib/thumb/v7e-m/nofp/libg_nano.a(libc_a-writer.o): in function `_write_r':\n",
      "/build/arm-none-eabi-newlib/src/build-nano/arm-none-eabi/thumb/v7e-m/nofp/newlib/../../../../../../newlib-4.5.0.20241231/newlib/libc/reent/writer.c:49:(.text._write_r+0x10): warning: _write is not implemented and will always fail\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "/usr/lib/gcc/arm-none-eabi/14.2.0/../../../../arm-none-eabi/bin/ld: /usr/lib/gcc/arm-none-eabi/14.2.0/../../../../arm-none-eabi/lib/thumb/v7e-m/nofp/libg_nano.a(libc_a-writer.o): note: the message above does not take linker garbage collection into account\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/usr/lib/gcc/arm-none-eabi/14.2.0/../../../../arm-none-eabi/bin/ld: warning: simpleserial_sca_rsa-CWLITEARM.elf has a LOAD segment with RWX permissions\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Done!\n",
      ".\n",
      "Creating load file for Flash: simpleserial_sca_rsa-CWLITEARM.hex\n",
      "arm-none-eabi-objcopy -O ihex -R .eeprom -R .fuse -R .lock -R .signature simpleserial_sca_rsa-CWLITEARM.elf simpleserial_sca_rsa-CWLITEARM.hex\n",
      ".\n",
      "Creating load file for Flash: simpleserial_sca_rsa-CWLITEARM.bin\n",
      "arm-none-eabi-objcopy -O binary -R .eeprom -R .fuse -R .lock -R .signature simpleserial_sca_rsa-CWLITEARM.elf simpleserial_sca_rsa-CWLITEARM.bin\n",
      ".\n",
      "Creating load file for EEPROM: simpleserial_sca_rsa-CWLITEARM.eep\n",
      "arm-none-eabi-objcopy -j .eeprom --set-section-flags=.eeprom=\"alloc,load\" \\\n",
      "--change-section-lma .eeprom=0 --no-change-warnings -O ihex simpleserial_sca_rsa-CWLITEARM.elf simpleserial_sca_rsa-CWLITEARM.eep || exit 0\n",
      ".\n",
      "Creating Extended Listing: simpleserial_sca_rsa-CWLITEARM.lss\n",
      "arm-none-eabi-objdump -h -S -z simpleserial_sca_rsa-CWLITEARM.elf > simpleserial_sca_rsa-CWLITEARM.lss\n",
      ".\n",
      "Creating Symbol Table: simpleserial_sca_rsa-CWLITEARM.sym\n",
      "arm-none-eabi-nm -n simpleserial_sca_rsa-CWLITEARM.elf > simpleserial_sca_rsa-CWLITEARM.sym\n",
      "Size after:\n",
      "   text\t   data\t    bss\t    dec\t    hex\tfilename\n",
      "  93884\t    100\t   1784\t  95768\t  17618\tsimpleserial_sca_rsa-CWLITEARM.elf\n",
      "+--------------------------------------------------------\n",
      "+ Built for platform CW-Lite Arm \\(STM32F3\\) with:\n",
      "+ CRYPTO_TARGET = NONE\n",
      "+ CRYPTO_OPTIONS = \n",
      "+--------------------------------------------------------\n"
     ]
    }
   ],
   "source": [
    "%%bash -s \"$SS_VER\" \"$PLATFORM\" \"$CRYPTO_TARGET\"\n",
    "rm -rf objdir-$2 objdir .dep\n",
    "make SS_VER=$1 PLATFORM=$2 CRYPTO_TARGET=$3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "id": "c738e78c-9705-46d2-9137-bb4536f2b69d",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Detected known STMF32: STM32F302xB(C)/303xB(C)\n",
      "Extended erase (0x44), this can take ten seconds or more\n",
      "Attempting to program 93991 bytes at 0x8000000\n",
      "STM32F Programming flash...\n",
      "STM32F Reading flash...\n",
      "Verified flash OK, 93991 bytes\n"
     ]
    }
   ],
   "source": [
    "HEXFILE = \"./simpleserial_sca_rsa-\" + PLATFORM + \".hex\"\n",
    "cw.program_target(scope, prog, HEXFILE)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "id": "49fb8c12-2786-47e7-ac5e-bcc62d7eba23",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1000 128\n"
     ]
    }
   ],
   "source": [
    "import os\n",
    "DATA_LEN=128\n",
    "RESP_LEN=128\n",
    "\n",
    "textin_array = []\n",
    "for _ in range(1000):\n",
    "    textin_array.append(os.urandom(DATA_LEN))\n",
    "\n",
    "print(len(textin_array),len(textin_array[0]) )"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "a2434092-4c55-4c60-ae87-6a505442ea19",
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'trace_array' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[0;32mIn[10], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;28mlen\u001b[39m(\u001b[43mtrace_array\u001b[49m))\n\u001b[1;32m      2\u001b[0m trace_array \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mlist\u001b[39m(trace_array)\n",
      "\u001b[0;31mNameError\u001b[0m: name 'trace_array' is not defined"
     ]
    }
   ],
   "source": [
    "print(len(trace_array))\n",
    "trace_array = list(trace_array)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "id": "b3032ff0-0fb1-4ca5-977f-06b4a835242c",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1000/1000 [02:58<00:00,  5.60it/s]\n"
     ]
    }
   ],
   "source": [
    "from tqdm import tqdm\n",
    "trace_array = []\n",
    "output = []\n",
    "\n",
    "CMD_TEST = 'c'\n",
    "\n",
    "scope.adc.samples = 7000\n",
    "scope.adc.decimate = 1\n",
    "scope.clock.adc_src = 'clkgen_x1'\n",
    "scope.gain.db = 30\n",
    "\n",
    "for i in tqdm(range(len(textin_array))):\n",
    "    target.flush()\n",
    "    scope.arm()\n",
    "    target.simpleserial_write(CMD_TEST,textin_array[i])\n",
    "    scope.capture()\n",
    "    output.append(target.simpleserial_read('r', RESP_LEN, timeout=0))\n",
    "    trace_array.append(scope.get_last_trace())\n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "id": "4ef4d90a-2d95-4d26-afed-92ce1b2081fd",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 30112 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "bytearray(b'rsa ret: 0 konec\\x00\\xb90\\xb2\\x8e\\xf9:\\x04\\x03s\\x1e]\\xb10\\x17\\xd1\\xa3\\xf2\\xa2Z\\xf6Q_\\xc1\\xa2A;\\x82\\xa6\\x9a\\xa7\\x9e\\x96\\x95w\\xd3Z\\x9fo\\r\\x9e\\xef\\t\\x81\\x03\\xb2>\\xb1V\\xff1\\xb1@5\\xfdqJ\\x9b\\xaa\\xfbul\\xaf\\x05\\x1c\\xc5\\xd1EUemC\\xe1\\xb9\\xbf\\x8a\\x9d\\x0f\\xb8j\\xc9q3\\\\\\xaak\\xa9\\xd4\\x00G\\xd5\\xd7\\xb7x_\\xd7\\xf2\\xea\\x7f\\xc5\\xfa\\xa2\\xab\\xce\\x7f%\\xd1\\\\Q\\xd1)\\x9d')\n",
      "b'+\\x18YW\\x04\\xd6\\xa9\\xd0\\x10\\xff\\x95H\\x05\\x0b k~F\\x81|8/\\x8d\\x17\\xe6}iTj\\xf8I\\x83s\\x96\\x075\\x96R<+D\\xed\\xd7\\x80\\xb1\\xac\\xb6.K\\xb6I\\xa1\"3\\xa5\\xcdk\\x0eWo9X\\x8b\\x94\\xf4X\\xd2\\n\\xbe\\x1cM3\\xbc!s\\x9e\\x96\\x99UKB{Mzb\\xba\\xb73\\r!\\x9a\\xdaM\\xfb\\xb2\\x9f,\\xf0\\x8e1\\xc8\\xfa\\x8agS\\xa3n\\x1c\\xe64t\\xfe\\'\\rPD3\\xd8\\xa4a\\xd1\\x0c\\xd1S\\xa1\\xa5\\x9f\\x98'\n"
     ]
    }
   ],
   "source": [
    "plt.plot(trace_array[1])\n",
    "plt.show()\n",
    "print(output[0])\n",
    "print(textin_array[0])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 82,
   "id": "def89494-4cfc-4fc8-9689-372681d677b3",
   "metadata": {},
   "outputs": [],
   "source": [
    "scope.dis()\n",
    "target.dis()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 84,
   "id": "ddf3e115-6c89-4674-8e6a-3db3432fdc91",
   "metadata": {},
   "outputs": [],
   "source": [
    "#0x29 0xC0 -> 00101 00111 00000 \n",
    "#00101, 00111 "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "07736322-7292-465e-82ef-c78d7bb2c4e5",
   "metadata": {},
   "outputs": [],
   "source": [
    "def simulate_intermediate(c, dq_guess_chunk, q):\n",
    "    intermediate = pow(c, dq_guess_chunk, q)\n",
    "    return intermediate\n",
    "\n",
    "import numpy as np\n",
    "\n",
    "def simulate_intermediate_montgomery(c, dq_guess_chunk, q): \n",
    "    R_bits = 31 * 18\n",
    "    R_inv = pow(2, -R_bits, q)\n",
    "    base_pow = pow(c, dq_guess_chunk + 1, q)\n",
    "    intermediate = (base_pow * R_inv) % q\n",
    "    return intermediate\n",
    "\n",
    "def hamming_weight(x):\n",
    "    return bin(x).count(\"1\")\n",
    "\n",
    "def fopt_model(textin_array, dq_guess_chunk, q):\n",
    "    hw_values = []\n",
    "    for c_bytes in textin_array:\n",
    "        c = int.from_bytes(c_bytes, byteorder='big')\n",
    "        interm = simulate_intermediate_montgomery(c, dq_guess_chunk, q)\n",
    "        hw_values.append(hamming_weight(interm))\n",
    "    hw_values = np.array(hw_values, dtype=np.float64)\n",
    "    return hw_values - np.mean(hw_values)\n",
    "\n",
    "def compute_pearson_corr(x, Y):\n",
    "    \"\"\"\n",
    "    Vectorized Pearson correlation between 1D x and each column of 2D Y.\n",
    "    Returns array of correlations.\n",
    "    \"\"\"\n",
    "    x_centered = x - np.mean(x)\n",
    "    Y_centered = Y - np.mean(Y, axis=0)\n",
    "    numerator = np.dot(x_centered, Y_centered)\n",
    "    denominator = np.linalg.norm(x_centered) * np.linalg.norm(Y_centered, axis=0)\n",
    "    return numerator / denominator"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "d4748c52-9b42-4098-b9d5-059025bd5d62",
   "metadata": {},
   "outputs": [
    {
     "ename": "AttributeError",
     "evalue": "'list' object has no attribute 'shape'",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mAttributeError\u001b[0m                            Traceback (most recent call last)",
      "Cell \u001b[0;32mIn[22], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[43mtrace_array\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mshape\u001b[49m\n",
      "\u001b[0;31mAttributeError\u001b[0m: 'list' object has no attribute 'shape'"
     ]
    }
   ],
   "source": [
    "trace_array.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "id": "cd4f161a-13ef-407f-9e6b-53bbba3dc736",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/tmp/ipykernel_435005/4123098245.py:31: RuntimeWarning: invalid value encountered in scalar divide\n",
      "  return numerator / denominator\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Guess 0 -> HW max corr: 0.0000, HD max corr: 0.0991\n",
      "Guess 1 -> HW max corr: 0.1009, HD max corr: 0.0000\n",
      "Guess 2 -> HW max corr: 0.1242, HD max corr: 0.1337\n",
      "Guess 3 -> HW max corr: 0.1081, HD max corr: 0.1077\n",
      "Guess 4 -> HW max corr: 0.1276, HD max corr: 0.1303\n",
      "Guess 5 -> HW max corr: 0.1176, HD max corr: 0.1050\n",
      "Guess 6 -> HW max corr: 0.1168, HD max corr: 0.1080\n",
      "Guess 7 -> HW max corr: 0.1062, HD max corr: 0.0999\n",
      "\n",
      "Best guess (HW model) for 3-bit chunk: 4 (corr = 0.1276)\n",
      "Best guess (HD model) for 3-bit chunk: 2 (corr = 0.1337)\n"
     ]
    }
   ],
   "source": [
    "import numpy as np\n",
    "\n",
    "# Assumed externally defined:\n",
    "# - textin_array: list/array of ciphertexts (c values)\n",
    "# - trace_array: array of shape (num_traces, time_points)\n",
    "# - simulate_intermediate(c, guess, q)\n",
    "# - hamming_weight(x)\n",
    "# - compute_pearson_corr(x, y)\n",
    "\n",
    "k = 3  # Bit chunk size\n",
    "num_traces = len(textin_array)\n",
    "num_candidates = 2 ** k\n",
    "scores_hw = np.zeros(num_candidates)\n",
    "scores_hd = np.zeros(num_candidates)\n",
    "\n",
    "# Known CRT modulus q\n",
    "q = 11127451346678512622412585182899846101655365672495679031842560923217252564237240561671421628805571540290463534786958097707130953121832165473634942505464047\n",
    "\n",
    "trace_array = np.asarray(trace_array)  # shape: (num_traces, time_points)\n",
    "num_time_points = trace_array.shape[1]\n",
    "\n",
    "# For Hamming Distance, we need previous state:\n",
    "# Let's assume prior state is just 'c' itself (plaintext in mod q)\n",
    "# You may update this depending on your leakage model\n",
    "\n",
    "for guess in range(num_candidates):\n",
    "    predicted_leakage_hw = np.zeros(num_traces)\n",
    "    predicted_leakage_hd = np.zeros(num_traces)\n",
    "\n",
    "    for i, c_bytes in enumerate(textin_array):\n",
    "        c = int.from_bytes(c_bytes, byteorder='big')  # Convert bytes to int\n",
    "        interm = simulate_intermediate(c, guess, q)\n",
    "        predicted_leakage_hw[i] = hamming_weight(interm)\n",
    "\n",
    "        prev_val = c % q\n",
    "        hd_val = prev_val ^ interm\n",
    "        predicted_leakage_hd[i] = hamming_weight(hd_val)\n",
    "\n",
    "\n",
    "    # Compute max correlation over all time samples\n",
    "    max_corr_hw = 0\n",
    "    max_corr_hd = 0\n",
    "    for t in range(num_time_points):\n",
    "        power_sample = trace_array[:, t]\n",
    "        corr_hw = abs(compute_pearson_corr(predicted_leakage_hw, power_sample))\n",
    "        corr_hd = abs(compute_pearson_corr(predicted_leakage_hd, power_sample))\n",
    "\n",
    "        if corr_hw > max_corr_hw:\n",
    "            max_corr_hw = corr_hw\n",
    "        if corr_hd > max_corr_hd:\n",
    "            max_corr_hd = corr_hd\n",
    "\n",
    "    scores_hw[guess] = max_corr_hw\n",
    "    scores_hd[guess] = max_corr_hd\n",
    "\n",
    "    print(f\"Guess {guess:0{(k+3)//4}x} -> HW max corr: {max_corr_hw:.4f}, HD max corr: {max_corr_hd:.4f}\")\n",
    "\n",
    "# Final results\n",
    "best_guess_hw = int(np.argmax(scores_hw))\n",
    "best_guess_hd = int(np.argmax(scores_hd))\n",
    "\n",
    "print(f\"\\nBest guess (HW model) for {k}-bit chunk: {best_guess_hw} (corr = {scores_hw[best_guess_hw]:.4f})\")\n",
    "print(f\"Best guess (HD model) for {k}-bit chunk: {best_guess_hd} (corr = {scores_hd[best_guess_hd]:.4f})\")\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "id": "01dccac6-f0ba-4a27-b4f0-dba16767ff63",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 57512 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "\n",
    "plt.plot(range(len(scores_hd)), scores_hd, label=\"HD model\")\n",
    "plt.plot(range(len(scores_hw)), scores_hw, label=\"HW model\")\n",
    "plt.axvline(x=4, color='green', linestyle='--', label=\"Correct key\")\n",
    "plt.xlabel(\"Guess\")\n",
    "plt.ylabel(\"Max Correlation\")\n",
    "plt.title(\"CPA: Correlation per 3-bit guess\")\n",
    "plt.legend()\n",
    "plt.grid()\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "id": "a616af1e-c332-45b2-b3d5-1655f50b6bd3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 55956 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "guess = 4\n",
    "model = np.array([hamming_weight(simulate_intermediate(int.from_bytes(c, 'big'), guess, q)) for c in textin_array])\n",
    "corrs = [compute_pearson_corr(model, trace_array[:, t]) for t in range(trace_array.shape[1])]\n",
    "\n",
    "plt.plot(corrs)\n",
    "plt.title(\"Correlation over time for correct guess (HD)\")\n",
    "plt.xlabel(\"Time sample\")\n",
    "plt.ylabel(\"Correlation\")\n",
    "plt.grid()\n",
    "plt.show()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "id": "4f6a105d-a4d3-40e0-9621-bc02c75822d9",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Guess 0 -> 2nd-order max corr: 0.0799\n",
      "Guess 1 -> 2nd-order max corr: 0.0866\n",
      "Guess 2 -> 2nd-order max corr: 0.1011\n",
      "Guess 3 -> 2nd-order max corr: 0.1051\n",
      "Guess 4 -> 2nd-order max corr: 0.0814\n",
      "Guess 5 -> 2nd-order max corr: 0.0806\n",
      "Guess 6 -> 2nd-order max corr: 0.0939\n",
      "Guess 7 -> 2nd-order max corr: 0.0863\n",
      "\n",
      "Best guess (2nd-order HW model) for 3-bit chunk: 3 (corr = 0.1051)\n"
     ]
    }
   ],
   "source": [
    "import numpy as np\n",
    "\n",
    "def simulate_intermediate_montgomery(c, dq_guess_chunk, q): \n",
    "    R_bits = 31 * 18\n",
    "    R_inv = pow(2, -R_bits, q)\n",
    "    base_pow = pow(c, dq_guess_chunk + 1, q)\n",
    "    intermediate = (base_pow * R_inv) % q\n",
    "    return intermediate\n",
    "\n",
    "def hamming_weight(x):\n",
    "    return bin(x).count(\"1\")\n",
    "\n",
    "def fopt_model(textin_array, dq_guess_chunk, q):\n",
    "    hw_values = []\n",
    "    for c_bytes in textin_array:\n",
    "        c = int.from_bytes(c_bytes, byteorder='big')\n",
    "        interm = simulate_intermediate_montgomery(c, dq_guess_chunk, q)\n",
    "        hw_values.append(hamming_weight(interm))\n",
    "    hw_values = np.array(hw_values, dtype=np.float64)\n",
    "    return hw_values - np.mean(hw_values)\n",
    "\n",
    "def compute_pearson_corr(x, Y):\n",
    "    \"\"\"\n",
    "    Vectorized Pearson correlation between 1D x and each column of 2D Y.\n",
    "    Returns array of correlations.\n",
    "    \"\"\"\n",
    "    x_centered = x - np.mean(x)\n",
    "    Y_centered = Y - np.mean(Y, axis=0)\n",
    "    numerator = np.dot(x_centered, Y_centered)\n",
    "    denominator = np.linalg.norm(x_centered) * np.linalg.norm(Y_centered, axis=0)\n",
    "    return numerator / denominator\n",
    "\n",
    "# Parameters\n",
    "k = 3\n",
    "num_candidates = 2 ** k\n",
    "q = 11127451346678512622412585182899846101655365672495679031842560923217252564237240561671421628805571540290463534786958097707130953121832165473634942505464047\n",
    "\n",
    "# Window the trace to focus around leakage\n",
    "trace_array = np.asarray(trace_array)\n",
    "window = trace_array[:, 1000:1200]  # Adjust as needed\n",
    "num_traces, num_points = window.shape\n",
    "\n",
    "# Step 1: center the traces once\n",
    "window_centered = window - np.mean(window, axis=0, keepdims=True)  # shape: (N, T)\n",
    "\n",
    "# Step 2: build all pairwise products (N, T * (T+1)//2)\n",
    "products = []\n",
    "indices = []\n",
    "for i in range(num_points):\n",
    "    for j in range(i, num_points):\n",
    "        prod = window_centered[:, i] * window_centered[:, j]\n",
    "        products.append(prod)\n",
    "        indices.append((i, j))\n",
    "product_matrix = np.stack(products, axis=1)  # shape: (N, M) where M = num_combinations\n",
    "\n",
    "# Step 3: attack loop\n",
    "scores_sop = np.zeros(num_candidates)\n",
    "\n",
    "for guess in range(num_candidates):\n",
    "    model = fopt_model(textin_array, guess, q)  # shape: (N,)\n",
    "    corr = np.abs(compute_pearson_corr(model, product_matrix))  # vector of correlations\n",
    "    scores_sop[guess] = np.max(corr)\n",
    "\n",
    "    print(f\"Guess {guess:0{(k+3)//4}x} -> 2nd-order max corr: {scores_sop[guess]:.4f}\")\n",
    "\n",
    "# Final result\n",
    "best_guess = int(np.argmax(scores_sop))\n",
    "print(f\"\\nBest guess (2nd-order HW model) for {k}-bit chunk: {best_guess} (corr = {scores_sop[best_guess]:.4f})\")\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "fd9775ef-5e66-4280-a43a-45cdbef62076",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
