Add Wi-Fi example for RW-612

This commit is contained in:
Sergio R. Caprile committed 2025-06-06 18:26:27 -03:00
1 parent e529e644ab
commit d7d7ebf99a
620 files changed
+444542

No files matched your search

@@ -0,0 +1,920 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
<storageModule moduleId="org.eclipse.cdt.core.settings">
<cconfiguration id="com.crt.advproject.config.exe.debug.252552941">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.crt.advproject.config.exe.debug.252552941" moduleId="org.eclipse.cdt.core.settings" name="Debug">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GNU_ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactExtension="axf" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf" description="Debug build" errorParsers="org.eclipse.cdt.core.CWDLocator;org.eclipse.cdt.core.GmakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.GASErrorParser" id="com.crt.advproject.config.exe.debug.252552941" name="Debug" parent="com.crt.advproject.config.exe.debug" postannouncebuildStep="Performing post-build steps" postbuildStep="arm-none-eabi-size &quot;${BuildArtifactFileName}&quot;; # arm-none-eabi-objcopy -v -O binary &quot;${BuildArtifactFileName}&quot; &quot;${BuildArtifactFileBaseName}.bin&quot; ; # checksum -p ${TargetChip} -d &quot;${BuildArtifactFileBaseName}.bin&quot;; ">
<folderInfo id="com.crt.advproject.config.exe.debug.252552941." name="/" resourcePath="">
<toolChain id="com.crt.advproject.toolchain.exe.debug.1082653760" name="NXP MCU Tools" superClass="com.crt.advproject.toolchain.exe.debug">
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF;org.eclipse.cdt.core.GNU_ELF" id="com.crt.advproject.platform.exe.debug.1289303214" name="ARM-based MCU (Debug)" superClass="com.crt.advproject.platform.exe.debug"/>
<builder buildPath="${workspace_loc:/frdmrw612_wifi_webconfig}/Debug" id="com.crt.advproject.builder.exe.debug.1379385878" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="com.crt.advproject.builder.exe.debug"/>
<tool id="com.crt.advproject.cpp.exe.debug.20078202" name="MCU C++ Compiler" superClass="com.crt.advproject.cpp.exe.debug">
<option id="com.crt.advproject.cpp.hdrlib.1969693279" name="Library headers" superClass="com.crt.advproject.cpp.hdrlib" useByScannerDiscovery="false"/>
<option id="com.crt.advproject.cpp.fpu.861184837" name="Floating point" superClass="com.crt.advproject.cpp.fpu" useByScannerDiscovery="true" value="com.crt.advproject.cpp.fpu.none" valueType="enumerated"/>
<option id="com.crt.advproject.cpp.arch.735046025" name="Architecture" superClass="com.crt.advproject.cpp.arch" useByScannerDiscovery="true" value="com.crt.advproject.cpp.target.cm33_nodsp" valueType="enumerated"/>
<option id="com.crt.advproject.cpp.misc.dialect.1816397705" name="Language standard" superClass="com.crt.advproject.cpp.misc.dialect" useByScannerDiscovery="true"/>
<option id="gnu.cpp.compiler.option.dialect.flags.748933619" name="Other dialect flags" superClass="gnu.cpp.compiler.option.dialect.flags" useByScannerDiscovery="true"/>
<option id="gnu.cpp.compiler.option.preprocessor.nostdinc.942118609" name="Do not search system directories (-nostdinc)" superClass="gnu.cpp.compiler.option.preprocessor.nostdinc" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.preprocessor.preprocess.1468896151" name="Preprocess only (-E)" superClass="gnu.cpp.compiler.option.preprocessor.preprocess" useByScannerDiscovery="false"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.cpp.compiler.option.preprocessor.def.1357365192" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" useByScannerDiscovery="false" valueType="definedSymbols">
<listOptionValue builtIn="false" value="__NEWLIB__"/>
</option>
<option id="gnu.cpp.compiler.option.preprocessor.undef.1769120289" name="Undefined symbols (-U)" superClass="gnu.cpp.compiler.option.preprocessor.undef" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.include.paths.1863145991" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.include.files.1778273605" name="Include files (-include)" superClass="gnu.cpp.compiler.option.include.files" useByScannerDiscovery="false"/>
<option id="com.crt.advproject.cpp.exe.debug.option.optimization.level.260353844" name="Optimization Level" superClass="com.crt.advproject.cpp.exe.debug.option.optimization.level" useByScannerDiscovery="true"/>
<option id="gnu.cpp.compiler.option.optimization.flags.1353853346" name="Other optimization flags" superClass="gnu.cpp.compiler.option.optimization.flags" useByScannerDiscovery="false" value="-fno-common" valueType="string"/>
<option id="com.crt.advproject.cpp.exe.debug.option.debugging.level.78129211" name="Debug Level" superClass="com.crt.advproject.cpp.exe.debug.option.debugging.level" useByScannerDiscovery="false"/>
<option id="com.crt.advproject.cpp.exe.debug.option.debugging.other.395162337" name="Other debugging flags" superClass="com.crt.advproject.cpp.exe.debug.option.debugging.other" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.debugging.prof.1203773350" name="Generate prof information (-p)" superClass="gnu.cpp.compiler.option.debugging.prof" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.debugging.gprof.1525320205" name="Generate gprof information (-pg)" superClass="gnu.cpp.compiler.option.debugging.gprof" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.debugging.codecov.1866702658" name="Generate gcov information (-ftest-coverage -fprofile-arcs)" superClass="gnu.cpp.compiler.option.debugging.codecov" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.debugging.sanitaddress.1830476164" name="Sanitize address (-fsanitize=address)" superClass="gnu.cpp.compiler.option.debugging.sanitaddress" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.debugging.sanitpointers.1677754101" name="Sanitize pointer operations (-fsanitize=pointer-compare -fsanitize=pointer-subtract)" superClass="gnu.cpp.compiler.option.debugging.sanitpointers" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.debugging.sanitthread.415134260" name="Sanitize data race in multi-thread (-fsanitize=thread)" superClass="gnu.cpp.compiler.option.debugging.sanitthread" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.debugging.sanitleak.828910286" name="Sanitize memory leak (-fsanitize=leak)" superClass="gnu.cpp.compiler.option.debugging.sanitleak" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.debugging.sanitundef.1685807034" name="Sanitize undefined behavior (-fsanitize=undefined)" superClass="gnu.cpp.compiler.option.debugging.sanitundef" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.warnings.syntax.1817813827" name="Check syntax only (-fsyntax-only)" superClass="gnu.cpp.compiler.option.warnings.syntax" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.warnings.pedantic.807221211" name="Pedantic (-pedantic)" superClass="gnu.cpp.compiler.option.warnings.pedantic" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.warnings.pedantic.error.45396858" name="Pedantic warnings as errors (-pedantic-errors)" superClass="gnu.cpp.compiler.option.warnings.pedantic.error" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.warnings.nowarn.778770183" name="Inhibit all warnings (-w)" superClass="gnu.cpp.compiler.option.warnings.nowarn" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.warnings.allwarn.411834116" name="All warnings (-Wall)" superClass="gnu.cpp.compiler.option.warnings.allwarn" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.warnings.extrawarn.1688039191" name="Extra warnings (-Wextra)" superClass="gnu.cpp.compiler.option.warnings.extrawarn" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.warnings.toerrors.1257378271" name="Warnings as errors (-Werror)" superClass="gnu.cpp.compiler.option.warnings.toerrors" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.warnings.wconversion.1743548296" name="Implicit conversion warnings (-Wconversion)" superClass="gnu.cpp.compiler.option.warnings.wconversion" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.warnings.wcastalign.482852757" name="Pointer cast with different alignment (-Wcast-align)" superClass="gnu.cpp.compiler.option.warnings.wcastalign" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.warnings.wcastqual.1891511534" name="Removing type qualifier from cast target type (-Wcast-qual)" superClass="gnu.cpp.compiler.option.warnings.wcastqual" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.warnings.wctordtorprivacy.874831981" name="All ctor and dtor private (-Wctor-dtor-privacy)" superClass="gnu.cpp.compiler.option.warnings.wctordtorprivacy" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.warnings.wdisabledopt.498402479" name="Requested optimization pass is disabled (-Wdisabled-optimization)" superClass="gnu.cpp.compiler.option.warnings.wdisabledopt" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.warnings.wlogicalop.1621777758" name="Suspicious uses of logical operators (-Wlogical-op)" superClass="gnu.cpp.compiler.option.warnings.wlogicalop" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.warnings.wmissingdecl.1856533978" name="Global function without previous declaration (-Wmissing-declarations)" superClass="gnu.cpp.compiler.option.warnings.wmissingdecl" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.warnings.wmissingincdir.995129754" name="User-supplied include directory does not exist (-Wmissing-include-dirs)" superClass="gnu.cpp.compiler.option.warnings.wmissingincdir" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.warnings.wnoexccept.144110502" name="Noexcept false but never throw exception (-Wnoexcept)" superClass="gnu.cpp.compiler.option.warnings.wnoexccept" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.warnings.woldstylecast.563047915" name="C-style cast used (-Wold-style-cast)" superClass="gnu.cpp.compiler.option.warnings.woldstylecast" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.warnings.woverloadedvirtual.1278041292" name="Function hides virtual functions from base class (-Woverloaded-virtual)" superClass="gnu.cpp.compiler.option.warnings.woverloadedvirtual" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.warnings.wredundantdecl.2049252630" name="More than one declaration in the same scope (-Wredundant-decls)" superClass="gnu.cpp.compiler.option.warnings.wredundantdecl" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.warnings.wshadow.800332262" name="Local symbol shadows upper scope symbol (-Wshadow)" superClass="gnu.cpp.compiler.option.warnings.wshadow" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.warnings.wsignconv.1090419937" name="Implicit conversions that may change the sign (-Wsign-conversion)" superClass="gnu.cpp.compiler.option.warnings.wsignconv" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.warnings.wsignpromo.1914548782" name="Overload resolution promotes unsigned to signed type (-Wsign-promo)" superClass="gnu.cpp.compiler.option.warnings.wsignpromo" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.warnings.wstrictnullsent.514583760" name="Use of an uncasted NULL as sentinel (-Wstrict-null-sentinel)" superClass="gnu.cpp.compiler.option.warnings.wstrictnullsent" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.warnings.wswitchdef.1412252291" name="A switch statement does not have a default case (-Wswitch-default)" superClass="gnu.cpp.compiler.option.warnings.wswitchdef" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.warnings.wundef.316162512" name="An undefined identifier is evaluated in an #if directive (-Wundef)" superClass="gnu.cpp.compiler.option.warnings.wundef" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.warnings.weffcpp.1382236666" name="Effective C++ guidelines (-Weffc++)" superClass="gnu.cpp.compiler.option.warnings.weffcpp" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.warnings.wfloatequal.540622252" name="Direct float equal check (-Wfloat-equal)" superClass="gnu.cpp.compiler.option.warnings.wfloatequal" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.other.other.1390627875" name="Other flags" superClass="gnu.cpp.compiler.option.other.other" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.other.otherExcludedFromScannerDiscovery.2124331980" name="Other flags (excluded from discovery)" superClass="gnu.cpp.compiler.option.other.otherExcludedFromScannerDiscovery" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.other.verbose.1822855032" name="Verbose (-v)" superClass="gnu.cpp.compiler.option.other.verbose" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.other.pic.766511103" name="Position Independent Code (-fPIC)" superClass="gnu.cpp.compiler.option.other.pic" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.misc.hardening.896557953" name="Hardening options (-fstack-protector-all -Wformat=2 -Wformat-security -Wstrict-overflow)" superClass="gnu.cpp.compiler.option.misc.hardening" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.misc.randomization.102048143" name="Address randomization (-fPIE)" superClass="gnu.cpp.compiler.option.misc.randomization" useByScannerDiscovery="false"/>
<option id="com.crt.advproject.cpp.lto.830439902" name="Enable Link-time optimization (-flto)" superClass="com.crt.advproject.cpp.lto" useByScannerDiscovery="false"/>
<option id="com.crt.advproject.cpp.lto.fat.1031319388" name="Fat lto objects (-ffat-lto-objects)" superClass="com.crt.advproject.cpp.lto.fat" useByScannerDiscovery="false"/>
<option id="com.crt.advproject.cpp.merge.constants.1114784875" name="Merge Identical Constants (-fmerge-constants)" superClass="com.crt.advproject.cpp.merge.constants" useByScannerDiscovery="false"/>
<option id="com.crt.advproject.cpp.prefixmap.2042027540" name="Remove path from __FILE__ (-fmacro-prefix-map)" superClass="com.crt.advproject.cpp.prefixmap" useByScannerDiscovery="false"/>
<option id="com.crt.advproject.cpp.thumb.487042530" name="Thumb mode" superClass="com.crt.advproject.cpp.thumb" useByScannerDiscovery="false"/>
<option id="com.crt.advproject.cpp.thumbinterwork.843678497" name="Enable Thumb interworking" superClass="com.crt.advproject.cpp.thumbinterwork" useByScannerDiscovery="false"/>
<option id="com.crt.advproject.cpp.securestate.800498490" name="TrustZone Project Type" superClass="com.crt.advproject.cpp.securestate" useByScannerDiscovery="false"/>
<option id="com.crt.advproject.cpp.specs.187448052" name="Specs" superClass="com.crt.advproject.cpp.specs" useByScannerDiscovery="false" value="com.crt.advproject.cpp.specs.newlibnano" valueType="enumerated"/>
<option id="com.crt.advproject.cpp.stackusage.894379153" name="Generate Stack Usage Info (-fstack-usage)" superClass="com.crt.advproject.cpp.stackusage" useByScannerDiscovery="false"/>
<option id="com.crt.advproject.cpp.config.755619280" name="Obsolete (Config)" superClass="com.crt.advproject.cpp.config" useByScannerDiscovery="false"/>
<option id="com.crt.advproject.cpp.store.1067173068" name="Obsolete (Store)" superClass="com.crt.advproject.cpp.store" useByScannerDiscovery="false"/>
</tool>
<tool id="com.crt.advproject.gcc.exe.debug.587026796" name="MCU C Compiler" superClass="com.crt.advproject.gcc.exe.debug">
<option id="com.crt.advproject.gcc.hdrlib.1922178190" name="Library headers" superClass="com.crt.advproject.gcc.hdrlib" useByScannerDiscovery="false" value="com.crt.advproject.gcc.hdrlib.newlibnano" valueType="enumerated"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.c.compiler.option.preprocessor.def.symbols.296857998" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols">
<listOptionValue builtIn="false" value="LWIP_TIMEVAL_PRIVATE=0"/>
<listOptionValue builtIn="false" value="FSL_SDK_DRIVER_QUICK_ACCESS_ENABLE=1"/>
<listOptionValue builtIn="false" value="USE_RTOS=1"/>
<listOptionValue builtIn="false" value="PRINTF_ADVANCED_ENABLE=1"/>
<listOptionValue builtIn="false" value="LWIP_NETIF_API=1"/>
<listOptionValue builtIn="false" value="HTTPSRV_CFG_WEBSOCKET_ENABLED=1"/>
<listOptionValue builtIn="false" value="HTTPSRV_CFG_DEFAULT_SES_CNT=8"/>
<listOptionValue builtIn="false" value="SDK_DEBUGCONSOLE_UART"/>
<listOptionValue builtIn="false" value="CPU_RW612ETA2I"/>
<listOptionValue builtIn="false" value="MCUXPRESSO_SDK"/>
<listOptionValue builtIn="false" value="BOOT_HEADER_ENABLE=1"/>
<listOptionValue builtIn="false" value="MFLASH_FILE_BASEADDR=7340032"/>
<listOptionValue builtIn="false" value="FSL_OSA_TASK_ENABLE=1"/>
<listOptionValue builtIn="false" value="OSA_USED"/>
<listOptionValue builtIn="false" value="LWIP_DNS=1"/>
<listOptionValue builtIn="false" value="LWIP_NETIF_HOSTNAME=1"/>
<listOptionValue builtIn="false" value="LWIP_IGMP=1"/>
<listOptionValue builtIn="false" value="_XOPEN_SOURCE=500"/>
<listOptionValue builtIn="false" value="SO_REUSE=1"/>
<listOptionValue builtIn="false" value="SDK_OS_FREE_RTOS"/>
<listOptionValue builtIn="false" value="SERIAL_PORT_TYPE_UART=1"/>
<listOptionValue builtIn="false" value="CPU_RW612ETA2I_cm33_nodsp"/>
<listOptionValue builtIn="false" value="SDK_DEBUGCONSOLE=1"/>
<listOptionValue builtIn="false" value="CR_INTEGER_PRINTF"/>
<listOptionValue builtIn="false" value="__MCUXPRESSO"/>
<listOptionValue builtIn="false" value="__USE_CMSIS"/>
<listOptionValue builtIn="false" value="DEBUG"/>
<listOptionValue builtIn="false" value="__NEWLIB__"/>
</option>
<option id="com.crt.advproject.gcc.fpu.1016306384" name="Floating point" superClass="com.crt.advproject.gcc.fpu" useByScannerDiscovery="true" value="com.crt.advproject.gcc.fpu.fpv5sp.hard" valueType="enumerated"/>
<option id="com.crt.advproject.gcc.thumb.452284926" name="Thumb mode" superClass="com.crt.advproject.gcc.thumb" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<option id="com.crt.advproject.gcc.arch.569256829" name="Architecture" superClass="com.crt.advproject.gcc.arch" useByScannerDiscovery="true" value="com.crt.advproject.gcc.target.cm33_nodsp" valueType="enumerated"/>
<option id="com.crt.advproject.c.misc.dialect.514925729" name="Language standard" superClass="com.crt.advproject.c.misc.dialect" useByScannerDiscovery="true" value="com.crt.advproject.misc.dialect.gnu99" valueType="enumerated"/>
<option id="gnu.c.compiler.option.dialect.flags.444085703" name="Other dialect flags" superClass="gnu.c.compiler.option.dialect.flags" useByScannerDiscovery="true"/>
<option id="gnu.c.compiler.option.preprocessor.nostdinc.1636374190" name="Do not search system directories (-nostdinc)" superClass="gnu.c.compiler.option.preprocessor.nostdinc" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.preprocessor.preprocess.1575111767" name="Preprocess only (-E)" superClass="gnu.c.compiler.option.preprocessor.preprocess" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.preprocessor.undef.symbol.1393623422" name="Undefined symbols (-U)" superClass="gnu.c.compiler.option.preprocessor.undef.symbol" useByScannerDiscovery="false"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.c.compiler.option.include.paths.1682038716" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/source}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/wifi/wifidriver}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/wifi/incl}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/wifi/incl/wlcmgr}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/wifi/wifidriver/incl}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/wifi/wifidriver/wpa_supp_if}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/wifi/wifidriver/wpa_supp_if/incl}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/wifi/certs}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/wifi/firmware_dnld}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/wifi/sdio_nxp_abs}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/wifi/sdio_nxp_abs/incl}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/drivers/freertos}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/osa}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/conn_fwloader/include}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/conn_fwloader/fw_bin}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/conn_fwloader/fw_bin/inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/conn_fwloader/fw_bin/rw61x}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/conn_fwloader/fw_bin/script}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/flash/mflash/frdmrw612}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/flash/mflash}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/imu_adapter}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/utilities}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/lwip/src/apps/httpsrv}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/drivers}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/wifi/incl/wifidriver}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/wifi/incl/port/net}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/wifi/port/net}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/wifi/incl/port/net/hooks}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/lwip/port}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/lwip/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/lwip/src/include}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/edgefast_wifi/include}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/freertos/freertos-kernel/portable/GCC/ARM_CM33_NTZ/non_secure}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/flash_config}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/device}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/els_pkc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/els_pkc/src/platforms/rw61x}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/wifi/incl/port/osa}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/wifi/wifi_bt_firmware}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/wifi}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/wifi/port/osa}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/wifi_bt_module/AzureWave/tx_pwr_limits}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/wifi_bt_module/Murata/tx_pwr_limits}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/wifi_bt_module/u-blox/tx_pwr_limits}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/wifi/dhcpd}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/lwip/src/include/lwip/apps}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/freertos/freertos-kernel/include}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/lists}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/serial_manager}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/uart}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/lwip/port/sys_arch/dynamic}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/CMSIS}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/els_pkc/src/comps/mcuxClEls/inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/els_pkc/src/comps/mcuxClEls/inc/internal}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/els_pkc/src/comps/mcuxClMemory/inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/els_pkc/src/comps/mcuxClMemory/inc/internal}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/els_pkc/src/comps/mcuxCsslMemory/inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/els_pkc/src/comps/mcuxCsslMemory/inc/internal}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/els_pkc/src/platforms/rw61x/inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/els_pkc/src/comps/mcuxClBuffer/inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/els_pkc/src/comps/mcuxClBuffer/inc/internal}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/els_pkc/src/comps/mcuxClCore/inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/els_pkc/src/comps/mcuxCsslParamIntegrity/inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/els_pkc/src/comps/mcuxCsslFlowProtection/inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/els_pkc/src/comps/mcuxCsslSecureCounter/inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/els_pkc/src/comps/mcuxCsslCPreProcessor/inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/els_pkc/src/compiler}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/els_pkc/src/comps/mcuxCsslDataIntegrity/inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/board}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/.}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/wifi/template}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/lwip/template}&quot;"/>
</option>
<option id="gnu.c.compiler.option.include.files.900514335" name="Include files (-include)" superClass="gnu.c.compiler.option.include.files" useByScannerDiscovery="false"/>
<option id="com.crt.advproject.gcc.exe.debug.option.optimization.level.1241426306" name="Optimization Level" superClass="com.crt.advproject.gcc.exe.debug.option.optimization.level" useByScannerDiscovery="true"/>
<option id="gnu.c.compiler.option.optimization.flags.1115215475" name="Other optimization flags" superClass="gnu.c.compiler.option.optimization.flags" useByScannerDiscovery="false" value="-fno-common" valueType="string"/>
<option id="com.crt.advproject.gcc.exe.debug.option.debugging.level.1378060781" name="Debug Level" superClass="com.crt.advproject.gcc.exe.debug.option.debugging.level" useByScannerDiscovery="false"/>
<option id="com.crt.advproject.gcc.exe.debug.option.debugging.other.1592192583" name="Other debugging flags" superClass="com.crt.advproject.gcc.exe.debug.option.debugging.other" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.debugging.prof.1442859189" name="Generate prof information (-p)" superClass="gnu.c.compiler.option.debugging.prof" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.debugging.gprof.714659301" name="Generate gprof information (-pg)" superClass="gnu.c.compiler.option.debugging.gprof" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.debugging.codecov.1775514482" name="Generate gcov information (-ftest-coverage -fprofile-arcs)" superClass="gnu.c.compiler.option.debugging.codecov" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.debugging.sanitaddress.1526699091" name="Sanitize address (-fsanitize=address)" superClass="gnu.c.compiler.option.debugging.sanitaddress" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.debugging.sanitpointers.1111988373" name="Sanitize pointer operations (-fsanitize=pointer-compare -fsanitize=pointer-subtract)" superClass="gnu.c.compiler.option.debugging.sanitpointers" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.debugging.sanitthread.1797213367" name="Sanitize data race in multi-thread (-fsanitize=thread)" superClass="gnu.c.compiler.option.debugging.sanitthread" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.debugging.sanitleak.266547812" name="Sanitize memory leak (-fsanitize=leak)" superClass="gnu.c.compiler.option.debugging.sanitleak" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.debugging.sanitundef.1615796179" name="Sanitize undefined behavior (-fsanitize=undefined)" superClass="gnu.c.compiler.option.debugging.sanitundef" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.warnings.syntax.740449785" name="Check syntax only (-fsyntax-only)" superClass="gnu.c.compiler.option.warnings.syntax" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.warnings.pedantic.1219581095" name="Pedantic (-pedantic)" superClass="gnu.c.compiler.option.warnings.pedantic" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.warnings.pedantic.error.1726934965" name="Pedantic warnings as errors (-pedantic-errors)" superClass="gnu.c.compiler.option.warnings.pedantic.error" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.warnings.nowarn.1605965397" name="Inhibit all warnings (-w)" superClass="gnu.c.compiler.option.warnings.nowarn" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.warnings.allwarn.35952091" name="All warnings (-Wall)" superClass="gnu.c.compiler.option.warnings.allwarn" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="gnu.c.compiler.option.warnings.extrawarn.847763109" name="Extra warnings (-Wextra)" superClass="gnu.c.compiler.option.warnings.extrawarn" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.warnings.toerrors.1344904244" name="Warnings as errors (-Werror)" superClass="gnu.c.compiler.option.warnings.toerrors" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.warnings.wconversion.1632972470" name="Implicit conversion warnings (-Wconversion)" superClass="gnu.c.compiler.option.warnings.wconversion" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.warnings.wcastalign.1030585779" name="Pointer cast with different alignment (-Wcast-align)" superClass="gnu.c.compiler.option.warnings.wcastalign" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.warnings.wcastqual.306482754" name="Removing type qualifier from cast target type (-Wcast-qual)" superClass="gnu.c.compiler.option.warnings.wcastqual" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.warnings.wdisabledopt.192295591" name="Requested optimization pass is disabled (-Wdisabled-optimization)" superClass="gnu.c.compiler.option.warnings.wdisabledopt" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.warnings.wlogicalop.1480630565" name="Suspicious uses of logical operators (-Wlogical-op)" superClass="gnu.c.compiler.option.warnings.wlogicalop" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.warnings.wmissingdecl.19350929" name="Global function without previous declaration (-Wmissing-declarations)" superClass="gnu.c.compiler.option.warnings.wmissingdecl" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.warnings.wmissingincdir.209701985" name="User-supplied include directory does not exist (-Wmissing-include-dirs)" superClass="gnu.c.compiler.option.warnings.wmissingincdir" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.warnings.wredundantdecl.958240042" name="More than one declaration in the same scope (-Wredundant-decls)" superClass="gnu.c.compiler.option.warnings.wredundantdecl" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.warnings.wshadow.1871471829" name="Local symbol shadows upper scope symbol (-Wshadow)" superClass="gnu.c.compiler.option.warnings.wshadow" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.warnings.wsignconv.904546300" name="Implicit conversions that may change the sign (-Wsign-conversion)" superClass="gnu.c.compiler.option.warnings.wsignconv" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.warnings.wswitchdef.740518820" name="A switch statement does not have a default case (-Wswitch-default)" superClass="gnu.c.compiler.option.warnings.wswitchdef" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.warnings.wundef.2020125093" name="An undefined identifier is evaluated in an #if directive (-Wundef)" superClass="gnu.c.compiler.option.warnings.wundef" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.warnings.wwritestrings.593103216" name="Treat strings always as const (-Wwrite-strings)" superClass="gnu.c.compiler.option.warnings.wwritestrings" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.warnings.wfloatequal.182346638" name="Direct float equal check (-Wfloat-equal)" superClass="gnu.c.compiler.option.warnings.wfloatequal" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.misc.other.896204121" name="Other flags" superClass="gnu.c.compiler.option.misc.other" useByScannerDiscovery="false" value="-mcpu=cortex-m33+nodsp -c -ffunction-sections -fdata-sections -fno-builtin" valueType="string"/>
<option id="gnu.c.compiler.option.misc.otherExcludedFromScannerDiscovery.162647352" name="Other flags (excluded from discovery)" superClass="gnu.c.compiler.option.misc.otherExcludedFromScannerDiscovery" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.misc.verbose.395773100" name="Verbose (-v)" superClass="gnu.c.compiler.option.misc.verbose" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.misc.ansi.738012596" name="Support ANSI programs (-ansi)" superClass="gnu.c.compiler.option.misc.ansi" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.misc.pic.951661366" name="Position Independent Code (-fPIC)" superClass="gnu.c.compiler.option.misc.pic" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.misc.hardening.640435001" name="Hardening options (-fstack-protector-all -Wformat=2 -Wformat-security -Wstrict-overflow)" superClass="gnu.c.compiler.option.misc.hardening" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.misc.randomization.1554824595" name="Address randomization (-fPIE)" superClass="gnu.c.compiler.option.misc.randomization" useByScannerDiscovery="false"/>
<option id="com.crt.advproject.gcc.lto.1034853062" name="Enable Link-time optimization (-flto)" superClass="com.crt.advproject.gcc.lto" useByScannerDiscovery="false"/>
<option id="com.crt.advproject.gcc.lto.fat.1145953934" name="Fat lto objects (-ffat-lto-objects)" superClass="com.crt.advproject.gcc.lto.fat" useByScannerDiscovery="false"/>
<option id="com.crt.advproject.gcc.merge.constants.2102978090" name="Merge Identical Constants (-fmerge-constants)" superClass="com.crt.advproject.gcc.merge.constants" useByScannerDiscovery="false"/>
<option id="com.crt.advproject.gcc.prefixmap.1085653287" name="Remove path from __FILE__ (-fmacro-prefix-map)" superClass="com.crt.advproject.gcc.prefixmap" useByScannerDiscovery="false"/>
<option id="com.crt.advproject.gcc.thumbinterwork.689867021" name="Enable Thumb interworking" superClass="com.crt.advproject.gcc.thumbinterwork" useByScannerDiscovery="false"/>
<option id="com.crt.advproject.gcc.securestate.720496309" name="TrustZone Project Type" superClass="com.crt.advproject.gcc.securestate" useByScannerDiscovery="false"/>
<option id="com.crt.advproject.gcc.specs.1345213853" name="Specs" superClass="com.crt.advproject.gcc.specs" useByScannerDiscovery="false" value="com.crt.advproject.gcc.specs.newlibnano" valueType="enumerated"/>
<option id="com.crt.advproject.gcc.stackusage.1005834270" name="Generate Stack Usage Info (-fstack-usage)" superClass="com.crt.advproject.gcc.stackusage" useByScannerDiscovery="false"/>
<option id="com.crt.advproject.gcc.config.941542602" name="Obsolete (Config)" superClass="com.crt.advproject.gcc.config" useByScannerDiscovery="false"/>
<option id="com.crt.advproject.gcc.store.1017261463" name="Obsolete (Store)" superClass="com.crt.advproject.gcc.store" useByScannerDiscovery="false"/>
<inputType id="com.crt.advproject.compiler.input.1621627363" superClass="com.crt.advproject.compiler.input"/>
</tool>
<tool id="com.crt.advproject.gas.exe.debug.64345950" name="MCU Assembler" superClass="com.crt.advproject.gas.exe.debug">
<option id="com.crt.advproject.gas.hdrlib.1921626762" name="Library headers" superClass="com.crt.advproject.gas.hdrlib" value="com.crt.advproject.gas.hdrlib.newlibnano" valueType="enumerated"/>
<option id="com.crt.advproject.gas.fpu.1502081540" name="Floating point" superClass="com.crt.advproject.gas.fpu" value="com.crt.advproject.gas.fpu.fpv5sp.hard" valueType="enumerated"/>
<option id="com.crt.advproject.gas.thumb.1514509848" name="Thumb mode" superClass="com.crt.advproject.gas.thumb" value="true" valueType="boolean"/>
<option id="com.crt.advproject.gas.arch.406950634" name="Architecture" superClass="com.crt.advproject.gas.arch" value="com.crt.advproject.gas.target.cm33_nodsp" valueType="enumerated"/>
<option id="gnu.both.asm.option.flags.crt.1843278549" name="Assembler flags" superClass="gnu.both.asm.option.flags.crt" value="-c -x assembler-with-cpp -D__NEWLIB__" valueType="string"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.both.asm.option.include.paths.420091040" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/source}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/freertos/freertos-kernel/include}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/board}&quot;"/>
</option>
<option id="gnu.both.asm.option.warnings.nowarn.1245304946" name="Suppress warnings (-W)" superClass="gnu.both.asm.option.warnings.nowarn"/>
<option id="gnu.both.asm.option.version.2082499958" name="Announce version (-v)" superClass="gnu.both.asm.option.version"/>
<option id="com.crt.advproject.gas.exe.debug.option.debugging.level.762048533" name="Debug level" superClass="com.crt.advproject.gas.exe.debug.option.debugging.level"/>
<option id="com.crt.advproject.gas.exe.debug.option.debugging.other.630573380" name="Other debugging flags" superClass="com.crt.advproject.gas.exe.debug.option.debugging.other"/>
<option id="com.crt.advproject.gas.thumbinterwork.1805600562" name="Enable Thumb interworking" superClass="com.crt.advproject.gas.thumbinterwork"/>
<option id="com.crt.advproject.gas.specs.1328541496" name="Specs" superClass="com.crt.advproject.gas.specs" value="com.crt.advproject.gas.specs.newlibnano" valueType="enumerated"/>
<option id="com.crt.advproject.gas.config.114787772" name="Obsolete (Config)" superClass="com.crt.advproject.gas.config"/>
<option id="com.crt.advproject.gas.store.636764708" name="Obsolete (Store)" superClass="com.crt.advproject.gas.store"/>
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.210292267" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
<inputType id="com.crt.advproject.assembler.input.67269995" name="Additional Assembly Source Files" superClass="com.crt.advproject.assembler.input"/>
</tool>
<tool id="com.crt.advproject.link.cpp.exe.debug.737410983" name="MCU C++ Linker" superClass="com.crt.advproject.link.cpp.exe.debug">
<option id="com.crt.advproject.link.cpp.hdrlib.534146969" name="Library" superClass="com.crt.advproject.link.cpp.hdrlib" value="com.crt.advproject.cpp.link.hdrlib.newlibnano.nohost" valueType="enumerated"/>
<option id="com.crt.advproject.link.cpp.fpu.1639783583" name="Floating point" superClass="com.crt.advproject.link.cpp.fpu" value="com.crt.advproject.link.cpp.fpu.none" valueType="enumerated"/>
<option id="com.crt.advproject.link.cpp.arch.927510991" name="Architecture" superClass="com.crt.advproject.link.cpp.arch" value="com.crt.advproject.link.cpp.target.cm33_nodsp" valueType="enumerated"/>
<option id="gnu.cpp.link.option.nostart.476482937" name="Do not use standard start files (-nostartfiles)" superClass="gnu.cpp.link.option.nostart"/>
<option id="gnu.cpp.link.option.nodeflibs.1977093450" name="Do not use default libraries (-nodefaultlibs)" superClass="gnu.cpp.link.option.nodeflibs"/>
<option id="gnu.cpp.link.option.nostdlibs.1028093310" name="No startup or default libs (-nostdlib)" superClass="gnu.cpp.link.option.nostdlibs" value="true" valueType="boolean"/>
<option id="gnu.cpp.link.option.strip.81714744" name="Omit all symbol information (-s)" superClass="gnu.cpp.link.option.strip"/>
<option id="gnu.cpp.link.option.libs.227401254" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs"/>
<option id="gnu.cpp.link.option.paths.737370835" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths"/>
<option id="gnu.cpp.link.option.group.2011748493" name="Group libraries (-Wl,--start-group ... -Wl,--end-group)" superClass="gnu.cpp.link.option.group"/>
<option id="gnu.cpp.link.option.flags.658695338" name="Linker flags" superClass="gnu.cpp.link.option.flags"/>
<option id="gnu.cpp.link.option.other.1302990949" name="Other options (-Xlinker [option])" superClass="gnu.cpp.link.option.other"/>
<option id="gnu.cpp.link.option.userobjs.340325064" name="Other objects" superClass="gnu.cpp.link.option.userobjs"/>
<option id="gnu.cpp.link.option.shared.1613798438" name="Shared (-shared)" superClass="gnu.cpp.link.option.shared"/>
<option id="gnu.cpp.link.option.soname.1602846096" name="Shared object name (-Wl,-soname=)" superClass="gnu.cpp.link.option.soname"/>
<option id="gnu.cpp.link.option.implname.1871526169" name="Import Library name (-Wl,--out-implib=)" superClass="gnu.cpp.link.option.implname"/>
<option id="gnu.cpp.link.option.defname.1943482693" name="DEF file name (-Wl,--output-def=)" superClass="gnu.cpp.link.option.defname"/>
<option id="gnu.cpp.link.option.debugging.prof.244559222" name="Generate prof information (-p)" superClass="gnu.cpp.link.option.debugging.prof"/>
<option id="gnu.cpp.link.option.debugging.gprof.1939978840" name="Generate gprof information (-pg)" superClass="gnu.cpp.link.option.debugging.gprof"/>
<option id="gnu.cpp.link.option.debugging.codecov.1232918120" name="Generate gcov information (-ftest-coverage -fprofile-arcs)" superClass="gnu.cpp.link.option.debugging.codecov"/>
<option id="com.crt.advproject.link.cpp.lto.1152598303" name="Enable Link-time optimization (-flto)" superClass="com.crt.advproject.link.cpp.lto"/>
<option id="com.crt.advproject.link.cpp.lto.optmization.level.1370938200" name="Link-time optimization level" superClass="com.crt.advproject.link.cpp.lto.optmization.level"/>
<option id="com.crt.advproject.link.cpp.thumb.986042892" name="Thumb mode" superClass="com.crt.advproject.link.cpp.thumb"/>
<option id="com.crt.advproject.link.cpp.manage.66656067" name="Manage linker script" superClass="com.crt.advproject.link.cpp.manage"/>
<option id="com.crt.advproject.link.cpp.script.469689234" name="Linker script" superClass="com.crt.advproject.link.cpp.script"/>
<option id="com.crt.advproject.link.cpp.scriptdir.1583519820" name="Script path" superClass="com.crt.advproject.link.cpp.scriptdir"/>
<option id="com.crt.advproject.link.cpp.crpenable.245357532" name="Enable automatic placement of Code Read Protection field in image" superClass="com.crt.advproject.link.cpp.crpenable"/>
<option id="com.crt.advproject.link.cpp.flashconfigenable.637509264" name="Enable automatic placement of Flash Configuration field in image" superClass="com.crt.advproject.link.cpp.flashconfigenable" value="true" valueType="boolean"/>
<option id="com.crt.advproject.link.cpp.ecrp.1866994673" name="Enhanced CRP" superClass="com.crt.advproject.link.cpp.ecrp"/>
<option id="com.crt.advproject.link.cpp.nanofloat.1524911893" name="Enable printf float " superClass="com.crt.advproject.link.cpp.nanofloat"/>
<option id="com.crt.advproject.link.cpp.nanofloat.scanf.431400149" name="Enable scanf float " superClass="com.crt.advproject.link.cpp.nanofloat.scanf"/>
<option id="com.crt.advproject.link.cpp.toram.1380094169" name="Link application to RAM" superClass="com.crt.advproject.link.cpp.toram"/>
<option id="com.crt.advproject.link.memory.load.image.cpp.1041357021" name="Plain load image" superClass="com.crt.advproject.link.memory.load.image.cpp"/>
<option id="com.crt.advproject.link.memory.heapAndStack.style.cpp.1711963072" name="Heap and Stack placement" superClass="com.crt.advproject.link.memory.heapAndStack.style.cpp"/>
<option id="com.crt.advproject.link.cpp.stackOffset.1965274562" name="Stack offset" superClass="com.crt.advproject.link.cpp.stackOffset"/>
<option id="com.crt.advproject.link.memory.heapAndStack.cpp.679317988" name="Heap and Stack options" superClass="com.crt.advproject.link.memory.heapAndStack.cpp"/>
<option id="com.crt.advproject.link.memory.data.cpp.2100090728" name="Global data placement" superClass="com.crt.advproject.link.memory.data.cpp"/>
<option id="com.crt.advproject.link.memory.sections.cpp.726514231" name="Extra linker script input sections" superClass="com.crt.advproject.link.memory.sections.cpp"/>
<option id="com.crt.advproject.link.cpp.multicore.slave.916968105" name="Multicore configuration" superClass="com.crt.advproject.link.cpp.multicore.slave"/>
<option id="com.crt.advproject.link.cpp.multicore.master.1358835556" name="Multicore master" superClass="com.crt.advproject.link.cpp.multicore.master"/>
<option id="com.crt.advproject.link.cpp.multicore.empty.1044500972" name="No Multicore options for this project" superClass="com.crt.advproject.link.cpp.multicore.empty"/>
<option id="com.crt.advproject.link.cpp.multicore.master.userobjs.2136453489" name="Slave Objects (not visible)" superClass="com.crt.advproject.link.cpp.multicore.master.userobjs"/>
<option id="com.crt.advproject.link.cpp.config.278781012" name="Obsolete (Config)" superClass="com.crt.advproject.link.cpp.config"/>
<option id="com.crt.advproject.link.cpp.store.545464579" name="Obsolete (Store)" superClass="com.crt.advproject.link.cpp.store"/>
<option id="com.crt.advproject.link.cpp.securestate.1296584123" name="TrustZone Project Type" superClass="com.crt.advproject.link.cpp.securestate"/>
<option id="com.crt.advproject.link.cpp.sgstubs.placement.366235322" name="Secure Gateway Placement" superClass="com.crt.advproject.link.cpp.sgstubs.placement"/>
<option id="com.crt.advproject.link.cpp.sgstubenable.410131207" name="Enable generation of Secure Gateway Import Library" superClass="com.crt.advproject.link.cpp.sgstubenable"/>
<option id="com.crt.advproject.link.cpp.nonsecureobject.1239598330" name="Secure Gateway Import Library" superClass="com.crt.advproject.link.cpp.nonsecureobject"/>
<option id="com.crt.advproject.link.cpp.inimplib.495980127" name="Input Secure Gateway Import Library" superClass="com.crt.advproject.link.cpp.inimplib"/>
</tool>
<tool id="com.crt.advproject.link.exe.debug.769392292" name="MCU Linker" superClass="com.crt.advproject.link.exe.debug">
<option id="com.crt.advproject.link.gcc.multicore.slave.1515720382" name="Multicore configuration" superClass="com.crt.advproject.link.gcc.multicore.slave"/>
<option id="com.crt.advproject.link.gcc.multicore.master.944640407" name="Multicore master" superClass="com.crt.advproject.link.gcc.multicore.master"/>
<option id="com.crt.advproject.link.gcc.hdrlib.1542825156" name="Library" superClass="com.crt.advproject.link.gcc.hdrlib" value="com.crt.advproject.gcc.link.hdrlib.newlibnano.nohost" valueType="enumerated"/>
<option id="com.crt.advproject.link.fpu.1503247370" name="Floating point" superClass="com.crt.advproject.link.fpu" value="com.crt.advproject.link.fpu.fpv5sp.hard" valueType="enumerated"/>
<option id="com.crt.advproject.link.thumb.771060667" name="Thumb mode" superClass="com.crt.advproject.link.thumb" value="true" valueType="boolean"/>
<option id="com.crt.advproject.link.memory.load.image.1895935545" name="Plain load image" superClass="com.crt.advproject.link.memory.load.image" value="" valueType="string"/>
<option defaultValue="com.crt.advproject.heapAndStack.mcuXpressoStyle" id="com.crt.advproject.link.memory.heapAndStack.style.919445566" name="Heap and Stack placement" superClass="com.crt.advproject.link.memory.heapAndStack.style" valueType="enumerated"/>
<option id="com.crt.advproject.link.memory.heapAndStack.2027001014" name="Heap and Stack options" superClass="com.crt.advproject.link.memory.heapAndStack" value="&amp;Heap:Default;Default;0x15f90&amp;Stack:Default;Default;0x800" valueType="string"/>
<option id="com.crt.advproject.link.memory.data.1833640464" name="Global data placement" superClass="com.crt.advproject.link.memory.data" value="" valueType="string"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="true" id="com.crt.advproject.link.memory.sections.1557379102" name="Extra linker script input sections" superClass="com.crt.advproject.link.memory.sections" valueType="stringList"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="true" id="com.crt.advproject.link.gcc.multicore.master.userobjs.926713704" name="Slave Objects (not visible)" superClass="com.crt.advproject.link.gcc.multicore.master.userobjs" valueType="userObjs"/>
<option id="com.crt.advproject.link.arch.356114823" name="Architecture" superClass="com.crt.advproject.link.arch" value="com.crt.advproject.link.target.cm33_nodsp" valueType="enumerated"/>
<option id="gnu.c.link.option.nostart.39714644" name="Do not use standard start files (-nostartfiles)" superClass="gnu.c.link.option.nostart"/>
<option id="gnu.c.link.option.nodeflibs.1661794950" name="Do not use default libraries (-nodefaultlibs)" superClass="gnu.c.link.option.nodeflibs"/>
<option id="gnu.c.link.option.nostdlibs.1687864495" name="No startup or default libs (-nostdlib)" superClass="gnu.c.link.option.nostdlibs" value="true" valueType="boolean"/>
<option id="gnu.c.link.option.strip.2141959678" name="Omit all symbol information (-s)" superClass="gnu.c.link.option.strip"/>
<option id="gnu.c.link.option.noshared.326849764" name="No shared libraries (-static)" superClass="gnu.c.link.option.noshared"/>
<option id="gnu.c.link.option.libs.232916066" name="Libraries (-l)" superClass="gnu.c.link.option.libs"/>
<option id="gnu.c.link.option.paths.1835228071" name="Library search path (-L)" superClass="gnu.c.link.option.paths"/>
<option id="gnu.c.link.option.group.1121043738" name="Group libraries (-Wl,--start-group ... -Wl,--end-group)" superClass="gnu.c.link.option.group"/>
<option id="gnu.c.link.option.ldflags.1597991572" name="Linker flags" superClass="gnu.c.link.option.ldflags"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.c.link.option.other.1799645043" name="Other options (-Xlinker [option])" superClass="gnu.c.link.option.other" valueType="stringList">
<listOptionValue builtIn="false" value="-no-warn-rwx-segments"/>
<listOptionValue builtIn="false" value="-Map=&quot;${BuildArtifactFileBaseName}.map&quot;"/>
<listOptionValue builtIn="false" value="--gc-sections"/>
<listOptionValue builtIn="false" value="-print-memory-usage"/>
<listOptionValue builtIn="false" value="--sort-section=alignment"/>
<listOptionValue builtIn="false" value="--cref"/>
</option>
<option id="gnu.c.link.option.userobjs.1369998574" name="Other objects" superClass="gnu.c.link.option.userobjs"/>
<option id="gnu.c.link.option.shared.1625219708" name="Shared (-shared)" superClass="gnu.c.link.option.shared"/>
<option id="gnu.c.link.option.soname.458013285" name="Shared object name (-Wl,-soname=)" superClass="gnu.c.link.option.soname"/>
<option id="gnu.c.link.option.implname.1838709141" name="Import Library name (-Wl,--out-implib=)" superClass="gnu.c.link.option.implname"/>
<option id="gnu.c.link.option.defname.350130278" name="DEF file name (-Wl,--output-def=)" superClass="gnu.c.link.option.defname"/>
<option id="gnu.c.link.option.debugging.prof.1424628191" name="Generate prof information (-p)" superClass="gnu.c.link.option.debugging.prof"/>
<option id="gnu.c.link.option.debugging.gprof.895049199" name="Generate gprof information (-pg)" superClass="gnu.c.link.option.debugging.gprof"/>
<option id="gnu.c.link.option.debugging.codecov.172887066" name="Generate gcov information (-ftest-coverage -fprofile-arcs)" superClass="gnu.c.link.option.debugging.codecov"/>
<option id="com.crt.advproject.link.gcc.lto.817182272" name="Enable Link-time optimization (-flto)" superClass="com.crt.advproject.link.gcc.lto"/>
<option id="com.crt.advproject.link.gcc.lto.optmization.level.1977865959" name="Link-time optimization level" superClass="com.crt.advproject.link.gcc.lto.optmization.level"/>
<option id="com.crt.advproject.link.manage.1766142691" name="Manage linker script" superClass="com.crt.advproject.link.manage" value="true" valueType="boolean"/>
<option id="com.crt.advproject.link.script.1418058172" name="Linker script" superClass="com.crt.advproject.link.script" value="frdm-rw612-xpresso-freertos-lwip_Debug.ld" valueType="string"/>
<option id="com.crt.advproject.link.scriptdir.427141575" name="Script path" superClass="com.crt.advproject.link.scriptdir"/>
<option id="com.crt.advproject.link.crpenable.737087216" name="Enable automatic placement of Code Read Protection field in image" superClass="com.crt.advproject.link.crpenable"/>
<option id="com.crt.advproject.link.flashconfigenable.249252447" name="Enable automatic placement of Flash Configuration field in image" superClass="com.crt.advproject.link.flashconfigenable" value="true" valueType="boolean"/>
<option id="com.crt.advproject.link.ecrp.1764582056" name="Enhanced CRP" superClass="com.crt.advproject.link.ecrp"/>
<option id="com.crt.advproject.link.gcc.nanofloat.69994400" name="Enable printf float " superClass="com.crt.advproject.link.gcc.nanofloat"/>
<option id="com.crt.advproject.link.gcc.nanofloat.scanf.1710662524" name="Enable scanf float " superClass="com.crt.advproject.link.gcc.nanofloat.scanf"/>
<option id="com.crt.advproject.link.toram.1325404266" name="Link application to RAM" superClass="com.crt.advproject.link.toram"/>
<option id="com.crt.advproject.link.stackOffset.53782419" name="Stack offset" superClass="com.crt.advproject.link.stackOffset"/>
<option id="com.crt.advproject.link.gcc.multicore.empty.1634925133" name="No Multicore options for this project" superClass="com.crt.advproject.link.gcc.multicore.empty"/>
<option id="com.crt.advproject.link.config.781204747" name="Obsolete (Config)" superClass="com.crt.advproject.link.config"/>
<option id="com.crt.advproject.link.store.428087271" name="Obsolete (Store)" superClass="com.crt.advproject.link.store"/>
<option id="com.crt.advproject.link.securestate.549845677" name="TrustZone Project Type" superClass="com.crt.advproject.link.securestate"/>
<option id="com.crt.advproject.link.sgstubs.placement.1684651482" name="Secure Gateway Placement" superClass="com.crt.advproject.link.sgstubs.placement"/>
<option id="com.crt.advproject.link.sgstubenable.1080552755" name="Enable generation of Secure Gateway Import Library" superClass="com.crt.advproject.link.sgstubenable"/>
<option id="com.crt.advproject.link.nonsecureobject.564792286" name="Secure Gateway Import Library" superClass="com.crt.advproject.link.nonsecureobject"/>
<option id="com.crt.advproject.link.inimplib.1381387973" name="Input Secure Gateway Import Library" superClass="com.crt.advproject.link.inimplib"/>
<inputType id="cdt.managedbuild.tool.gnu.c.linker.input.1197763117" superClass="cdt.managedbuild.tool.gnu.c.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
</inputType>
</tool>
<tool id="com.crt.advproject.tool.debug.debug.1355242400" name="MCU Debugger" superClass="com.crt.advproject.tool.debug.debug">
<option id="com.crt.advproject.linkserver.debug.prevent.debug.1370173586" name="Prevent Debugging" superClass="com.crt.advproject.linkserver.debug.prevent.debug"/>
<option id="com.crt.advproject.miscellaneous.end_of_heap.116609490" name="Last used address of the heap" superClass="com.crt.advproject.miscellaneous.end_of_heap"/>
<option id="com.crt.advproject.miscellaneous.pvHeapStart.147953889" name="First address of the heap" superClass="com.crt.advproject.miscellaneous.pvHeapStart"/>
<option id="com.crt.advproject.miscellaneous.pvHeapLimit.943015446" name="Maximum extent of heap" superClass="com.crt.advproject.miscellaneous.pvHeapLimit"/>
<option id="com.crt.advproject.debugger.security.nonsecureimageenable.2073387055" name="Enable pre-programming of Non-Secure Image" superClass="com.crt.advproject.debugger.security.nonsecureimageenable"/>
<option id="com.crt.advproject.debugger.security.nonsecureimage.475310832" name="Non-Secure Project" superClass="com.crt.advproject.debugger.security.nonsecureimage"/>
</tool>
</toolChain>
</folderInfo>
<folderInfo id="com.crt.advproject.config.exe.debug.252552941.339788828" name="/" resourcePath="flash">
<toolChain id="com.crt.advproject.toolchain.exe.debug.173793462" name="NXP MCU Tools" superClass="com.crt.advproject.toolchain.exe.debug" unusedChildren="">
<tool id="com.crt.advproject.cpp.exe.debug.1925687617" name="MCU C++ Compiler" superClass="com.crt.advproject.cpp.exe.debug.20078202"/>
<tool id="com.crt.advproject.gcc.exe.debug.1044620810" name="MCU C Compiler" superClass="com.crt.advproject.gcc.exe.debug.587026796"/>
<tool id="com.crt.advproject.gas.exe.debug.230045934" name="MCU Assembler" superClass="com.crt.advproject.gas.exe.debug.64345950"/>
<tool id="com.crt.advproject.link.cpp.exe.debug.1189719186" name="MCU C++ Linker" superClass="com.crt.advproject.link.cpp.exe.debug.737410983"/>
<tool id="com.crt.advproject.link.exe.debug.501623847" name="MCU Linker" superClass="com.crt.advproject.link.exe.debug.769392292"/>
<tool id="com.crt.advproject.tool.debug.debug.1530782282" name="MCU Debugger" superClass="com.crt.advproject.tool.debug.debug.1355242400"/>
</toolChain>
</folderInfo>
<sourceEntries>
<entry flags="LOCAL|VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="CMSIS"/>
<entry flags="LOCAL|VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="board"/>
<entry excluding="conn_fwloader/fw_bin|wifi_bt_module" flags="LOCAL|VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="component"/>
<entry flags="LOCAL|VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="device"/>
<entry flags="LOCAL|VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="drivers"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="edgefast_wifi"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="flash"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="flash_config"/>
<entry flags="LOCAL|VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="freertos"/>
<entry flags="LOCAL|VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="linkscripts"/>
<entry excluding="doc|src/netif/ppp/polarssl/arc4.c|src/netif/ppp/polarssl/des.c|src/netif/ppp/polarssl/md4.c|src/netif/ppp/polarssl/md5.c|src/netif/ppp/polarssl/sha1.c" flags="LOCAL|VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="lwip"/>
<entry flags="LOCAL|VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="source"/>
<entry flags="LOCAL|VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="startup"/>
<entry flags="LOCAL|VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="utilities"/>
<entry excluding="wifi_bt_firmware|sdio_nxp_abs" flags="LOCAL|VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="wifi"/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
<cconfiguration id="com.crt.advproject.config.exe.release.438620977">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.crt.advproject.config.exe.release.438620977" moduleId="org.eclipse.cdt.core.settings" name="Release">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GNU_ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactExtension="axf" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf" description="Release build" errorParsers="org.eclipse.cdt.core.CWDLocator;org.eclipse.cdt.core.GmakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.GASErrorParser" id="com.crt.advproject.config.exe.release.438620977" name="Release" parent="com.crt.advproject.config.exe.release" postannouncebuildStep="Performing post-build steps" postbuildStep="arm-none-eabi-size &quot;${BuildArtifactFileName}&quot;; # arm-none-eabi-objcopy -v -O binary &quot;${BuildArtifactFileName}&quot; &quot;${BuildArtifactFileBaseName}.bin&quot; ; # checksum -p ${TargetChip} -d &quot;${BuildArtifactFileBaseName}.bin&quot;; ">
<folderInfo id="com.crt.advproject.config.exe.release.438620977." name="/" resourcePath="">
<toolChain id="com.crt.advproject.toolchain.exe.release.2007539146" name="NXP MCU Tools" superClass="com.crt.advproject.toolchain.exe.release">
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF;org.eclipse.cdt.core.GNU_ELF" id="com.crt.advproject.platform.exe.release.641432788" name="ARM-based MCU (Release)" superClass="com.crt.advproject.platform.exe.release"/>
<builder buildPath="${workspace_loc:/frdmrw612_wifi_webconfig}/Release" id="com.crt.advproject.builder.exe.release.241112212" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="com.crt.advproject.builder.exe.release"/>
<tool id="com.crt.advproject.cpp.exe.release.1596685002" name="MCU C++ Compiler" superClass="com.crt.advproject.cpp.exe.release">
<option id="com.crt.advproject.cpp.arch.116589304" name="Architecture" superClass="com.crt.advproject.cpp.arch" useByScannerDiscovery="true" value="com.crt.advproject.cpp.target.cm33_nodsp" valueType="enumerated"/>
<option id="com.crt.advproject.cpp.fpu.542354228" name="Floating point" superClass="com.crt.advproject.cpp.fpu" useByScannerDiscovery="true" value="com.crt.advproject.cpp.fpu.none" valueType="enumerated"/>
<option id="com.crt.advproject.cpp.misc.dialect.245134384" name="Language standard" superClass="com.crt.advproject.cpp.misc.dialect" useByScannerDiscovery="true"/>
<option id="gnu.cpp.compiler.option.dialect.flags.1351349642" name="Other dialect flags" superClass="gnu.cpp.compiler.option.dialect.flags" useByScannerDiscovery="true"/>
<option id="gnu.cpp.compiler.option.preprocessor.nostdinc.1879486032" name="Do not search system directories (-nostdinc)" superClass="gnu.cpp.compiler.option.preprocessor.nostdinc" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.preprocessor.preprocess.896596026" name="Preprocess only (-E)" superClass="gnu.cpp.compiler.option.preprocessor.preprocess" useByScannerDiscovery="false"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.cpp.compiler.option.preprocessor.def.923113260" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" useByScannerDiscovery="false" valueType="definedSymbols">
<listOptionValue builtIn="false" value="__NEWLIB__"/>
</option>
<option id="gnu.cpp.compiler.option.preprocessor.undef.2056534191" name="Undefined symbols (-U)" superClass="gnu.cpp.compiler.option.preprocessor.undef" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.include.paths.1831667362" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.include.files.1069708188" name="Include files (-include)" superClass="gnu.cpp.compiler.option.include.files" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.optimization.flags.436207732" name="Other optimization flags" superClass="gnu.cpp.compiler.option.optimization.flags" useByScannerDiscovery="false" value="-fno-common" valueType="string"/>
<option id="gnu.cpp.compiler.option.debugging.prof.2074541825" name="Generate prof information (-p)" superClass="gnu.cpp.compiler.option.debugging.prof" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.debugging.gprof.298185060" name="Generate gprof information (-pg)" superClass="gnu.cpp.compiler.option.debugging.gprof" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.debugging.codecov.685895710" name="Generate gcov information (-ftest-coverage -fprofile-arcs)" superClass="gnu.cpp.compiler.option.debugging.codecov" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.debugging.sanitaddress.1471668431" name="Sanitize address (-fsanitize=address)" superClass="gnu.cpp.compiler.option.debugging.sanitaddress" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.debugging.sanitpointers.1219517196" name="Sanitize pointer operations (-fsanitize=pointer-compare -fsanitize=pointer-subtract)" superClass="gnu.cpp.compiler.option.debugging.sanitpointers" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.debugging.sanitthread.1997687118" name="Sanitize data race in multi-thread (-fsanitize=thread)" superClass="gnu.cpp.compiler.option.debugging.sanitthread" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.debugging.sanitleak.2140634450" name="Sanitize memory leak (-fsanitize=leak)" superClass="gnu.cpp.compiler.option.debugging.sanitleak" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.debugging.sanitundef.436182296" name="Sanitize undefined behavior (-fsanitize=undefined)" superClass="gnu.cpp.compiler.option.debugging.sanitundef" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.warnings.syntax.1659932703" name="Check syntax only (-fsyntax-only)" superClass="gnu.cpp.compiler.option.warnings.syntax" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.warnings.pedantic.835194107" name="Pedantic (-pedantic)" superClass="gnu.cpp.compiler.option.warnings.pedantic" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.warnings.pedantic.error.542580823" name="Pedantic warnings as errors (-pedantic-errors)" superClass="gnu.cpp.compiler.option.warnings.pedantic.error" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.warnings.nowarn.368038692" name="Inhibit all warnings (-w)" superClass="gnu.cpp.compiler.option.warnings.nowarn" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.warnings.allwarn.167751024" name="All warnings (-Wall)" superClass="gnu.cpp.compiler.option.warnings.allwarn" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.warnings.extrawarn.1331737451" name="Extra warnings (-Wextra)" superClass="gnu.cpp.compiler.option.warnings.extrawarn" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.warnings.toerrors.543218817" name="Warnings as errors (-Werror)" superClass="gnu.cpp.compiler.option.warnings.toerrors" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.warnings.wconversion.2049502853" name="Implicit conversion warnings (-Wconversion)" superClass="gnu.cpp.compiler.option.warnings.wconversion" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.warnings.wcastalign.363871621" name="Pointer cast with different alignment (-Wcast-align)" superClass="gnu.cpp.compiler.option.warnings.wcastalign" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.warnings.wcastqual.831273188" name="Removing type qualifier from cast target type (-Wcast-qual)" superClass="gnu.cpp.compiler.option.warnings.wcastqual" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.warnings.wctordtorprivacy.1267982676" name="All ctor and dtor private (-Wctor-dtor-privacy)" superClass="gnu.cpp.compiler.option.warnings.wctordtorprivacy" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.warnings.wdisabledopt.1888880773" name="Requested optimization pass is disabled (-Wdisabled-optimization)" superClass="gnu.cpp.compiler.option.warnings.wdisabledopt" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.warnings.wlogicalop.1121315817" name="Suspicious uses of logical operators (-Wlogical-op)" superClass="gnu.cpp.compiler.option.warnings.wlogicalop" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.warnings.wmissingdecl.689520900" name="Global function without previous declaration (-Wmissing-declarations)" superClass="gnu.cpp.compiler.option.warnings.wmissingdecl" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.warnings.wmissingincdir.843219438" name="User-supplied include directory does not exist (-Wmissing-include-dirs)" superClass="gnu.cpp.compiler.option.warnings.wmissingincdir" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.warnings.wnoexccept.950212625" name="Noexcept false but never throw exception (-Wnoexcept)" superClass="gnu.cpp.compiler.option.warnings.wnoexccept" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.warnings.woldstylecast.1622281161" name="C-style cast used (-Wold-style-cast)" superClass="gnu.cpp.compiler.option.warnings.woldstylecast" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.warnings.woverloadedvirtual.1524480636" name="Function hides virtual functions from base class (-Woverloaded-virtual)" superClass="gnu.cpp.compiler.option.warnings.woverloadedvirtual" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.warnings.wredundantdecl.326638133" name="More than one declaration in the same scope (-Wredundant-decls)" superClass="gnu.cpp.compiler.option.warnings.wredundantdecl" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.warnings.wshadow.1007946877" name="Local symbol shadows upper scope symbol (-Wshadow)" superClass="gnu.cpp.compiler.option.warnings.wshadow" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.warnings.wsignconv.1294094718" name="Implicit conversions that may change the sign (-Wsign-conversion)" superClass="gnu.cpp.compiler.option.warnings.wsignconv" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.warnings.wsignpromo.119042307" name="Overload resolution promotes unsigned to signed type (-Wsign-promo)" superClass="gnu.cpp.compiler.option.warnings.wsignpromo" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.warnings.wstrictnullsent.1658981738" name="Use of an uncasted NULL as sentinel (-Wstrict-null-sentinel)" superClass="gnu.cpp.compiler.option.warnings.wstrictnullsent" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.warnings.wswitchdef.9149539" name="A switch statement does not have a default case (-Wswitch-default)" superClass="gnu.cpp.compiler.option.warnings.wswitchdef" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.warnings.wundef.1747839900" name="An undefined identifier is evaluated in an #if directive (-Wundef)" superClass="gnu.cpp.compiler.option.warnings.wundef" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.warnings.weffcpp.596262917" name="Effective C++ guidelines (-Weffc++)" superClass="gnu.cpp.compiler.option.warnings.weffcpp" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.warnings.wfloatequal.744374283" name="Direct float equal check (-Wfloat-equal)" superClass="gnu.cpp.compiler.option.warnings.wfloatequal" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.other.other.1794202210" name="Other flags" superClass="gnu.cpp.compiler.option.other.other" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.other.otherExcludedFromScannerDiscovery.1029128619" name="Other flags (excluded from discovery)" superClass="gnu.cpp.compiler.option.other.otherExcludedFromScannerDiscovery" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.other.verbose.1182551543" name="Verbose (-v)" superClass="gnu.cpp.compiler.option.other.verbose" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.other.pic.1610580975" name="Position Independent Code (-fPIC)" superClass="gnu.cpp.compiler.option.other.pic" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.misc.hardening.1149468153" name="Hardening options (-fstack-protector-all -Wformat=2 -Wformat-security -Wstrict-overflow)" superClass="gnu.cpp.compiler.option.misc.hardening" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.misc.randomization.701093430" name="Address randomization (-fPIE)" superClass="gnu.cpp.compiler.option.misc.randomization" useByScannerDiscovery="false"/>
<option id="com.crt.advproject.cpp.lto.845678630" name="Enable Link-time optimization (-flto)" superClass="com.crt.advproject.cpp.lto" useByScannerDiscovery="false"/>
<option id="com.crt.advproject.cpp.lto.fat.355850805" name="Fat lto objects (-ffat-lto-objects)" superClass="com.crt.advproject.cpp.lto.fat" useByScannerDiscovery="false"/>
<option id="com.crt.advproject.cpp.merge.constants.254247978" name="Merge Identical Constants (-fmerge-constants)" superClass="com.crt.advproject.cpp.merge.constants" useByScannerDiscovery="false"/>
<option id="com.crt.advproject.cpp.prefixmap.886128852" name="Remove path from __FILE__ (-fmacro-prefix-map)" superClass="com.crt.advproject.cpp.prefixmap" useByScannerDiscovery="false"/>
<option id="com.crt.advproject.cpp.thumb.1336357669" name="Thumb mode" superClass="com.crt.advproject.cpp.thumb" useByScannerDiscovery="false"/>
<option id="com.crt.advproject.cpp.thumbinterwork.870412139" name="Enable Thumb interworking" superClass="com.crt.advproject.cpp.thumbinterwork" useByScannerDiscovery="false"/>
<option id="com.crt.advproject.cpp.securestate.217473417" name="TrustZone Project Type" superClass="com.crt.advproject.cpp.securestate" useByScannerDiscovery="false"/>
<option id="com.crt.advproject.cpp.hdrlib.644497181" name="Library headers" superClass="com.crt.advproject.cpp.hdrlib" useByScannerDiscovery="false"/>
<option id="com.crt.advproject.cpp.specs.948443979" name="Specs" superClass="com.crt.advproject.cpp.specs" useByScannerDiscovery="false" value="com.crt.advproject.cpp.specs.newlibnano" valueType="enumerated"/>
<option id="com.crt.advproject.cpp.stackusage.674440589" name="Generate Stack Usage Info (-fstack-usage)" superClass="com.crt.advproject.cpp.stackusage" useByScannerDiscovery="false"/>
<option id="com.crt.advproject.cpp.config.433567866" name="Obsolete (Config)" superClass="com.crt.advproject.cpp.config" useByScannerDiscovery="false"/>
<option id="com.crt.advproject.cpp.store.1116601121" name="Obsolete (Store)" superClass="com.crt.advproject.cpp.store" useByScannerDiscovery="false"/>
</tool>
<tool id="com.crt.advproject.gcc.exe.release.1059172906" name="MCU C Compiler" superClass="com.crt.advproject.gcc.exe.release">
<option id="com.crt.advproject.gcc.thumb.1700261609" name="Thumb mode" superClass="com.crt.advproject.gcc.thumb" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<option id="com.crt.advproject.gcc.arch.1457953656" name="Architecture" superClass="com.crt.advproject.gcc.arch" useByScannerDiscovery="true" value="com.crt.advproject.gcc.target.cm33_nodsp" valueType="enumerated"/>
<option id="com.crt.advproject.c.misc.dialect.23975419" name="Language standard" superClass="com.crt.advproject.c.misc.dialect" useByScannerDiscovery="true" value="com.crt.advproject.misc.dialect.gnu99" valueType="enumerated"/>
<option id="gnu.c.compiler.option.dialect.flags.1922620387" name="Other dialect flags" superClass="gnu.c.compiler.option.dialect.flags" useByScannerDiscovery="true"/>
<option id="gnu.c.compiler.option.preprocessor.nostdinc.642350499" name="Do not search system directories (-nostdinc)" superClass="gnu.c.compiler.option.preprocessor.nostdinc" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.preprocessor.preprocess.31080972" name="Preprocess only (-E)" superClass="gnu.c.compiler.option.preprocessor.preprocess" useByScannerDiscovery="false"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.c.compiler.option.preprocessor.def.symbols.1557566913" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols">
<listOptionValue builtIn="false" value="LWIP_TIMEVAL_PRIVATE=0"/>
<listOptionValue builtIn="false" value="CONFIG_MONOLITHIC_WIFI=1"/>
<listOptionValue builtIn="false" value="FSL_SDK_DRIVER_QUICK_ACCESS_ENABLE=1"/>
<listOptionValue builtIn="false" value="USE_RTOS=1"/>
<listOptionValue builtIn="false" value="PRINTF_ADVANCED_ENABLE=1"/>
<listOptionValue builtIn="false" value="LWIP_NETIF_API=1"/>
<listOptionValue builtIn="false" value="HTTPSRV_CFG_WEBSOCKET_ENABLED=1"/>
<listOptionValue builtIn="false" value="HTTPSRV_CFG_DEFAULT_SES_CNT=8"/>
<listOptionValue builtIn="false" value="SDK_DEBUGCONSOLE_UART"/>
<listOptionValue builtIn="false" value="CPU_RW612ETA2I"/>
<listOptionValue builtIn="false" value="MCUXPRESSO_SDK"/>
<listOptionValue builtIn="false" value="BOOT_HEADER_ENABLE=1"/>
<listOptionValue builtIn="false" value="MFLASH_FILE_BASEADDR=7340032"/>
<listOptionValue builtIn="false" value="FSL_OSA_TASK_ENABLE=1"/>
<listOptionValue builtIn="false" value="OSA_USED"/>
<listOptionValue builtIn="false" value="LWIP_DNS=1"/>
<listOptionValue builtIn="false" value="LWIP_NETIF_HOSTNAME=1"/>
<listOptionValue builtIn="false" value="LWIP_IGMP=1"/>
<listOptionValue builtIn="false" value="_XOPEN_SOURCE=500"/>
<listOptionValue builtIn="false" value="SO_REUSE=1"/>
<listOptionValue builtIn="false" value="SDK_OS_FREE_RTOS"/>
<listOptionValue builtIn="false" value="SERIAL_PORT_TYPE_UART=1"/>
<listOptionValue builtIn="false" value="CPU_RW612ETA2I_cm33_nodsp"/>
<listOptionValue builtIn="false" value="SDK_DEBUGCONSOLE=1"/>
<listOptionValue builtIn="false" value="CR_INTEGER_PRINTF"/>
<listOptionValue builtIn="false" value="__MCUXPRESSO"/>
<listOptionValue builtIn="false" value="__USE_CMSIS"/>
<listOptionValue builtIn="false" value="NDEBUG"/>
<listOptionValue builtIn="false" value="__NEWLIB__"/>
</option>
<option id="gnu.c.compiler.option.preprocessor.undef.symbol.1344655517" name="Undefined symbols (-U)" superClass="gnu.c.compiler.option.preprocessor.undef.symbol" useByScannerDiscovery="false"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.c.compiler.option.include.paths.1197061145" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/source}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/wifi/wifidriver}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/wifi/incl}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/wifi/incl/wlcmgr}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/wifi/wifidriver/incl}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/wifi/wifidriver/wpa_supp_if}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/wifi/wifidriver/wpa_supp_if/incl}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/wifi/certs}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/wifi/firmware_dnld}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/wifi/sdio_nxp_abs}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/wifi/sdio_nxp_abs/incl}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/drivers/freertos}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/osa}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/conn_fwloader/include}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/conn_fwloader/fw_bin}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/conn_fwloader/fw_bin/inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/conn_fwloader/fw_bin/rw61x}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/conn_fwloader/fw_bin/script}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/flash/mflash/frdmrw612}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/flash/mflash}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/imu_adapter}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/utilities}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/lwip/src/apps/httpsrv}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/drivers}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/wifi/incl/wifidriver}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/wifi/incl/port/net}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/wifi/port/net}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/wifi/incl/port/net/hooks}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/lwip/port}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/lwip/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/lwip/src/include}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/edgefast_wifi/include}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/freertos/freertos-kernel/portable/GCC/ARM_CM33_NTZ/non_secure}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/flash_config}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/device}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/els_pkc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/els_pkc/src/platforms/rw61x}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/wifi/incl/port/osa}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/wifi/wifi_bt_firmware}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/wifi}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/wifi/port/osa}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/wifi_bt_module/AzureWave/tx_pwr_limits}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/wifi_bt_module/Murata/tx_pwr_limits}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/wifi_bt_module/u-blox/tx_pwr_limits}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/wifi/dhcpd}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/lwip/src/include/lwip/apps}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/freertos/freertos-kernel/include}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/lists}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/serial_manager}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/uart}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/lwip/port/sys_arch/dynamic}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/CMSIS}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/els_pkc/src/comps/mcuxClEls/inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/els_pkc/src/comps/mcuxClEls/inc/internal}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/els_pkc/src/comps/mcuxClMemory/inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/els_pkc/src/comps/mcuxClMemory/inc/internal}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/els_pkc/src/comps/mcuxCsslMemory/inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/els_pkc/src/comps/mcuxCsslMemory/inc/internal}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/els_pkc/src/platforms/rw61x/inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/els_pkc/src/comps/mcuxClBuffer/inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/els_pkc/src/comps/mcuxClBuffer/inc/internal}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/els_pkc/src/comps/mcuxClCore/inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/els_pkc/src/comps/mcuxCsslParamIntegrity/inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/els_pkc/src/comps/mcuxCsslFlowProtection/inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/els_pkc/src/comps/mcuxCsslSecureCounter/inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/els_pkc/src/comps/mcuxCsslCPreProcessor/inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/els_pkc/src/compiler}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/component/els_pkc/src/comps/mcuxCsslDataIntegrity/inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/board}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/.}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/wifi/template}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/lwip/template}&quot;"/>
</option>
<option id="gnu.c.compiler.option.include.files.131827527" name="Include files (-include)" superClass="gnu.c.compiler.option.include.files" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.optimization.flags.1867664504" name="Other optimization flags" superClass="gnu.c.compiler.option.optimization.flags" useByScannerDiscovery="false" value="-fno-common" valueType="string"/>
<option id="gnu.c.compiler.option.debugging.prof.1021771123" name="Generate prof information (-p)" superClass="gnu.c.compiler.option.debugging.prof" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.debugging.gprof.759601849" name="Generate gprof information (-pg)" superClass="gnu.c.compiler.option.debugging.gprof" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.debugging.codecov.1867894972" name="Generate gcov information (-ftest-coverage -fprofile-arcs)" superClass="gnu.c.compiler.option.debugging.codecov" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.debugging.sanitaddress.1558605785" name="Sanitize address (-fsanitize=address)" superClass="gnu.c.compiler.option.debugging.sanitaddress" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.debugging.sanitpointers.265802137" name="Sanitize pointer operations (-fsanitize=pointer-compare -fsanitize=pointer-subtract)" superClass="gnu.c.compiler.option.debugging.sanitpointers" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.debugging.sanitthread.1778863145" name="Sanitize data race in multi-thread (-fsanitize=thread)" superClass="gnu.c.compiler.option.debugging.sanitthread" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.debugging.sanitleak.2017000879" name="Sanitize memory leak (-fsanitize=leak)" superClass="gnu.c.compiler.option.debugging.sanitleak" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.debugging.sanitundef.1991064966" name="Sanitize undefined behavior (-fsanitize=undefined)" superClass="gnu.c.compiler.option.debugging.sanitundef" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.warnings.syntax.1707433346" name="Check syntax only (-fsyntax-only)" superClass="gnu.c.compiler.option.warnings.syntax" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.warnings.pedantic.913866005" name="Pedantic (-pedantic)" superClass="gnu.c.compiler.option.warnings.pedantic" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.warnings.pedantic.error.290529535" name="Pedantic warnings as errors (-pedantic-errors)" superClass="gnu.c.compiler.option.warnings.pedantic.error" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.warnings.nowarn.1791260335" name="Inhibit all warnings (-w)" superClass="gnu.c.compiler.option.warnings.nowarn" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.warnings.allwarn.1712991385" name="All warnings (-Wall)" superClass="gnu.c.compiler.option.warnings.allwarn" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="gnu.c.compiler.option.warnings.extrawarn.1017739553" name="Extra warnings (-Wextra)" superClass="gnu.c.compiler.option.warnings.extrawarn" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.warnings.toerrors.1877864261" name="Warnings as errors (-Werror)" superClass="gnu.c.compiler.option.warnings.toerrors" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.warnings.wconversion.1039511757" name="Implicit conversion warnings (-Wconversion)" superClass="gnu.c.compiler.option.warnings.wconversion" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.warnings.wcastalign.26294245" name="Pointer cast with different alignment (-Wcast-align)" superClass="gnu.c.compiler.option.warnings.wcastalign" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.warnings.wcastqual.1424135105" name="Removing type qualifier from cast target type (-Wcast-qual)" superClass="gnu.c.compiler.option.warnings.wcastqual" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.warnings.wdisabledopt.232463805" name="Requested optimization pass is disabled (-Wdisabled-optimization)" superClass="gnu.c.compiler.option.warnings.wdisabledopt" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.warnings.wlogicalop.831918603" name="Suspicious uses of logical operators (-Wlogical-op)" superClass="gnu.c.compiler.option.warnings.wlogicalop" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.warnings.wmissingdecl.245365548" name="Global function without previous declaration (-Wmissing-declarations)" superClass="gnu.c.compiler.option.warnings.wmissingdecl" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.warnings.wmissingincdir.1114992972" name="User-supplied include directory does not exist (-Wmissing-include-dirs)" superClass="gnu.c.compiler.option.warnings.wmissingincdir" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.warnings.wredundantdecl.1247193675" name="More than one declaration in the same scope (-Wredundant-decls)" superClass="gnu.c.compiler.option.warnings.wredundantdecl" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.warnings.wshadow.49874029" name="Local symbol shadows upper scope symbol (-Wshadow)" superClass="gnu.c.compiler.option.warnings.wshadow" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.warnings.wsignconv.1714885763" name="Implicit conversions that may change the sign (-Wsign-conversion)" superClass="gnu.c.compiler.option.warnings.wsignconv" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.warnings.wswitchdef.600608801" name="A switch statement does not have a default case (-Wswitch-default)" superClass="gnu.c.compiler.option.warnings.wswitchdef" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.warnings.wundef.1770500247" name="An undefined identifier is evaluated in an #if directive (-Wundef)" superClass="gnu.c.compiler.option.warnings.wundef" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.warnings.wwritestrings.1135856279" name="Treat strings always as const (-Wwrite-strings)" superClass="gnu.c.compiler.option.warnings.wwritestrings" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.warnings.wfloatequal.1679179730" name="Direct float equal check (-Wfloat-equal)" superClass="gnu.c.compiler.option.warnings.wfloatequal" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.misc.other.685451524" name="Other flags" superClass="gnu.c.compiler.option.misc.other" useByScannerDiscovery="false" value="-mcpu=cortex-m33+nodsp -c -ffunction-sections -fdata-sections -fno-builtin -imacros &quot;${workspace_loc:/${ProjName}/source/wifi_config.h}&quot;" valueType="string"/>
<option id="gnu.c.compiler.option.misc.otherExcludedFromScannerDiscovery.900170600" name="Other flags (excluded from discovery)" superClass="gnu.c.compiler.option.misc.otherExcludedFromScannerDiscovery" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.misc.verbose.2018545036" name="Verbose (-v)" superClass="gnu.c.compiler.option.misc.verbose" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.misc.ansi.437365787" name="Support ANSI programs (-ansi)" superClass="gnu.c.compiler.option.misc.ansi" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.misc.pic.371600978" name="Position Independent Code (-fPIC)" superClass="gnu.c.compiler.option.misc.pic" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.misc.hardening.315987394" name="Hardening options (-fstack-protector-all -Wformat=2 -Wformat-security -Wstrict-overflow)" superClass="gnu.c.compiler.option.misc.hardening" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.misc.randomization.1013375426" name="Address randomization (-fPIE)" superClass="gnu.c.compiler.option.misc.randomization" useByScannerDiscovery="false"/>
<option id="com.crt.advproject.gcc.lto.1354276992" name="Enable Link-time optimization (-flto)" superClass="com.crt.advproject.gcc.lto" useByScannerDiscovery="false"/>
<option id="com.crt.advproject.gcc.lto.fat.1755151093" name="Fat lto objects (-ffat-lto-objects)" superClass="com.crt.advproject.gcc.lto.fat" useByScannerDiscovery="false"/>
<option id="com.crt.advproject.gcc.merge.constants.1009314775" name="Merge Identical Constants (-fmerge-constants)" superClass="com.crt.advproject.gcc.merge.constants" useByScannerDiscovery="false"/>
<option id="com.crt.advproject.gcc.prefixmap.1021310164" name="Remove path from __FILE__ (-fmacro-prefix-map)" superClass="com.crt.advproject.gcc.prefixmap" useByScannerDiscovery="false"/>
<option id="com.crt.advproject.gcc.fpu.1993816271" name="Floating point" superClass="com.crt.advproject.gcc.fpu" useByScannerDiscovery="true" value="com.crt.advproject.gcc.fpu.fpv5sp.hard" valueType="enumerated"/>
<option id="com.crt.advproject.gcc.thumbinterwork.521330424" name="Enable Thumb interworking" superClass="com.crt.advproject.gcc.thumbinterwork" useByScannerDiscovery="false"/>
<option id="com.crt.advproject.gcc.securestate.1706693411" name="TrustZone Project Type" superClass="com.crt.advproject.gcc.securestate" useByScannerDiscovery="false"/>
<option id="com.crt.advproject.gcc.hdrlib.1249080015" name="Library headers" superClass="com.crt.advproject.gcc.hdrlib" useByScannerDiscovery="false" value="com.crt.advproject.gcc.hdrlib.newlibnano" valueType="enumerated"/>
<option id="com.crt.advproject.gcc.specs.847957526" name="Specs" superClass="com.crt.advproject.gcc.specs" useByScannerDiscovery="false" value="com.crt.advproject.gcc.specs.newlibnano" valueType="enumerated"/>
<option id="com.crt.advproject.gcc.stackusage.830211330" name="Generate Stack Usage Info (-fstack-usage)" superClass="com.crt.advproject.gcc.stackusage" useByScannerDiscovery="false"/>
<option id="com.crt.advproject.gcc.config.1615666627" name="Obsolete (Config)" superClass="com.crt.advproject.gcc.config" useByScannerDiscovery="false"/>
<option id="com.crt.advproject.gcc.store.1659723024" name="Obsolete (Store)" superClass="com.crt.advproject.gcc.store" useByScannerDiscovery="false"/>
<inputType id="com.crt.advproject.compiler.input.1119421287" superClass="com.crt.advproject.compiler.input"/>
</tool>
<tool id="com.crt.advproject.gas.exe.release.1383944148" name="MCU Assembler" superClass="com.crt.advproject.gas.exe.release">
<option id="com.crt.advproject.gas.thumb.1118452349" name="Thumb mode" superClass="com.crt.advproject.gas.thumb" value="true" valueType="boolean"/>
<option id="com.crt.advproject.gas.arch.1678925751" name="Architecture" superClass="com.crt.advproject.gas.arch" value="com.crt.advproject.gas.target.cm33_nodsp" valueType="enumerated"/>
<option id="gnu.both.asm.option.flags.crt.1902694289" name="Assembler flags" superClass="gnu.both.asm.option.flags.crt" value="-c -x assembler-with-cpp -D__NEWLIB__" valueType="string"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.both.asm.option.include.paths.1480729505" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/source}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/freertos/freertos-kernel/include}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/board}&quot;"/>
</option>
<option id="gnu.both.asm.option.warnings.nowarn.296162795" name="Suppress warnings (-W)" superClass="gnu.both.asm.option.warnings.nowarn"/>
<option id="gnu.both.asm.option.version.1096692273" name="Announce version (-v)" superClass="gnu.both.asm.option.version"/>
<option id="com.crt.advproject.gas.fpu.1507342171" name="Floating point" superClass="com.crt.advproject.gas.fpu" value="com.crt.advproject.gas.fpu.fpv5sp.hard" valueType="enumerated"/>
<option id="com.crt.advproject.gas.thumbinterwork.1674043546" name="Enable Thumb interworking" superClass="com.crt.advproject.gas.thumbinterwork"/>
<option id="com.crt.advproject.gas.hdrlib.794149614" name="Library headers" superClass="com.crt.advproject.gas.hdrlib" value="com.crt.advproject.gas.hdrlib.newlibnano" valueType="enumerated"/>
<option id="com.crt.advproject.gas.specs.393821879" name="Specs" superClass="com.crt.advproject.gas.specs" value="com.crt.advproject.gas.specs.newlibnano" valueType="enumerated"/>
<option id="com.crt.advproject.gas.config.559633334" name="Obsolete (Config)" superClass="com.crt.advproject.gas.config"/>
<option id="com.crt.advproject.gas.store.1279729079" name="Obsolete (Store)" superClass="com.crt.advproject.gas.store"/>
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1873911520" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
<inputType id="com.crt.advproject.assembler.input.681352778" name="Additional Assembly Source Files" superClass="com.crt.advproject.assembler.input"/>
</tool>
<tool id="com.crt.advproject.link.cpp.exe.release.35887060" name="MCU C++ Linker" superClass="com.crt.advproject.link.cpp.exe.release">
<option id="com.crt.advproject.link.cpp.arch.289844113" name="Architecture" superClass="com.crt.advproject.link.cpp.arch" value="com.crt.advproject.link.cpp.target.cm33_nodsp" valueType="enumerated"/>
<option id="com.crt.advproject.link.cpp.fpu.176431493" name="Floating point" superClass="com.crt.advproject.link.cpp.fpu" value="com.crt.advproject.link.cpp.fpu.none" valueType="enumerated"/>
<option id="gnu.cpp.link.option.nostart.563677365" name="Do not use standard start files (-nostartfiles)" superClass="gnu.cpp.link.option.nostart"/>
<option id="gnu.cpp.link.option.nodeflibs.1588750344" name="Do not use default libraries (-nodefaultlibs)" superClass="gnu.cpp.link.option.nodeflibs"/>
<option id="gnu.cpp.link.option.nostdlibs.1339018896" name="No startup or default libs (-nostdlib)" superClass="gnu.cpp.link.option.nostdlibs" value="true" valueType="boolean"/>
<option id="gnu.cpp.link.option.strip.92961567" name="Omit all symbol information (-s)" superClass="gnu.cpp.link.option.strip"/>
<option id="gnu.cpp.link.option.libs.1372726364" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs"/>
<option id="gnu.cpp.link.option.paths.2065104666" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths"/>
<option id="gnu.cpp.link.option.group.2107811315" name="Group libraries (-Wl,--start-group ... -Wl,--end-group)" superClass="gnu.cpp.link.option.group"/>
<option id="gnu.cpp.link.option.flags.1232087363" name="Linker flags" superClass="gnu.cpp.link.option.flags"/>
<option id="gnu.cpp.link.option.other.559769752" name="Other options (-Xlinker [option])" superClass="gnu.cpp.link.option.other"/>
<option id="gnu.cpp.link.option.userobjs.1554189986" name="Other objects" superClass="gnu.cpp.link.option.userobjs"/>
<option id="gnu.cpp.link.option.shared.1834767298" name="Shared (-shared)" superClass="gnu.cpp.link.option.shared"/>
<option id="gnu.cpp.link.option.soname.1170580244" name="Shared object name (-Wl,-soname=)" superClass="gnu.cpp.link.option.soname"/>
<option id="gnu.cpp.link.option.implname.533319850" name="Import Library name (-Wl,--out-implib=)" superClass="gnu.cpp.link.option.implname"/>
<option id="gnu.cpp.link.option.defname.1564463653" name="DEF file name (-Wl,--output-def=)" superClass="gnu.cpp.link.option.defname"/>
<option id="gnu.cpp.link.option.debugging.prof.1743439949" name="Generate prof information (-p)" superClass="gnu.cpp.link.option.debugging.prof"/>
<option id="gnu.cpp.link.option.debugging.gprof.665435379" name="Generate gprof information (-pg)" superClass="gnu.cpp.link.option.debugging.gprof"/>
<option id="gnu.cpp.link.option.debugging.codecov.1514526221" name="Generate gcov information (-ftest-coverage -fprofile-arcs)" superClass="gnu.cpp.link.option.debugging.codecov"/>
<option id="com.crt.advproject.link.cpp.lto.1147484310" name="Enable Link-time optimization (-flto)" superClass="com.crt.advproject.link.cpp.lto"/>
<option id="com.crt.advproject.link.cpp.lto.optmization.level.839027142" name="Link-time optimization level" superClass="com.crt.advproject.link.cpp.lto.optmization.level"/>
<option id="com.crt.advproject.link.cpp.thumb.1714509863" name="Thumb mode" superClass="com.crt.advproject.link.cpp.thumb"/>
<option id="com.crt.advproject.link.cpp.manage.1010357970" name="Manage linker script" superClass="com.crt.advproject.link.cpp.manage"/>
<option id="com.crt.advproject.link.cpp.script.1979180127" name="Linker script" superClass="com.crt.advproject.link.cpp.script"/>
<option id="com.crt.advproject.link.cpp.scriptdir.2111621902" name="Script path" superClass="com.crt.advproject.link.cpp.scriptdir"/>
<option id="com.crt.advproject.link.cpp.crpenable.502166984" name="Enable automatic placement of Code Read Protection field in image" superClass="com.crt.advproject.link.cpp.crpenable"/>
<option id="com.crt.advproject.link.cpp.flashconfigenable.1653194340" name="Enable automatic placement of Flash Configuration field in image" superClass="com.crt.advproject.link.cpp.flashconfigenable" value="true" valueType="boolean"/>
<option id="com.crt.advproject.link.cpp.ecrp.912310448" name="Enhanced CRP" superClass="com.crt.advproject.link.cpp.ecrp"/>
<option id="com.crt.advproject.link.cpp.hdrlib.1453750339" name="Library" superClass="com.crt.advproject.link.cpp.hdrlib" value="com.crt.advproject.cpp.link.hdrlib.newlibnano.nohost" valueType="enumerated"/>
<option id="com.crt.advproject.link.cpp.nanofloat.1379965290" name="Enable printf float " superClass="com.crt.advproject.link.cpp.nanofloat"/>
<option id="com.crt.advproject.link.cpp.nanofloat.scanf.1502371623" name="Enable scanf float " superClass="com.crt.advproject.link.cpp.nanofloat.scanf"/>
<option id="com.crt.advproject.link.cpp.toram.225096446" name="Link application to RAM" superClass="com.crt.advproject.link.cpp.toram"/>
<option id="com.crt.advproject.link.memory.load.image.cpp.1927351041" name="Plain load image" superClass="com.crt.advproject.link.memory.load.image.cpp"/>
<option id="com.crt.advproject.link.memory.heapAndStack.style.cpp.668543506" name="Heap and Stack placement" superClass="com.crt.advproject.link.memory.heapAndStack.style.cpp"/>
<option id="com.crt.advproject.link.cpp.stackOffset.2066768182" name="Stack offset" superClass="com.crt.advproject.link.cpp.stackOffset"/>
<option id="com.crt.advproject.link.memory.heapAndStack.cpp.669494958" name="Heap and Stack options" superClass="com.crt.advproject.link.memory.heapAndStack.cpp"/>
<option id="com.crt.advproject.link.memory.data.cpp.1605147883" name="Global data placement" superClass="com.crt.advproject.link.memory.data.cpp"/>
<option id="com.crt.advproject.link.memory.sections.cpp.657598863" name="Extra linker script input sections" superClass="com.crt.advproject.link.memory.sections.cpp"/>
<option id="com.crt.advproject.link.cpp.multicore.slave.1316902609" name="Multicore configuration" superClass="com.crt.advproject.link.cpp.multicore.slave"/>
<option id="com.crt.advproject.link.cpp.multicore.master.1683739160" name="Multicore master" superClass="com.crt.advproject.link.cpp.multicore.master"/>
<option id="com.crt.advproject.link.cpp.multicore.empty.506782287" name="No Multicore options for this project" superClass="com.crt.advproject.link.cpp.multicore.empty"/>
<option id="com.crt.advproject.link.cpp.multicore.master.userobjs.136476664" name="Slave Objects (not visible)" superClass="com.crt.advproject.link.cpp.multicore.master.userobjs"/>
<option id="com.crt.advproject.link.cpp.config.1179816857" name="Obsolete (Config)" superClass="com.crt.advproject.link.cpp.config"/>
<option id="com.crt.advproject.link.cpp.store.826432201" name="Obsolete (Store)" superClass="com.crt.advproject.link.cpp.store"/>
<option id="com.crt.advproject.link.cpp.securestate.1798664166" name="TrustZone Project Type" superClass="com.crt.advproject.link.cpp.securestate"/>
<option id="com.crt.advproject.link.cpp.sgstubs.placement.257324916" name="Secure Gateway Placement" superClass="com.crt.advproject.link.cpp.sgstubs.placement"/>
<option id="com.crt.advproject.link.cpp.sgstubenable.19294980" name="Enable generation of Secure Gateway Import Library" superClass="com.crt.advproject.link.cpp.sgstubenable"/>
<option id="com.crt.advproject.link.cpp.nonsecureobject.682297953" name="Secure Gateway Import Library" superClass="com.crt.advproject.link.cpp.nonsecureobject"/>
<option id="com.crt.advproject.link.cpp.inimplib.911627039" name="Input Secure Gateway Import Library" superClass="com.crt.advproject.link.cpp.inimplib"/>
</tool>
<tool id="com.crt.advproject.link.exe.release.1796248478" name="MCU Linker" superClass="com.crt.advproject.link.exe.release">
<option id="com.crt.advproject.link.thumb.1282025773" name="Thumb mode" superClass="com.crt.advproject.link.thumb" value="true" valueType="boolean"/>
<option id="com.crt.advproject.link.memory.load.image.307522021" name="Plain load image" superClass="com.crt.advproject.link.memory.load.image" value="" valueType="string"/>
<option defaultValue="com.crt.advproject.heapAndStack.mcuXpressoStyle" id="com.crt.advproject.link.memory.heapAndStack.style.1006432238" name="Heap and Stack placement" superClass="com.crt.advproject.link.memory.heapAndStack.style" valueType="enumerated"/>
<option id="com.crt.advproject.link.memory.heapAndStack.329623045" name="Heap and Stack options" superClass="com.crt.advproject.link.memory.heapAndStack" value="&amp;Heap:Default;Default;0x15f90&amp;Stack:Default;Default;0x800" valueType="string"/>
<option id="com.crt.advproject.link.memory.data.384024264" name="Global data placement" superClass="com.crt.advproject.link.memory.data" value="" valueType="string"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="true" id="com.crt.advproject.link.memory.sections.734863838" name="Extra linker script input sections" superClass="com.crt.advproject.link.memory.sections" valueType="stringList"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="true" id="com.crt.advproject.link.gcc.multicore.master.userobjs.1076254301" name="Slave Objects (not visible)" superClass="com.crt.advproject.link.gcc.multicore.master.userobjs" valueType="userObjs"/>
<option id="com.crt.advproject.link.gcc.multicore.slave.525105318" name="Multicore configuration" superClass="com.crt.advproject.link.gcc.multicore.slave"/>
<option id="com.crt.advproject.link.arch.560581080" name="Architecture" superClass="com.crt.advproject.link.arch" value="com.crt.advproject.link.target.cm33_nodsp" valueType="enumerated"/>
<option id="gnu.c.link.option.nostart.1694118519" name="Do not use standard start files (-nostartfiles)" superClass="gnu.c.link.option.nostart"/>
<option id="gnu.c.link.option.nodeflibs.1880672085" name="Do not use default libraries (-nodefaultlibs)" superClass="gnu.c.link.option.nodeflibs"/>
<option id="gnu.c.link.option.nostdlibs.1782346728" name="No startup or default libs (-nostdlib)" superClass="gnu.c.link.option.nostdlibs" value="true" valueType="boolean"/>
<option id="gnu.c.link.option.strip.1285794723" name="Omit all symbol information (-s)" superClass="gnu.c.link.option.strip"/>
<option id="gnu.c.link.option.noshared.852216313" name="No shared libraries (-static)" superClass="gnu.c.link.option.noshared"/>
<option id="gnu.c.link.option.libs.1412361055" name="Libraries (-l)" superClass="gnu.c.link.option.libs"/>
<option id="gnu.c.link.option.paths.144293356" name="Library search path (-L)" superClass="gnu.c.link.option.paths"/>
<option id="gnu.c.link.option.group.2108115602" name="Group libraries (-Wl,--start-group ... -Wl,--end-group)" superClass="gnu.c.link.option.group"/>
<option id="gnu.c.link.option.ldflags.703389183" name="Linker flags" superClass="gnu.c.link.option.ldflags"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.c.link.option.other.389584879" name="Other options (-Xlinker [option])" superClass="gnu.c.link.option.other" valueType="stringList">
<listOptionValue builtIn="false" value="-no-warn-rwx-segments"/>
<listOptionValue builtIn="false" value="-Map=&quot;${BuildArtifactFileBaseName}.map&quot;"/>
<listOptionValue builtIn="false" value="--gc-sections"/>
<listOptionValue builtIn="false" value="-print-memory-usage"/>
<listOptionValue builtIn="false" value="--sort-section=alignment"/>
<listOptionValue builtIn="false" value="--cref"/>
</option>
<option id="gnu.c.link.option.userobjs.221766604" name="Other objects" superClass="gnu.c.link.option.userobjs"/>
<option id="gnu.c.link.option.shared.2107864212" name="Shared (-shared)" superClass="gnu.c.link.option.shared"/>
<option id="gnu.c.link.option.soname.1743870400" name="Shared object name (-Wl,-soname=)" superClass="gnu.c.link.option.soname"/>
<option id="gnu.c.link.option.implname.1504662000" name="Import Library name (-Wl,--out-implib=)" superClass="gnu.c.link.option.implname"/>
<option id="gnu.c.link.option.defname.868023803" name="DEF file name (-Wl,--output-def=)" superClass="gnu.c.link.option.defname"/>
<option id="gnu.c.link.option.debugging.prof.1045505147" name="Generate prof information (-p)" superClass="gnu.c.link.option.debugging.prof"/>
<option id="gnu.c.link.option.debugging.gprof.450669885" name="Generate gprof information (-pg)" superClass="gnu.c.link.option.debugging.gprof"/>
<option id="gnu.c.link.option.debugging.codecov.1866932643" name="Generate gcov information (-ftest-coverage -fprofile-arcs)" superClass="gnu.c.link.option.debugging.codecov"/>
<option id="com.crt.advproject.link.gcc.lto.298108731" name="Enable Link-time optimization (-flto)" superClass="com.crt.advproject.link.gcc.lto"/>
<option id="com.crt.advproject.link.gcc.lto.optmization.level.39481577" name="Link-time optimization level" superClass="com.crt.advproject.link.gcc.lto.optmization.level"/>
<option id="com.crt.advproject.link.fpu.468384680" name="Floating point" superClass="com.crt.advproject.link.fpu" value="com.crt.advproject.link.fpu.fpv5sp.hard" valueType="enumerated"/>
<option id="com.crt.advproject.link.manage.2067414721" name="Manage linker script" superClass="com.crt.advproject.link.manage" value="true" valueType="boolean"/>
<option id="com.crt.advproject.link.script.2063312850" name="Linker script" superClass="com.crt.advproject.link.script" value="frdm-rw612-xpresso-freertos-lwip_Release.ld" valueType="string"/>
<option id="com.crt.advproject.link.scriptdir.980911141" name="Script path" superClass="com.crt.advproject.link.scriptdir"/>
<option id="com.crt.advproject.link.crpenable.384672127" name="Enable automatic placement of Code Read Protection field in image" superClass="com.crt.advproject.link.crpenable"/>
<option id="com.crt.advproject.link.flashconfigenable.1099279461" name="Enable automatic placement of Flash Configuration field in image" superClass="com.crt.advproject.link.flashconfigenable" value="true" valueType="boolean"/>
<option id="com.crt.advproject.link.ecrp.1380541347" name="Enhanced CRP" superClass="com.crt.advproject.link.ecrp"/>
<option id="com.crt.advproject.link.gcc.hdrlib.488079335" name="Library" superClass="com.crt.advproject.link.gcc.hdrlib" value="com.crt.advproject.gcc.link.hdrlib.newlibnano.nohost" valueType="enumerated"/>
<option id="com.crt.advproject.link.gcc.nanofloat.1189016349" name="Enable printf float " superClass="com.crt.advproject.link.gcc.nanofloat"/>
<option id="com.crt.advproject.link.gcc.nanofloat.scanf.483196119" name="Enable scanf float " superClass="com.crt.advproject.link.gcc.nanofloat.scanf"/>
<option id="com.crt.advproject.link.toram.1856728509" name="Link application to RAM" superClass="com.crt.advproject.link.toram"/>
<option id="com.crt.advproject.link.stackOffset.1459930769" name="Stack offset" superClass="com.crt.advproject.link.stackOffset"/>
<option id="com.crt.advproject.link.gcc.multicore.master.1887637832" name="Multicore master" superClass="com.crt.advproject.link.gcc.multicore.master"/>
<option id="com.crt.advproject.link.gcc.multicore.empty.2001495194" name="No Multicore options for this project" superClass="com.crt.advproject.link.gcc.multicore.empty"/>
<option id="com.crt.advproject.link.config.1922487468" name="Obsolete (Config)" superClass="com.crt.advproject.link.config"/>
<option id="com.crt.advproject.link.store.908213121" name="Obsolete (Store)" superClass="com.crt.advproject.link.store"/>
<option id="com.crt.advproject.link.securestate.1237011711" name="TrustZone Project Type" superClass="com.crt.advproject.link.securestate"/>
<option id="com.crt.advproject.link.sgstubs.placement.1953785846" name="Secure Gateway Placement" superClass="com.crt.advproject.link.sgstubs.placement"/>
<option id="com.crt.advproject.link.sgstubenable.1364235338" name="Enable generation of Secure Gateway Import Library" superClass="com.crt.advproject.link.sgstubenable"/>
<option id="com.crt.advproject.link.nonsecureobject.38053095" name="Secure Gateway Import Library" superClass="com.crt.advproject.link.nonsecureobject"/>
<option id="com.crt.advproject.link.inimplib.1183785230" name="Input Secure Gateway Import Library" superClass="com.crt.advproject.link.inimplib"/>
<inputType id="cdt.managedbuild.tool.gnu.c.linker.input.2025198933" superClass="cdt.managedbuild.tool.gnu.c.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
</inputType>
</tool>
<tool id="com.crt.advproject.tool.debug.release.1082520937" name="MCU Debugger" superClass="com.crt.advproject.tool.debug.release">
<option id="com.crt.advproject.miscellaneous.end_of_heap.1818360975" name="Last used address of the heap" superClass="com.crt.advproject.miscellaneous.end_of_heap"/>
<option id="com.crt.advproject.miscellaneous.pvHeapStart.2144777792" name="First address of the heap" superClass="com.crt.advproject.miscellaneous.pvHeapStart"/>
<option id="com.crt.advproject.miscellaneous.pvHeapLimit.1762095255" name="Maximum extent of heap" superClass="com.crt.advproject.miscellaneous.pvHeapLimit"/>
<option id="com.crt.advproject.debugger.security.nonsecureimageenable.1515614492" name="Enable pre-programming of Non-Secure Image" superClass="com.crt.advproject.debugger.security.nonsecureimageenable"/>
<option id="com.crt.advproject.debugger.security.nonsecureimage.1090477179" name="Non-Secure Project" superClass="com.crt.advproject.debugger.security.nonsecureimage"/>
</tool>
</toolChain>
</folderInfo>
<sourceEntries>
<entry flags="LOCAL|VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="CMSIS"/>
<entry flags="LOCAL|VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="board"/>
<entry flags="LOCAL|VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="component"/>
<entry flags="LOCAL|VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="device"/>
<entry flags="LOCAL|VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="drivers"/>
<entry flags="LOCAL|VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="flash"/>
<entry flags="LOCAL|VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="freertos"/>
<entry flags="LOCAL|VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="linkscripts"/>
<entry excluding="src/netif/ppp/polarssl/arc4.c|src/netif/ppp/polarssl/des.c|src/netif/ppp/polarssl/md4.c|src/netif/ppp/polarssl/md5.c|src/netif/ppp/polarssl/sha1.c" flags="LOCAL|VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="lwip"/>
<entry flags="LOCAL|VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="source"/>
<entry flags="LOCAL|VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="startup"/>
<entry flags="LOCAL|VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="utilities"/>
<entry flags="LOCAL|VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="wifi"/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="frdmrw612_wifi_webconfig.null.470491832" name="frdmrw612_wifi_webconfig" projectType="com.crt.advproject.projecttype.exe"/>
</storageModule>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
<scannerConfigBuildInfo instanceId="com.crt.advproject.config.exe.release.438620977;com.crt.advproject.config.exe.release.438620977.;com.crt.advproject.gas.exe.release.1383944148;com.crt.advproject.assembler.input.681352778">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.crt.advproject.config.exe.debug.252552941;com.crt.advproject.config.exe.debug.252552941.;com.crt.advproject.gcc.exe.debug.587026796;com.crt.advproject.compiler.input.1621627363">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.crt.advproject.config.exe.debug.252552941;com.crt.advproject.config.exe.debug.252552941.;com.crt.advproject.gas.exe.debug.64345950;com.crt.advproject.assembler.input.67269995">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.crt.advproject.config.exe.release.438620977;com.crt.advproject.config.exe.release.438620977.;com.crt.advproject.gcc.exe.release.1059172906;com.crt.advproject.compiler.input.1119421287">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
<storageModule moduleId="com.nxp.mcuxpresso.core.datamodels">
<sdkName>SDK_2.x_FRDM-RW612</sdkName>
<sdkExample>frdmrw612_wifi_webconfig</sdkExample>
<sdkVersion>2.16.100</sdkVersion>
<sdkComponents>middleware.wifi.imu.RW612;middleware.wifi.wifidriver.RW612;platform.drivers.flexcomm_usart_freertos.RW612;component.osa_free_rtos.RW612;driver.conn_fwloader.RW612;component.mflash.frdmrw612.RW612;component.mflash_file.RW612;component.wireless_imu_adapter.RW612;utility.debug_console.RW612;platform.utilities.assert.RW612;middleware.lwip.apps.httpsrv.RW612;platform.drivers.clock.RW612;middleware.freertos-kernel.heap_3.RW612;middleware.wifi.RW612;middleware.lwip.RW612;middleware.edgefast_wifi_nxp.RW612;middleware.freertos-kernel.cm33_non_trustzone.RW612;platform.drivers.flash_config.frdmrw612.RW612;device.RW612_CMSIS.RW612;device.RW612_startup.RW612;platform.drivers.reset.RW612;platform.drivers.flexspi.RW612;platform.drivers.cache_cache64.RW612;platform.drivers.cns_io_mux.RW612;platform.drivers.lpc_gpio.RW612;platform.drivers.power.RW612;platform.drivers.ocotp.RW612;component.els_pkc.platform.rw61x_standalone_clib_gdet_sensor.RW612;platform.utilities.misc_utilities.RW612;middleware.wifi.common_files.RW612;platform.drivers.imu.RW612;middleware.wifi.osa.RW612;middleware.wifi.osa_free_rtos.RW612;platform.drivers.common.RW612;middleware.wifi.template.RW612;middleware.wifi.net.RW612;component.wifi_bt_module.tx_pwr_limits.RW612;middleware.wifi.net_free_rtos.RW612;middleware.lwip.apps.lwiperf.RW612;middleware.freertos-kernel.RW612;middleware.freertos-kernel.template.RW612;middleware.freertos-kernel.extension.RW612;platform.drivers.flexcomm.RW612;platform.drivers.flexcomm_usart.RW612;component.lists.RW612;component.osa_interface.RW612;component.mflash.common.RW612;platform.drivers.gdma.RW612;component.serial_manager.RW612;utility.str.RW612;component.serial_manager_uart.RW612;component.usart_adapter.RW612;middleware.lwip.template.RW612;middleware.lwip.sys_arch_dynamic.RW612;CMSIS_Include_core_cm.RW612;device.RW612_system.RW612;component.els_pkc.els_header_only.RW612;component.els_pkc.els_common.RW612;component.els_pkc.memory.RW612;component.els_pkc.standalone_gdet.RW612;component.els_pkc.platform.rw61x_inf_header_only.RW612;component.els_pkc.buffer.RW612;component.els_pkc.core.RW612;component.els_pkc.param_integrity.RW612;component.els_pkc.flow_protection.RW612;component.els_pkc.secure_counter.RW612;component.els_pkc.pre_processor.RW612;component.els_pkc.toolchain.RW612;component.els_pkc.data_integrity.RW612;frdmrw612_wifi_webconfig;</sdkComponents>
<boardId>frdmrw612</boardId>
<package>RW612ETA2I</package>
<core>cm33_nodsp</core>
<coreId>cm33_RW612</coreId>
</storageModule>
<storageModule moduleId="com.crt.config">
<projectStorage>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;TargetConfig&gt;
&lt;Properties property_3="NXP" property_4="RW612" property_count="5" version="100300"/&gt;
&lt;infoList vendor="NXP"&gt;
&lt;info chip="RW612" name="RW612"&gt;
&lt;chip&gt;
&lt;name&gt;RW612&lt;/name&gt;
&lt;family&gt;RW61X&lt;/family&gt;
&lt;vendor&gt;NXP&lt;/vendor&gt;
&lt;memory can_program="true" id="Flash" is_ro="true" size="0" type="Flash"/&gt;
&lt;memory id="RAM" size="1216" type="RAM"/&gt;
&lt;memoryInstance derived_from="Flash" driver="RW61X_FlexSPI_A_SFDP_QSPI.cfx" edited="true" id="QSPI_FLASH" location="0x8000000" size="0x800000"/&gt;
&lt;memoryInstance derived_from="RAM" edited="true" id="SRAM" location="0x20000000" size="0x130000"/&gt;
&lt;memoryInstance derived_from="RAM" edited="true" id="MBOX1" location="0x41380000" size="0x488"/&gt;
&lt;memoryInstance derived_from="RAM" edited="true" id="TXQ1" location="0x41380488" size="0x1000"/&gt;
&lt;memoryInstance derived_from="RAM" edited="true" id="MBOX2" location="0x443c0000" size="0x488"/&gt;
&lt;memoryInstance derived_from="RAM" edited="true" id="TXQ23" location="0x443c0488" size="0x1080"/&gt;
&lt;memoryInstance derived_from="RAM" edited="true" id="TXQ32" location="0x443c1508" size="0x1080"/&gt;
&lt;/chip&gt;
&lt;processor&gt;
&lt;name gcc_name="cortex-m33-nodsp"&gt;Cortex-M33 (No DSP)&lt;/name&gt;
&lt;family&gt;Cortex-M&lt;/family&gt;
&lt;/processor&gt;
&lt;/info&gt;
&lt;/infoList&gt;
&lt;/TargetConfig&gt;</projectStorage>
</storageModule>
<storageModule moduleId="openCmsis"/>
<storageModule moduleId="refreshScope" versionNumber="2">
<configuration configurationName="Debug">
<resource resourceType="PROJECT" workspacePath="/frdm-rw612-xpresso-freertos-lwip"/>
</configuration>
<configuration configurationName="Release">
<resource resourceType="PROJECT" workspacePath="/frdm-rw612-xpresso-freertos-lwip"/>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
</cproject>
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>frdm-rw612-xpresso-freertos-lwip</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>com.nxp.mcuxpresso.core.datamodels.sdkNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
</natures>
</projectDescription>
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project>
<configuration id="com.crt.advproject.config.exe.debug.252552941" name="Debug">
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuildCommandParser" id="com.crt.advproject.GCCBuildCommandParser" keep-relative-paths="false" name="MCU GCC Build Output Parser" parameter="(arm-none-eabi-gcc)|(arm-none-eabi-[gc]\+\+)|(gcc)|([gc]\+\+)|(clang)" prefer-non-shared="true"/>
<provider class="com.crt.advproject.specs.MCUGCCBuiltinSpecsDetector" console="false" env-hash="452102550212881743" id="com.crt.advproject.GCCBuildSpecCompilerParser" keep-relative-paths="false" name="MCU GCC Built-in Compiler Parser" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
</extension>
</configuration>
<configuration id="com.crt.advproject.config.exe.release.438620977" name="Release">
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider copy-of="extension" id="com.crt.advproject.GCCBuildCommandParser"/>
<provider class="com.crt.advproject.specs.MCUGCCBuiltinSpecsDetector" console="false" env-hash="470729173164118281" id="com.crt.advproject.GCCBuildSpecCompilerParser" keep-relative-paths="false" name="MCU GCC Built-in Compiler Parser" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
</extension>
</configuration>
</project>
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8
@@ -0,0 +1,283 @@
/**************************************************************************//**
* @file cmsis_compiler.h
* @brief CMSIS compiler generic header file
* @version V5.1.0
* @date 09. October 2018
******************************************************************************/
/*
* Copyright (c) 2009-2018 Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the License); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef __CMSIS_COMPILER_H
#define __CMSIS_COMPILER_H
#include <stdint.h>
/*
* Arm Compiler 4/5
*/
#if defined ( __CC_ARM )
#include "cmsis_armcc.h"
/*
* Arm Compiler 6.6 LTM (armclang)
*/
#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) && (__ARMCC_VERSION < 6100100)
#include "cmsis_armclang_ltm.h"
/*
* Arm Compiler above 6.10.1 (armclang)
*/
#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6100100)
#include "cmsis_armclang.h"
/*
* GNU Compiler
*/
#elif defined ( __GNUC__ )
#include "cmsis_gcc.h"
/*
* IAR Compiler
*/
#elif defined ( __ICCARM__ )
#include <cmsis_iccarm.h>
/*
* TI Arm Compiler
*/
#elif defined ( __TI_ARM__ )
#include <cmsis_ccs.h>
#ifndef __ASM
#define __ASM __asm
#endif
#ifndef __INLINE
#define __INLINE inline
#endif
#ifndef __STATIC_INLINE
#define __STATIC_INLINE static inline
#endif
#ifndef __STATIC_FORCEINLINE
#define __STATIC_FORCEINLINE __STATIC_INLINE
#endif
#ifndef __NO_RETURN
#define __NO_RETURN __attribute__((noreturn))
#endif
#ifndef __USED
#define __USED __attribute__((used))
#endif
#ifndef __WEAK
#define __WEAK __attribute__((weak))
#endif
#ifndef __PACKED
#define __PACKED __attribute__((packed))
#endif
#ifndef __PACKED_STRUCT
#define __PACKED_STRUCT struct __attribute__((packed))
#endif
#ifndef __PACKED_UNION
#define __PACKED_UNION union __attribute__((packed))
#endif
#ifndef __UNALIGNED_UINT32 /* deprecated */
struct __attribute__((packed)) T_UINT32 { uint32_t v; };
#define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v)
#endif
#ifndef __UNALIGNED_UINT16_WRITE
__PACKED_STRUCT T_UINT16_WRITE { uint16_t v; };
#define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void*)(addr))->v) = (val))
#endif
#ifndef __UNALIGNED_UINT16_READ
__PACKED_STRUCT T_UINT16_READ { uint16_t v; };
#define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v)
#endif
#ifndef __UNALIGNED_UINT32_WRITE
__PACKED_STRUCT T_UINT32_WRITE { uint32_t v; };
#define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val))
#endif
#ifndef __UNALIGNED_UINT32_READ
__PACKED_STRUCT T_UINT32_READ { uint32_t v; };
#define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v)
#endif
#ifndef __ALIGNED
#define __ALIGNED(x) __attribute__((aligned(x)))
#endif
#ifndef __RESTRICT
#define __RESTRICT __restrict
#endif
#ifndef __COMPILER_BARRIER
#warning No compiler specific solution for __COMPILER_BARRIER. __COMPILER_BARRIER is ignored.
#define __COMPILER_BARRIER() (void)0
#endif
/*
* TASKING Compiler
*/
#elif defined ( __TASKING__ )
/*
* The CMSIS functions have been implemented as intrinsics in the compiler.
* Please use "carm -?i" to get an up to date list of all intrinsics,
* Including the CMSIS ones.
*/
#ifndef __ASM
#define __ASM __asm
#endif
#ifndef __INLINE
#define __INLINE inline
#endif
#ifndef __STATIC_INLINE
#define __STATIC_INLINE static inline
#endif
#ifndef __STATIC_FORCEINLINE
#define __STATIC_FORCEINLINE __STATIC_INLINE
#endif
#ifndef __NO_RETURN
#define __NO_RETURN __attribute__((noreturn))
#endif
#ifndef __USED
#define __USED __attribute__((used))
#endif
#ifndef __WEAK
#define __WEAK __attribute__((weak))
#endif
#ifndef __PACKED
#define __PACKED __packed__
#endif
#ifndef __PACKED_STRUCT
#define __PACKED_STRUCT struct __packed__
#endif
#ifndef __PACKED_UNION
#define __PACKED_UNION union __packed__
#endif
#ifndef __UNALIGNED_UINT32 /* deprecated */
struct __packed__ T_UINT32 { uint32_t v; };
#define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v)
#endif
#ifndef __UNALIGNED_UINT16_WRITE
__PACKED_STRUCT T_UINT16_WRITE { uint16_t v; };
#define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val))
#endif
#ifndef __UNALIGNED_UINT16_READ
__PACKED_STRUCT T_UINT16_READ { uint16_t v; };
#define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v)
#endif
#ifndef __UNALIGNED_UINT32_WRITE
__PACKED_STRUCT T_UINT32_WRITE { uint32_t v; };
#define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val))
#endif
#ifndef __UNALIGNED_UINT32_READ
__PACKED_STRUCT T_UINT32_READ { uint32_t v; };
#define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v)
#endif
#ifndef __ALIGNED
#define __ALIGNED(x) __align(x)
#endif
#ifndef __RESTRICT
#warning No compiler specific solution for __RESTRICT. __RESTRICT is ignored.
#define __RESTRICT
#endif
#ifndef __COMPILER_BARRIER
#warning No compiler specific solution for __COMPILER_BARRIER. __COMPILER_BARRIER is ignored.
#define __COMPILER_BARRIER() (void)0
#endif
/*
* COSMIC Compiler
*/
#elif defined ( __CSMC__ )
#include <cmsis_csm.h>
#ifndef __ASM
#define __ASM _asm
#endif
#ifndef __INLINE
#define __INLINE inline
#endif
#ifndef __STATIC_INLINE
#define __STATIC_INLINE static inline
#endif
#ifndef __STATIC_FORCEINLINE
#define __STATIC_FORCEINLINE __STATIC_INLINE
#endif
#ifndef __NO_RETURN
// NO RETURN is automatically detected hence no warning here
#define __NO_RETURN
#endif
#ifndef __USED
#warning No compiler specific solution for __USED. __USED is ignored.
#define __USED
#endif
#ifndef __WEAK
#define __WEAK __weak
#endif
#ifndef __PACKED
#define __PACKED @packed
#endif
#ifndef __PACKED_STRUCT
#define __PACKED_STRUCT @packed struct
#endif
#ifndef __PACKED_UNION
#define __PACKED_UNION @packed union
#endif
#ifndef __UNALIGNED_UINT32 /* deprecated */
@packed struct T_UINT32 { uint32_t v; };
#define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v)
#endif
#ifndef __UNALIGNED_UINT16_WRITE
__PACKED_STRUCT T_UINT16_WRITE { uint16_t v; };
#define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val))
#endif
#ifndef __UNALIGNED_UINT16_READ
__PACKED_STRUCT T_UINT16_READ { uint16_t v; };
#define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v)
#endif
#ifndef __UNALIGNED_UINT32_WRITE
__PACKED_STRUCT T_UINT32_WRITE { uint32_t v; };
#define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val))
#endif
#ifndef __UNALIGNED_UINT32_READ
__PACKED_STRUCT T_UINT32_READ { uint32_t v; };
#define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v)
#endif
#ifndef __ALIGNED
#warning No compiler specific solution for __ALIGNED. __ALIGNED is ignored.
#define __ALIGNED(x)
#endif
#ifndef __RESTRICT
#warning No compiler specific solution for __RESTRICT. __RESTRICT is ignored.
#define __RESTRICT
#endif
#ifndef __COMPILER_BARRIER
#warning No compiler specific solution for __COMPILER_BARRIER. __COMPILER_BARRIER is ignored.
#define __COMPILER_BARRIER() (void)0
#endif
#else
#error Unknown compiler.
#endif
#endif /* __CMSIS_COMPILER_H */
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,39 @@
/**************************************************************************//**
* @file cmsis_version.h
* @brief CMSIS Core(M) Version definitions
* @version V5.0.5
* @date 02. February 2022
******************************************************************************/
/*
* Copyright (c) 2009-2022 ARM Limited. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the License); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#if defined ( __ICCARM__ )
#pragma system_include /* treat file as system include file for MISRA check */
#elif defined (__clang__)
#pragma clang system_header /* treat file as system include file */
#endif
#ifndef __CMSIS_VERSION_H
#define __CMSIS_VERSION_H
/* CMSIS Version definitions */
#define __CM_CMSIS_VERSION_MAIN ( 5U) /*!< [31:16] CMSIS Core(M) main version */
#define __CM_CMSIS_VERSION_SUB ( 6U) /*!< [15:0] CMSIS Core(M) sub version */
#define __CM_CMSIS_VERSION ((__CM_CMSIS_VERSION_MAIN << 16U) | \
__CM_CMSIS_VERSION_SUB ) /*!< CMSIS Core(M) version number */
#endif
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,352 @@
/******************************************************************************
* @file mpu_armv8.h
* @brief CMSIS MPU API for Armv8-M and Armv8.1-M MPU
* @version V5.1.3
* @date 03. February 2021
******************************************************************************/
/*
* Copyright (c) 2017-2021 Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the License); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#if defined ( __ICCARM__ )
#pragma system_include /* treat file as system include file for MISRA check */
#elif defined (__clang__)
#pragma clang system_header /* treat file as system include file */
#endif
#ifndef ARM_MPU_ARMV8_H
#define ARM_MPU_ARMV8_H
/** \brief Attribute for device memory (outer only) */
#define ARM_MPU_ATTR_DEVICE ( 0U )
/** \brief Attribute for non-cacheable, normal memory */
#define ARM_MPU_ATTR_NON_CACHEABLE ( 4U )
/** \brief Attribute for normal memory (outer and inner)
* \param NT Non-Transient: Set to 1 for non-transient data.
* \param WB Write-Back: Set to 1 to use write-back update policy.
* \param RA Read Allocation: Set to 1 to use cache allocation on read miss.
* \param WA Write Allocation: Set to 1 to use cache allocation on write miss.
*/
#define ARM_MPU_ATTR_MEMORY_(NT, WB, RA, WA) \
((((NT) & 1U) << 3U) | (((WB) & 1U) << 2U) | (((RA) & 1U) << 1U) | ((WA) & 1U))
/** \brief Device memory type non Gathering, non Re-ordering, non Early Write Acknowledgement */
#define ARM_MPU_ATTR_DEVICE_nGnRnE (0U)
/** \brief Device memory type non Gathering, non Re-ordering, Early Write Acknowledgement */
#define ARM_MPU_ATTR_DEVICE_nGnRE (1U)
/** \brief Device memory type non Gathering, Re-ordering, Early Write Acknowledgement */
#define ARM_MPU_ATTR_DEVICE_nGRE (2U)
/** \brief Device memory type Gathering, Re-ordering, Early Write Acknowledgement */
#define ARM_MPU_ATTR_DEVICE_GRE (3U)
/** \brief Memory Attribute
* \param O Outer memory attributes
* \param I O == ARM_MPU_ATTR_DEVICE: Device memory attributes, else: Inner memory attributes
*/
#define ARM_MPU_ATTR(O, I) ((((O) & 0xFU) << 4U) | ((((O) & 0xFU) != 0U) ? ((I) & 0xFU) : (((I) & 0x3U) << 2U)))
/** \brief Normal memory non-shareable */
#define ARM_MPU_SH_NON (0U)
/** \brief Normal memory outer shareable */
#define ARM_MPU_SH_OUTER (2U)
/** \brief Normal memory inner shareable */
#define ARM_MPU_SH_INNER (3U)
/** \brief Memory access permissions
* \param RO Read-Only: Set to 1 for read-only memory.
* \param NP Non-Privileged: Set to 1 for non-privileged memory.
*/
#define ARM_MPU_AP_(RO, NP) ((((RO) & 1U) << 1U) | ((NP) & 1U))
/** \brief Region Base Address Register value
* \param BASE The base address bits [31:5] of a memory region. The value is zero extended. Effective address gets 32 byte aligned.
* \param SH Defines the Shareability domain for this memory region.
* \param RO Read-Only: Set to 1 for a read-only memory region.
* \param NP Non-Privileged: Set to 1 for a non-privileged memory region.
* \oaram XN eXecute Never: Set to 1 for a non-executable memory region.
*/
#define ARM_MPU_RBAR(BASE, SH, RO, NP, XN) \
(((BASE) & MPU_RBAR_BASE_Msk) | \
(((SH) << MPU_RBAR_SH_Pos) & MPU_RBAR_SH_Msk) | \
((ARM_MPU_AP_(RO, NP) << MPU_RBAR_AP_Pos) & MPU_RBAR_AP_Msk) | \
(((XN) << MPU_RBAR_XN_Pos) & MPU_RBAR_XN_Msk))
/** \brief Region Limit Address Register value
* \param LIMIT The limit address bits [31:5] for this memory region. The value is one extended.
* \param IDX The attribute index to be associated with this memory region.
*/
#define ARM_MPU_RLAR(LIMIT, IDX) \
(((LIMIT) & MPU_RLAR_LIMIT_Msk) | \
(((IDX) << MPU_RLAR_AttrIndx_Pos) & MPU_RLAR_AttrIndx_Msk) | \
(MPU_RLAR_EN_Msk))
#if defined(MPU_RLAR_PXN_Pos)
/** \brief Region Limit Address Register with PXN value
* \param LIMIT The limit address bits [31:5] for this memory region. The value is one extended.
* \param PXN Privileged execute never. Defines whether code can be executed from this privileged region.
* \param IDX The attribute index to be associated with this memory region.
*/
#define ARM_MPU_RLAR_PXN(LIMIT, PXN, IDX) \
(((LIMIT) & MPU_RLAR_LIMIT_Msk) | \
(((PXN) << MPU_RLAR_PXN_Pos) & MPU_RLAR_PXN_Msk) | \
(((IDX) << MPU_RLAR_AttrIndx_Pos) & MPU_RLAR_AttrIndx_Msk) | \
(MPU_RLAR_EN_Msk))
#endif
/**
* Struct for a single MPU Region
*/
typedef struct {
uint32_t RBAR; /*!< Region Base Address Register value */
uint32_t RLAR; /*!< Region Limit Address Register value */
} ARM_MPU_Region_t;
/** Enable the MPU.
* \param MPU_Control Default access permissions for unconfigured regions.
*/
__STATIC_INLINE void ARM_MPU_Enable(uint32_t MPU_Control)
{
__DMB();
MPU->CTRL = MPU_Control | MPU_CTRL_ENABLE_Msk;
#ifdef SCB_SHCSR_MEMFAULTENA_Msk
SCB->SHCSR |= SCB_SHCSR_MEMFAULTENA_Msk;
#endif
__DSB();
__ISB();
}
/** Disable the MPU.
*/
__STATIC_INLINE void ARM_MPU_Disable(void)
{
__DMB();
#ifdef SCB_SHCSR_MEMFAULTENA_Msk
SCB->SHCSR &= ~SCB_SHCSR_MEMFAULTENA_Msk;
#endif
MPU->CTRL &= ~MPU_CTRL_ENABLE_Msk;
__DSB();
__ISB();
}
#ifdef MPU_NS
/** Enable the Non-secure MPU.
* \param MPU_Control Default access permissions for unconfigured regions.
*/
__STATIC_INLINE void ARM_MPU_Enable_NS(uint32_t MPU_Control)
{
__DMB();
MPU_NS->CTRL = MPU_Control | MPU_CTRL_ENABLE_Msk;
#ifdef SCB_SHCSR_MEMFAULTENA_Msk
SCB_NS->SHCSR |= SCB_SHCSR_MEMFAULTENA_Msk;
#endif
__DSB();
__ISB();
}
/** Disable the Non-secure MPU.
*/
__STATIC_INLINE void ARM_MPU_Disable_NS(void)
{
__DMB();
#ifdef SCB_SHCSR_MEMFAULTENA_Msk
SCB_NS->SHCSR &= ~SCB_SHCSR_MEMFAULTENA_Msk;
#endif
MPU_NS->CTRL &= ~MPU_CTRL_ENABLE_Msk;
__DSB();
__ISB();
}
#endif
/** Set the memory attribute encoding to the given MPU.
* \param mpu Pointer to the MPU to be configured.
* \param idx The attribute index to be set [0-7]
* \param attr The attribute value to be set.
*/
__STATIC_INLINE void ARM_MPU_SetMemAttrEx(MPU_Type* mpu, uint8_t idx, uint8_t attr)
{
const uint8_t reg = idx / 4U;
const uint32_t pos = ((idx % 4U) * 8U);
const uint32_t mask = 0xFFU << pos;
if (reg >= (sizeof(mpu->MAIR) / sizeof(mpu->MAIR[0]))) {
return; // invalid index
}
mpu->MAIR[reg] = ((mpu->MAIR[reg] & ~mask) | ((attr << pos) & mask));
}
/** Set the memory attribute encoding.
* \param idx The attribute index to be set [0-7]
* \param attr The attribute value to be set.
*/
__STATIC_INLINE void ARM_MPU_SetMemAttr(uint8_t idx, uint8_t attr)
{
ARM_MPU_SetMemAttrEx(MPU, idx, attr);
}
#ifdef MPU_NS
/** Set the memory attribute encoding to the Non-secure MPU.
* \param idx The attribute index to be set [0-7]
* \param attr The attribute value to be set.
*/
__STATIC_INLINE void ARM_MPU_SetMemAttr_NS(uint8_t idx, uint8_t attr)
{
ARM_MPU_SetMemAttrEx(MPU_NS, idx, attr);
}
#endif
/** Clear and disable the given MPU region of the given MPU.
* \param mpu Pointer to MPU to be used.
* \param rnr Region number to be cleared.
*/
__STATIC_INLINE void ARM_MPU_ClrRegionEx(MPU_Type* mpu, uint32_t rnr)
{
mpu->RNR = rnr;
mpu->RLAR = 0U;
}
/** Clear and disable the given MPU region.
* \param rnr Region number to be cleared.
*/
__STATIC_INLINE void ARM_MPU_ClrRegion(uint32_t rnr)
{
ARM_MPU_ClrRegionEx(MPU, rnr);
}
#ifdef MPU_NS
/** Clear and disable the given Non-secure MPU region.
* \param rnr Region number to be cleared.
*/
__STATIC_INLINE void ARM_MPU_ClrRegion_NS(uint32_t rnr)
{
ARM_MPU_ClrRegionEx(MPU_NS, rnr);
}
#endif
/** Configure the given MPU region of the given MPU.
* \param mpu Pointer to MPU to be used.
* \param rnr Region number to be configured.
* \param rbar Value for RBAR register.
* \param rlar Value for RLAR register.
*/
__STATIC_INLINE void ARM_MPU_SetRegionEx(MPU_Type* mpu, uint32_t rnr, uint32_t rbar, uint32_t rlar)
{
mpu->RNR = rnr;
mpu->RBAR = rbar;
mpu->RLAR = rlar;
}
/** Configure the given MPU region.
* \param rnr Region number to be configured.
* \param rbar Value for RBAR register.
* \param rlar Value for RLAR register.
*/
__STATIC_INLINE void ARM_MPU_SetRegion(uint32_t rnr, uint32_t rbar, uint32_t rlar)
{
ARM_MPU_SetRegionEx(MPU, rnr, rbar, rlar);
}
#ifdef MPU_NS
/** Configure the given Non-secure MPU region.
* \param rnr Region number to be configured.
* \param rbar Value for RBAR register.
* \param rlar Value for RLAR register.
*/
__STATIC_INLINE void ARM_MPU_SetRegion_NS(uint32_t rnr, uint32_t rbar, uint32_t rlar)
{
ARM_MPU_SetRegionEx(MPU_NS, rnr, rbar, rlar);
}
#endif
/** Memcpy with strictly ordered memory access, e.g. used by code in ARM_MPU_LoadEx()
* \param dst Destination data is copied to.
* \param src Source data is copied from.
* \param len Amount of data words to be copied.
*/
__STATIC_INLINE void ARM_MPU_OrderedMemcpy(volatile uint32_t* dst, const uint32_t* __RESTRICT src, uint32_t len)
{
uint32_t i;
for (i = 0U; i < len; ++i)
{
dst[i] = src[i];
}
}
/** Load the given number of MPU regions from a table to the given MPU.
* \param mpu Pointer to the MPU registers to be used.
* \param rnr First region number to be configured.
* \param table Pointer to the MPU configuration table.
* \param cnt Amount of regions to be configured.
*/
__STATIC_INLINE void ARM_MPU_LoadEx(MPU_Type* mpu, uint32_t rnr, ARM_MPU_Region_t const* table, uint32_t cnt)
{
const uint32_t rowWordSize = sizeof(ARM_MPU_Region_t)/4U;
if (cnt == 1U) {
mpu->RNR = rnr;
ARM_MPU_OrderedMemcpy(&(mpu->RBAR), &(table->RBAR), rowWordSize);
} else {
uint32_t rnrBase = rnr & ~(MPU_TYPE_RALIASES-1U);
uint32_t rnrOffset = rnr % MPU_TYPE_RALIASES;
mpu->RNR = rnrBase;
while ((rnrOffset + cnt) > MPU_TYPE_RALIASES) {
uint32_t c = MPU_TYPE_RALIASES - rnrOffset;
ARM_MPU_OrderedMemcpy(&(mpu->RBAR)+(rnrOffset*2U), &(table->RBAR), c*rowWordSize);
table += c;
cnt -= c;
rnrOffset = 0U;
rnrBase += MPU_TYPE_RALIASES;
mpu->RNR = rnrBase;
}
ARM_MPU_OrderedMemcpy(&(mpu->RBAR)+(rnrOffset*2U), &(table->RBAR), cnt*rowWordSize);
}
}
/** Load the given number of MPU regions from a table.
* \param rnr First region number to be configured.
* \param table Pointer to the MPU configuration table.
* \param cnt Amount of regions to be configured.
*/
__STATIC_INLINE void ARM_MPU_Load(uint32_t rnr, ARM_MPU_Region_t const* table, uint32_t cnt)
{
ARM_MPU_LoadEx(MPU, rnr, table, cnt);
}
#ifdef MPU_NS
/** Load the given number of MPU regions from a table to the Non-secure MPU.
* \param rnr First region number to be configured.
* \param table Pointer to the MPU configuration table.
* \param cnt Amount of regions to be configured.
*/
__STATIC_INLINE void ARM_MPU_Load_NS(uint32_t rnr, ARM_MPU_Region_t const* table, uint32_t cnt)
{
ARM_MPU_LoadEx(MPU_NS, rnr, table, cnt);
}
#endif
#endif
@@ -0,0 +1,70 @@
/******************************************************************************
* @file tz_context.h
* @brief Context Management for Armv8-M TrustZone
* @version V1.0.1
* @date 10. January 2018
******************************************************************************/
/*
* Copyright (c) 2017-2018 Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the License); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#if defined ( __ICCARM__ )
#pragma system_include /* treat file as system include file for MISRA check */
#elif defined (__clang__)
#pragma clang system_header /* treat file as system include file */
#endif
#ifndef TZ_CONTEXT_H
#define TZ_CONTEXT_H
#include <stdint.h>
#ifndef TZ_MODULEID_T
#define TZ_MODULEID_T
/// \details Data type that identifies secure software modules called by a process.
typedef uint32_t TZ_ModuleId_t;
#endif
/// \details TZ Memory ID identifies an allocated memory slot.
typedef uint32_t TZ_MemoryId_t;
/// Initialize secure context memory system
/// \return execution status (1: success, 0: error)
uint32_t TZ_InitContextSystem_S (void);
/// Allocate context memory for calling secure software modules in TrustZone
/// \param[in] module identifies software modules called from non-secure mode
/// \return value != 0 id TrustZone memory slot identifier
/// \return value 0 no memory available or internal error
TZ_MemoryId_t TZ_AllocModuleContext_S (TZ_ModuleId_t module);
/// Free context memory that was previously allocated with \ref TZ_AllocModuleContext_S
/// \param[in] id TrustZone memory slot identifier
/// \return execution status (1: success, 0: error)
uint32_t TZ_FreeModuleContext_S (TZ_MemoryId_t id);
/// Load secure context (called on RTOS thread context switch)
/// \param[in] id TrustZone memory slot identifier
/// \return execution status (1: success, 0: error)
uint32_t TZ_LoadContext_S (TZ_MemoryId_t id);
/// Store secure context (called on RTOS thread context switch)
/// \param[in] id TrustZone memory slot identifier
/// \return execution status (1: success, 0: error)
uint32_t TZ_StoreContext_S (TZ_MemoryId_t id);
#endif // TZ_CONTEXT_H
@@ -0,0 +1,453 @@
/*
* GENERATED FILE - DO NOT EDIT
* Copyright 2008-2013 Code Red Technologies Ltd,
* Copyright 2013-2025 NXP
* SPDX-License-Identifier: BSD-3-Clause
* Generated linker script file for RW612
* Created from linkscript.ldt by FMCreateLinkLibraries
* Using Freemarker v2.3.30
* MCUXpresso IDE v24.12 [Build 148] [2025-01-10] on Jun 6, 2025, 7:53:58 PM
*/
INCLUDE "frdm-rw612-xpresso-freertos-lwip_Debug_library.ld"
INCLUDE "frdm-rw612-xpresso-freertos-lwip_Debug_memory.ld"
ENTRY(ResetISR)
SECTIONS
{
/* Offset .text by 0x1000 bytes, which whill be added by the image tool*/
.boot_hdr : ALIGN(4)
{
FILL(0xFF)
. = 0x400;
__FLASH_BASE = .;
KEEP(*(.flash_conf))
. = 0x1000;
} > QSPI_FLASH
/* MAIN TEXT SECTION */
.text : ALIGN(4)
{
FILL(0xff)
__vectors_start__ = ABSOLUTE(.) ;
KEEP(*(.isr_vector))
/* Global Section Table */
. = ALIGN(4) ;
__section_table_start = .;
__data_section_table = .;
LONG(LOADADDR(.data));
LONG( ADDR(.data));
LONG( SIZEOF(.data));
LONG(LOADADDR(.data_RAM2));
LONG( ADDR(.data_RAM2));
LONG( SIZEOF(.data_RAM2));
LONG(LOADADDR(.data_RAM3));
LONG( ADDR(.data_RAM3));
LONG( SIZEOF(.data_RAM3));
LONG(LOADADDR(.data_RAM4));
LONG( ADDR(.data_RAM4));
LONG( SIZEOF(.data_RAM4));
LONG(LOADADDR(.data_RAM5));
LONG( ADDR(.data_RAM5));
LONG( SIZEOF(.data_RAM5));
LONG(LOADADDR(.data_RAM6));
LONG( ADDR(.data_RAM6));
LONG( SIZEOF(.data_RAM6));
__data_section_table_end = .;
__bss_section_table = .;
LONG( ADDR(.bss));
LONG( SIZEOF(.bss));
LONG( ADDR(.bss_RAM2));
LONG( SIZEOF(.bss_RAM2));
LONG( ADDR(.bss_RAM3));
LONG( SIZEOF(.bss_RAM3));
LONG( ADDR(.bss_RAM4));
LONG( SIZEOF(.bss_RAM4));
LONG( ADDR(.bss_RAM5));
LONG( SIZEOF(.bss_RAM5));
LONG( ADDR(.bss_RAM6));
LONG( SIZEOF(.bss_RAM6));
__bss_section_table_end = .;
__section_table_end = . ;
/* End of Global Section Table */
*(.after_vectors*)
*(EXCLUDE_FILE(*mflash_drv.o *fsl_flexspi.o) .text*) KEEP(*freertos*/tasks.o(.rodata*)) /* FreeRTOS Debug Config */
*(.rodata)
*(EXCLUDE_FILE(*mflash_drv.o *fsl_flexspi.o).rodata.*)
*(.constdata .constdata.*)
. = ALIGN(4);
} > QSPI_FLASH
/*
* for exception handling/unwind - some Newlib functions (in common
* with C++ and STDC++) use this.
*/
.ARM.extab : ALIGN(4)
{
*(.ARM.extab* .gnu.linkonce.armextab.*)
} > QSPI_FLASH
.ARM.exidx : ALIGN(4)
{
__exidx_start = .;
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
__exidx_end = .;
} > QSPI_FLASH
_etext = .;
/* DATA section for MBOX1 */
.data_RAM2 : ALIGN(4)
{
FILL(0xff)
PROVIDE(__start_data_RAM2 = .) ;
PROVIDE(__start_data_MBOX1 = .) ;
*(.ramfunc.$RAM2)
*(.ramfunc.$MBOX1)
*(.data.$RAM2)
*(.data.$MBOX1)
*(.data.$RAM2.*)
*(.data.$MBOX1.*)
. = ALIGN(4) ;
PROVIDE(__end_data_RAM2 = .) ;
PROVIDE(__end_data_MBOX1 = .) ;
} > MBOX1 AT>QSPI_FLASH
/* DATA section for TXQ1 */
.data_RAM3 : ALIGN(4)
{
FILL(0xff)
PROVIDE(__start_data_RAM3 = .) ;
PROVIDE(__start_data_TXQ1 = .) ;
*(.ramfunc.$RAM3)
*(.ramfunc.$TXQ1)
*(.data.$RAM3)
*(.data.$TXQ1)
*(.data.$RAM3.*)
*(.data.$TXQ1.*)
. = ALIGN(4) ;
PROVIDE(__end_data_RAM3 = .) ;
PROVIDE(__end_data_TXQ1 = .) ;
} > TXQ1 AT>QSPI_FLASH
/* DATA section for MBOX2 */
.data_RAM4 : ALIGN(4)
{
FILL(0xff)
PROVIDE(__start_data_RAM4 = .) ;
PROVIDE(__start_data_MBOX2 = .) ;
*(.ramfunc.$RAM4)
*(.ramfunc.$MBOX2)
*(.data.$RAM4)
*(.data.$MBOX2)
*(.data.$RAM4.*)
*(.data.$MBOX2.*)
. = ALIGN(4) ;
PROVIDE(__end_data_RAM4 = .) ;
PROVIDE(__end_data_MBOX2 = .) ;
} > MBOX2 AT>QSPI_FLASH
/* DATA section for TXQ23 */
.data_RAM5 : ALIGN(4)
{
FILL(0xff)
PROVIDE(__start_data_RAM5 = .) ;
PROVIDE(__start_data_TXQ23 = .) ;
*(.ramfunc.$RAM5)
*(.ramfunc.$TXQ23)
*(.data.$RAM5)
*(.data.$TXQ23)
*(.data.$RAM5.*)
*(.data.$TXQ23.*)
. = ALIGN(4) ;
PROVIDE(__end_data_RAM5 = .) ;
PROVIDE(__end_data_TXQ23 = .) ;
} > TXQ23 AT>QSPI_FLASH
/* DATA section for TXQ32 */
.data_RAM6 : ALIGN(4)
{
FILL(0xff)
PROVIDE(__start_data_RAM6 = .) ;
PROVIDE(__start_data_TXQ32 = .) ;
*(.ramfunc.$RAM6)
*(.ramfunc.$TXQ32)
*(.data.$RAM6)
*(.data.$TXQ32)
*(.data.$RAM6.*)
*(.data.$TXQ32.*)
. = ALIGN(4) ;
PROVIDE(__end_data_RAM6 = .) ;
PROVIDE(__end_data_TXQ32 = .) ;
} > TXQ32 AT>QSPI_FLASH
/* MAIN DATA SECTION */
.uninit_RESERVED (NOLOAD) : ALIGN(4)
{
_start_uninit_RESERVED = .;
KEEP(*(.bss.$RESERVED*))
. = ALIGN(4) ;
_end_uninit_RESERVED = .;
} > SRAM AT> SRAM
/* Main DATA section (SRAM) */
.data : ALIGN(4)
{
FILL(0xff)
_data = . ;
PROVIDE(__start_data_RAM = .) ;
PROVIDE(__start_data_SRAM = .) ;
*(vtable)
*(.ramfunc*)
KEEP(*(CodeQuickAccess))
KEEP(*(DataQuickAccess))
*(RamFunction)
*mflash_drv.o(.text .text* .rodata .rodata*)
*fsl_flexspi.o(.text .text* .rodata .rodata*)
*(.data*)
. = ALIGN(4) ;
_edata = . ;
PROVIDE(__end_data_RAM = .) ;
PROVIDE(__end_data_SRAM = .) ;
} > SRAM AT>QSPI_FLASH
/* BSS section for MBOX1 */
.bss_RAM2 (NOLOAD) : ALIGN(4)
{
PROVIDE(__start_bss_RAM2 = .) ;
PROVIDE(__start_bss_MBOX1 = .) ;
*(.bss.$RAM2)
*(.bss.$MBOX1)
*(.bss.$RAM2.*)
*(.bss.$MBOX1.*)
. = ALIGN (. != 0 ? 4 : 1) ; /* avoid empty segment */
PROVIDE(__end_bss_RAM2 = .) ;
PROVIDE(__end_bss_MBOX1 = .) ;
} > MBOX1 AT> MBOX1
/* BSS section for TXQ1 */
.bss_RAM3 (NOLOAD) : ALIGN(4)
{
PROVIDE(__start_bss_RAM3 = .) ;
PROVIDE(__start_bss_TXQ1 = .) ;
*(.bss.$RAM3)
*(.bss.$TXQ1)
*(.bss.$RAM3.*)
*(.bss.$TXQ1.*)
. = ALIGN (. != 0 ? 4 : 1) ; /* avoid empty segment */
PROVIDE(__end_bss_RAM3 = .) ;
PROVIDE(__end_bss_TXQ1 = .) ;
} > TXQ1 AT> TXQ1
/* BSS section for MBOX2 */
.bss_RAM4 (NOLOAD) : ALIGN(4)
{
PROVIDE(__start_bss_RAM4 = .) ;
PROVIDE(__start_bss_MBOX2 = .) ;
*(.bss.$RAM4)
*(.bss.$MBOX2)
*(.bss.$RAM4.*)
*(.bss.$MBOX2.*)
. = ALIGN (. != 0 ? 4 : 1) ; /* avoid empty segment */
PROVIDE(__end_bss_RAM4 = .) ;
PROVIDE(__end_bss_MBOX2 = .) ;
} > MBOX2 AT> MBOX2
/* BSS section for TXQ23 */
.bss_RAM5 (NOLOAD) : ALIGN(4)
{
PROVIDE(__start_bss_RAM5 = .) ;
PROVIDE(__start_bss_TXQ23 = .) ;
*(.bss.$RAM5)
*(.bss.$TXQ23)
*(.bss.$RAM5.*)
*(.bss.$TXQ23.*)
. = ALIGN (. != 0 ? 4 : 1) ; /* avoid empty segment */
PROVIDE(__end_bss_RAM5 = .) ;
PROVIDE(__end_bss_TXQ23 = .) ;
} > TXQ23 AT> TXQ23
/* BSS section for TXQ32 */
.bss_RAM6 (NOLOAD) : ALIGN(4)
{
PROVIDE(__start_bss_RAM6 = .) ;
PROVIDE(__start_bss_TXQ32 = .) ;
*(.bss.$RAM6)
*(.bss.$TXQ32)
*(.bss.$RAM6.*)
*(.bss.$TXQ32.*)
. = ALIGN (. != 0 ? 4 : 1) ; /* avoid empty segment */
PROVIDE(__end_bss_RAM6 = .) ;
PROVIDE(__end_bss_TXQ32 = .) ;
} > TXQ32 AT> TXQ32
/* MAIN BSS SECTION */
.bss (NOLOAD) : ALIGN(4)
{
_bss = .;
PROVIDE(__start_bss_RAM = .) ;
PROVIDE(__start_bss_SRAM = .) ;
*(.bss*)
*(COMMON)
. = ALIGN(4) ;
_ebss = .;
PROVIDE(__end_bss_RAM = .) ;
PROVIDE(__end_bss_SRAM = .) ;
PROVIDE(end = .);
} > SRAM AT> SRAM
/* NOINIT section for MBOX1 */
.noinit_RAM2 (NOLOAD) : ALIGN(4)
{
PROVIDE(__start_noinit_RAM2 = .) ;
PROVIDE(__start_noinit_MBOX1 = .) ;
*(.noinit.$RAM2)
*(.noinit.$MBOX1)
*(.noinit.$RAM2.*)
*(.noinit.$MBOX1.*)
. = ALIGN(4) ;
PROVIDE(__end_noinit_RAM2 = .) ;
PROVIDE(__end_noinit_MBOX1 = .) ;
} > MBOX1 AT> MBOX1
/* NOINIT section for TXQ1 */
.noinit_RAM3 (NOLOAD) : ALIGN(4)
{
PROVIDE(__start_noinit_RAM3 = .) ;
PROVIDE(__start_noinit_TXQ1 = .) ;
*(.noinit.$RAM3)
*(.noinit.$TXQ1)
*(.noinit.$RAM3.*)
*(.noinit.$TXQ1.*)
. = ALIGN(4) ;
PROVIDE(__end_noinit_RAM3 = .) ;
PROVIDE(__end_noinit_TXQ1 = .) ;
} > TXQ1 AT> TXQ1
/* NOINIT section for MBOX2 */
.noinit_RAM4 (NOLOAD) : ALIGN(4)
{
PROVIDE(__start_noinit_RAM4 = .) ;
PROVIDE(__start_noinit_MBOX2 = .) ;
*(.noinit.$RAM4)
*(.noinit.$MBOX2)
*(.noinit.$RAM4.*)
*(.noinit.$MBOX2.*)
. = ALIGN(4) ;
PROVIDE(__end_noinit_RAM4 = .) ;
PROVIDE(__end_noinit_MBOX2 = .) ;
} > MBOX2 AT> MBOX2
/* NOINIT section for TXQ23 */
.noinit_RAM5 (NOLOAD) : ALIGN(4)
{
PROVIDE(__start_noinit_RAM5 = .) ;
PROVIDE(__start_noinit_TXQ23 = .) ;
*(.noinit.$RAM5)
*(.noinit.$TXQ23)
*(.noinit.$RAM5.*)
*(.noinit.$TXQ23.*)
. = ALIGN(4) ;
PROVIDE(__end_noinit_RAM5 = .) ;
PROVIDE(__end_noinit_TXQ23 = .) ;
} > TXQ23 AT> TXQ23
/* NOINIT section for TXQ32 */
.noinit_RAM6 (NOLOAD) : ALIGN(4)
{
PROVIDE(__start_noinit_RAM6 = .) ;
PROVIDE(__start_noinit_TXQ32 = .) ;
*(.noinit.$RAM6)
*(.noinit.$TXQ32)
*(.noinit.$RAM6.*)
*(.noinit.$TXQ32.*)
. = ALIGN(4) ;
PROVIDE(__end_noinit_RAM6 = .) ;
PROVIDE(__end_noinit_TXQ32 = .) ;
} > TXQ32 AT> TXQ32
/* DEFAULT NOINIT SECTION */
.noinit (NOLOAD): ALIGN(4)
{
_noinit = .;
PROVIDE(__start_noinit_RAM = .) ;
PROVIDE(__start_noinit_SRAM = .) ;
*(.noinit*)
. = ALIGN(4) ;
_end_noinit = .;
PROVIDE(__end_noinit_RAM = .) ;
PROVIDE(__end_noinit_SRAM = .) ;
} > SRAM AT> SRAM
.smu_cpu13_mbox (NOLOAD) :
{
. = ALIGN(4);
*(.smu_cpu13_mbox)
KEEP (*(.smu_cpu13_mbox))
. = ALIGN(4);
} > MBOX1 AT> MBOX1
.smu_cpu31_txq (NOLOAD) :
{
. = ALIGN(4);
*(.smu_cpu31_txq)
KEEP (*(.smu_cpu31_txq))
. = ALIGN(4);
} > TXQ1 AT> TXQ1
.smu_cpu23_mbox (NOLOAD) :
{
. = ALIGN(4);
*(.smu_cpu23_mbox)
KEEP (*(.smu_cpu23_mbox))
. = ALIGN(4);
} > MBOX2 AT> MBOX2
.smu_cpu32_txq (NOLOAD) :
{
. = ALIGN(4);
*(.smu_cpu32_txq)
KEEP (*(.smu_cpu32_txq))
. = ALIGN(4);
} > TXQ32 AT> TXQ32
/* Reserve and place Heap within memory map */
_HeapSize = 0x15f90;
.heap (NOLOAD) : ALIGN(4)
{
_pvHeapStart = .;
. += _HeapSize;
. = ALIGN(4);
_pvHeapLimit = .;
} > SRAM
_StackSize = 0x800;
/* Reserve space in memory for Stack */
.heap2stackfill (NOLOAD) :
{
. += _StackSize;
} > SRAM
/* Locate actual Stack in memory map */
.stack ORIGIN(SRAM) + LENGTH(SRAM) - _StackSize - 0 (NOLOAD) : ALIGN(4)
{
_vStackBase = .;
. = ALIGN(4);
_vStackTop = . + _StackSize;
} > SRAM
/* Provide basic symbols giving location and size of main text
* block, including initial values of RW data sections. Note that
* these will need extending to give a complete picture with
* complex images (e.g multiple Flash banks).
*/
_image_start = LOADADDR(.text);
_image_end = LOADADDR(.data) + SIZEOF(.data);
_image_size = _image_end - _image_start;
}
@@ -0,0 +1,17 @@
/*
* GENERATED FILE - DO NOT EDIT
* Copyright 2008-2013 Code Red Technologies Ltd,
* Copyright 2013-2025 NXP
* SPDX-License-Identifier: BSD-3-Clause
* Generated linker script file for RW612
* Created from library.ldt by FMCreateLinkLibraries
* Using Freemarker v2.3.30
* MCUXpresso IDE v24.12 [Build 148] [2025-01-10] on Jun 6, 2025, 7:53:58 PM
*/
GROUP (
"libgcc.a"
"libc_nano.a"
"libm.a"
"libcr_newlib_nohost.a"
)
@@ -0,0 +1,52 @@
/*
* GENERATED FILE - DO NOT EDIT
* Copyright 2008-2013 Code Red Technologies Ltd,
* Copyright 2013-2025 NXP
* SPDX-License-Identifier: BSD-3-Clause
* Generated linker script file for RW612
* Created from memory.ldt by FMCreateLinkMemory
* Using Freemarker v2.3.30
* MCUXpresso IDE v24.12 [Build 148] [2025-01-10] on Jun 6, 2025, 7:53:58 PM
*/
MEMORY
{
/* Define each memory region */
QSPI_FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 0x800000 /* 8M bytes (alias Flash) */
SRAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x130000 /* 1216K bytes (alias RAM) */
MBOX1 (rwx) : ORIGIN = 0x41380000, LENGTH = 0x488 /* 1160 bytes (alias RAM2) */
TXQ1 (rwx) : ORIGIN = 0x41380488, LENGTH = 0x1000 /* 4K bytes (alias RAM3) */
MBOX2 (rwx) : ORIGIN = 0x443c0000, LENGTH = 0x488 /* 1160 bytes (alias RAM4) */
TXQ23 (rwx) : ORIGIN = 0x443c0488, LENGTH = 0x1080 /* 4224 bytes (alias RAM5) */
TXQ32 (rwx) : ORIGIN = 0x443c1508, LENGTH = 0x1080 /* 4224 bytes (alias RAM6) */
}
/* Define a symbol for the top of each memory region */
__base_QSPI_FLASH = 0x8000000 ; /* QSPI_FLASH */
__base_Flash = 0x8000000 ; /* Flash */
__top_QSPI_FLASH = 0x8000000 + 0x800000 ; /* 8M bytes */
__top_Flash = 0x8000000 + 0x800000 ; /* 8M bytes */
__base_SRAM = 0x20000000 ; /* SRAM */
__base_RAM = 0x20000000 ; /* RAM */
__top_SRAM = 0x20000000 + 0x130000 ; /* 1216K bytes */
__top_RAM = 0x20000000 + 0x130000 ; /* 1216K bytes */
__base_MBOX1 = 0x41380000 ; /* MBOX1 */
__base_RAM2 = 0x41380000 ; /* RAM2 */
__top_MBOX1 = 0x41380000 + 0x488 ; /* 1160 bytes */
__top_RAM2 = 0x41380000 + 0x488 ; /* 1160 bytes */
__base_TXQ1 = 0x41380488 ; /* TXQ1 */
__base_RAM3 = 0x41380488 ; /* RAM3 */
__top_TXQ1 = 0x41380488 + 0x1000 ; /* 4K bytes */
__top_RAM3 = 0x41380488 + 0x1000 ; /* 4K bytes */
__base_MBOX2 = 0x443c0000 ; /* MBOX2 */
__base_RAM4 = 0x443c0000 ; /* RAM4 */
__top_MBOX2 = 0x443c0000 + 0x488 ; /* 1160 bytes */
__top_RAM4 = 0x443c0000 + 0x488 ; /* 1160 bytes */
__base_TXQ23 = 0x443c0488 ; /* TXQ23 */
__base_RAM5 = 0x443c0488 ; /* RAM5 */
__top_TXQ23 = 0x443c0488 + 0x1080 ; /* 4224 bytes */
__top_RAM5 = 0x443c0488 + 0x1080 ; /* 4224 bytes */
__base_TXQ32 = 0x443c1508 ; /* TXQ32 */
__base_RAM6 = 0x443c1508 ; /* RAM6 */
__top_TXQ32 = 0x443c1508 + 0x1080 ; /* 4224 bytes */
__top_RAM6 = 0x443c1508 + 0x1080 ; /* 4224 bytes */
@@ -0,0 +1,4 @@
This example assumes your FRDM-RW612 board already has the Wi-Fi submodule firmware already burned to flash. This seems to be the case for new boards.
In case this is not so, please follow indications in NXP's "frdmrw612_wifi_webconfig" example, components/conn_fwloader/readme.txt
@@ -0,0 +1,437 @@
/*
* Copyright 2021-2024 NXP
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include "fsl_common.h"
#include "fsl_debug_console.h"
#include "fsl_clock.h"
#include "board.h"
#include "fsl_flexspi.h"
#include "fsl_cache.h"
#include "fsl_io_mux.h"
#include "fsl_power.h"
#include "fsl_ocotp.h"
#include "mcuxClEls.h"
/*******************************************************************************
* Definitions
******************************************************************************/
#define BOARD_FLEXSPI_DLL_LOCK_RETRY (10)
/*******************************************************************************
* Variables
******************************************************************************/
/*******************************************************************************
* Prototypes
******************************************************************************/
/*******************************************************************************
* Code
******************************************************************************/
/* Initialize debug console. */
void BOARD_InitDebugConsole(void)
{
uint32_t uartClkSrcFreq = 0;
/* attach FRG0 clock to FLEXCOMM3 (debug console) */
CLOCK_SetFRGClock(BOARD_DEBUG_UART_FRG_CLK);
CLOCK_AttachClk(BOARD_DEBUG_UART_CLK_ATTACH);
uartClkSrcFreq = BOARD_DEBUG_UART_CLK_FREQ;
DbgConsole_Init(BOARD_DEBUG_UART_INSTANCE, BOARD_DEBUG_UART_BAUDRATE, BOARD_DEBUG_UART_TYPE, uartClkSrcFreq);
}
static status_t flexspi_hyper_ram_run_seq(FLEXSPI_Type *base, uint32_t seqIndex)
{
flexspi_transfer_t flashXfer;
status_t status;
/* Write data */
flashXfer.deviceAddress = 0U;
flashXfer.port = kFLEXSPI_PortB1;
flashXfer.cmdType = kFLEXSPI_Command;
flashXfer.SeqNumber = 1;
flashXfer.seqIndex = seqIndex;
status = FLEXSPI_TransferBlocking(base, &flashXfer);
return status;
}
/* Initialize psram. */
status_t BOARD_InitPsRam(void)
{
flexspi_device_config_t psramConfig = {
.flexspiRootClk = 106666667, /* 106MHZ SPI serial clock */
.isSck2Enabled = false,
.flashSize = 0x2000, /* 64Mb/KByte */
.addressShift = false,
.CSIntervalUnit = kFLEXSPI_CsIntervalUnit1SckCycle,
.CSInterval = 0,
.CSHoldTime = 3,
.CSSetupTime = 3,
.dataValidTime = 1,
.columnspace = 0,
.enableWordAddress = false,
.AWRSeqIndex = 12,
.AWRSeqNumber = 1,
.ARDSeqIndex = 11,
.ARDSeqNumber = 1,
.AHBWriteWaitUnit = kFLEXSPI_AhbWriteWaitUnit2AhbCycle,
.AHBWriteWaitInterval = 0,
.enableWriteMask = true,
};
uint32_t psramLUT[16] = {
/* Read Data */
[0] = FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0xEB, kFLEXSPI_Command_RADDR_SDR, kFLEXSPI_4PAD, 24),
[1] = FLEXSPI_LUT_SEQ(kFLEXSPI_Command_DUMMY_SDR, kFLEXSPI_4PAD, 6, kFLEXSPI_Command_READ_SDR, kFLEXSPI_4PAD,
0x04),
/* Write Data */
[4] = FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0x38, kFLEXSPI_Command_RADDR_SDR, kFLEXSPI_4PAD, 24),
[5] = FLEXSPI_LUT_SEQ(kFLEXSPI_Command_WRITE_SDR, kFLEXSPI_4PAD, 0x00, kFLEXSPI_Command_STOP, kFLEXSPI_1PAD, 0x00),
/* Reset Enable */
[8] = FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0x66, kFLEXSPI_Command_STOP, kFLEXSPI_1PAD, 0x00),
/* Reset */
[12] = FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0x99, kFLEXSPI_Command_STOP, kFLEXSPI_1PAD, 0x00),
};
flexspi_config_t config;
#if BOARD_ENABLE_PSRAM_CACHE
cache64_config_t cacheCfg;
#endif
status_t status = kStatus_Success;
if (!BOARD_IS_XIP()) /* FlexSPI not initialized */
{
CLOCK_EnableClock(kCLOCK_Flexspi);
RESET_ClearPeripheralReset(kFLEXSPI_RST_SHIFT_RSTn);
BOARD_SetFlexspiClock(FLEXSPI, 5U, 3U); /* 320M / 3 */
/* Get FLEXSPI default settings and configure the flexspi. */
FLEXSPI_GetDefaultConfig(&config);
/* Init FLEXSPI. */
config.rxSampleClock = kFLEXSPI_ReadSampleClkLoopbackFromDqsPad;
config.rxSampleClockPortB = kFLEXSPI_ReadSampleClkLoopbackFromDqsPad;
config.rxSampleClockDiff = false;
/*Set AHB buffer size for reading data through AHB bus. */
config.ahbConfig.enableAHBPrefetch = true;
config.ahbConfig.enableAHBBufferable = true;
config.ahbConfig.enableAHBCachable = true;
config.ahbConfig.enableReadAddressOpt = true;
for (uint8_t i = 1; i < FSL_FEATURE_FLEXSPI_AHB_BUFFER_COUNT - 1; i++)
{
config.ahbConfig.buffer[i].bufferSize = 0;
}
/* FlexSPI has total 1KB RX buffer.
* Set DMA0 master to use AHB Rx Buffer0.
*/
config.ahbConfig.buffer[0].masterIndex = 10; /* GDMA */
config.ahbConfig.buffer[0].bufferSize = 512; /* Allocate 512B bytes for DMA0 */
config.ahbConfig.buffer[0].enablePrefetch = true;
config.ahbConfig.buffer[0].priority = 0;
/* All other masters use last buffer with 512B bytes. */
config.ahbConfig.buffer[FSL_FEATURE_FLEXSPI_AHB_BUFFER_COUNT - 1].bufferSize = 512;
#if !(defined(FSL_FEATURE_FLEXSPI_HAS_NO_MCR0_COMBINATIONEN) && FSL_FEATURE_FLEXSPI_HAS_NO_MCR0_COMBINATIONEN)
config.enableCombination = false;
#endif
FLEXSPI_Init(BOARD_FLEXSPI_PSRAM, &config);
}
/* Configure flash settings according to serial flash feature. */
FLEXSPI_SetFlashConfig(BOARD_FLEXSPI_PSRAM, &psramConfig, kFLEXSPI_PortB1);
/* Update bottom LUT table (44-59). */
FLEXSPI_UpdateLUT(BOARD_FLEXSPI_PSRAM, 44U, psramLUT, ARRAY_SIZE(psramLUT));
/* Do software reset. */
FLEXSPI_SoftwareReset(BOARD_FLEXSPI_PSRAM);
do
{
/* Reset PSRAM */
status = flexspi_hyper_ram_run_seq(BOARD_FLEXSPI_PSRAM, 13U);
if (status == kStatus_Success)
{
status = flexspi_hyper_ram_run_seq(BOARD_FLEXSPI_PSRAM, 14U);
}
if (status != kStatus_Success)
{
status = kStatus_Fail;
break;
}
#if BOARD_ENABLE_PSRAM_CACHE
CACHE64_GetDefaultConfig(&cacheCfg);
/* Suppose:
Flash on PC bus starting from 0x08000000, controlled by cache 0.
PSRAM on PS bus starting from 0x28000000, controlled by cache 1.
*/
CACHE64_Init(CACHE64_POLSEL1, &cacheCfg);
CACHE64_EnableWriteBuffer(CACHE64_CTRL1, true);
CACHE64_EnableCache(CACHE64_CTRL1);
#endif
} while (false);
return status;
}
void BOARD_InitSleepPinConfig(void)
{
int32_t i;
/* Set all non-AON pins output low level in sleep mode. */
for (i = 0; i < 22; i++)
{
IO_MUX_SetPinOutLevelInSleep(i, IO_MUX_SleepPinLevelLow);
}
for (i = 28; i < 64; i++)
{
IO_MUX_SetPinOutLevelInSleep(i, IO_MUX_SleepPinLevelLow);
}
/* Set RF_CNTL 0-3 output low level in sleep mode. */
for (i = 0; i < 4; i++)
{
IO_MUX_SetRfPinOutLevelInSleep(i, IO_MUX_SleepPinLevelLow);
}
}
void BOARD_DeinitFlash(FLEXSPI_Type *base)
{
/* Enable FLEXSPI clock again */
CLKCTL0->PSCCTL0_SET = CLKCTL0_PSCCTL0_SET_FLEXSPI0_MASK;
/* Enable FLEXSPI module */
base->MCR0 &= ~FLEXSPI_MCR0_MDIS_MASK;
/* Wait until FLEXSPI is not busy */
while (!((base->STS0 & FLEXSPI_STS0_ARBIDLE_MASK) && (base->STS0 & FLEXSPI_STS0_SEQIDLE_MASK)))
{
}
/* Disable module during the reset procedure */
base->MCR0 |= FLEXSPI_MCR0_MDIS_MASK;
}
void BOARD_InitFlash(FLEXSPI_Type *base)
{
uint32_t status;
uint32_t lastStatus;
uint32_t retry;
/* Loopback from DQS pad can maximize RD board flash speed. */
if ((base->MCR0 & FLEXSPI_MCR0_RXCLKSRC_MASK) != FLEXSPI_MCR0_RXCLKSRC(1))
{
base->MCR0 = (base->MCR0 & ~FLEXSPI_MCR0_RXCLKSRC_MASK) | FLEXSPI_MCR0_RXCLKSRC(1);
}
/* If serial root clock is >= 100 MHz, DLLEN set to 1, OVRDEN set to 0, then SLVDLYTARGET setting of 0x0 is
* recommended. */
base->DLLCR[0] = 0x1U;
/* Enable FLEXSPI module */
base->MCR0 &= ~FLEXSPI_MCR0_MDIS_MASK;
base->MCR0 |= FLEXSPI_MCR0_SWRESET_MASK;
while (base->MCR0 & FLEXSPI_MCR0_SWRESET_MASK)
{
}
/* Need to wait DLL locked if DLL enabled */
if (0U != (base->DLLCR[0] & FLEXSPI_DLLCR_DLLEN_MASK))
{
lastStatus = base->STS2;
retry = BOARD_FLEXSPI_DLL_LOCK_RETRY;
/* Wait slave delay line locked and slave reference delay line locked. */
do
{
status = base->STS2;
if ((status & (FLEXSPI_STS2_AREFLOCK_MASK | FLEXSPI_STS2_ASLVLOCK_MASK)) ==
(FLEXSPI_STS2_AREFLOCK_MASK | FLEXSPI_STS2_ASLVLOCK_MASK))
{
/* Locked */
retry = 100;
break;
}
else if (status == lastStatus)
{
/* Same delay cell number in calibration */
retry--;
}
else
{
retry = BOARD_FLEXSPI_DLL_LOCK_RETRY;
lastStatus = status;
}
} while (retry > 0);
/* According to ERR011377, need to delay at least 100 NOPs to ensure the DLL is locked. */
for (; retry > 0U; retry--)
{
__NOP();
}
}
}
/* BOARD_SetFlexspiClock run in RAM used to configure FlexSPI clock source and divider when XIP. */
void BOARD_SetFlexspiClock(FLEXSPI_Type *base, uint32_t src, uint32_t divider)
{
if ((CLKCTL0->FLEXSPIFCLKSEL != CLKCTL0_FLEXSPIFCLKSEL_SEL(src)) ||
((CLKCTL0->FLEXSPIFCLKDIV & CLKCTL0_FLEXSPIFCLKDIV_DIV_MASK) != (divider - 1)))
{
/* Always deinit FLEXSPI and init FLEXSPI for the flash to make sure the flash works correctly after the
FLEXSPI root clock changed as the default FLEXSPI configuration may does not work for the new root clock
frequency. */
BOARD_DeinitFlash(base);
/* Disable clock before changing clock source */
CLKCTL0->PSCCTL0_CLR = CLKCTL0_PSCCTL0_CLR_FLEXSPI0_MASK;
/* Update flexspi clock. */
CLKCTL0->FLEXSPIFCLKSEL = CLKCTL0_FLEXSPIFCLKSEL_SEL(src);
CLKCTL0->FLEXSPIFCLKDIV |= CLKCTL0_FLEXSPIFCLKDIV_RESET_MASK; /* Reset the divider counter */
CLKCTL0->FLEXSPIFCLKDIV = CLKCTL0_FLEXSPIFCLKDIV_DIV(divider - 1);
while ((CLKCTL0->FLEXSPIFCLKDIV) & CLKCTL0_FLEXSPIFCLKDIV_REQFLAG_MASK)
{
}
/* Enable FLEXSPI clock again */
CLKCTL0->PSCCTL0_SET = CLKCTL0_PSCCTL0_SET_FLEXSPI0_MASK;
BOARD_InitFlash(base);
}
}
static bool LoadGdetCfg(power_gdet_data_t *data)
{
bool retval = true;
/* If T3 256M clock is disabled, GDET cannot work. */
if ((SYSCTL2->SOURCE_CLK_GATE & SYSCTL2_SOURCE_CLK_GATE_T3PLL_MCI_256M_CG_MASK) != 0U)
{
retval = false;
}
else
{
/* GDET clock has been characterzed to 64MHz */
CLKCTL0->ELS_GDET_CLK_SEL = CLKCTL0_ELS_GDET_CLK_SEL_SEL(2);
}
if (retval)
{
/* LOAD command */
MCUX_CSSL_FP_FUNCTION_CALL_BEGIN(result, token, mcuxClEls_GlitchDetector_LoadConfig_Async((uint8_t *)data));
if ((MCUX_CSSL_FP_FUNCTION_CALLED(mcuxClEls_GlitchDetector_LoadConfig_Async) != token) ||
(MCUXCLELS_STATUS_OK_WAIT != result))
{
retval = false;
}
MCUX_CSSL_FP_FUNCTION_CALL_END();
}
if (retval)
{
/* Wait for the mcuxClEls_GlitchDetector_LoadConfig_Async operation to complete. */
MCUX_CSSL_FP_FUNCTION_CALL_BEGIN(result, token, mcuxClEls_WaitForOperation(MCUXCLELS_ERROR_FLAGS_CLEAR));
if ((MCUX_CSSL_FP_FUNCTION_CALLED(mcuxClEls_WaitForOperation) != token) || (MCUXCLELS_STATUS_OK != result))
{
retval = false;
}
MCUX_CSSL_FP_FUNCTION_CALL_END();
}
return retval;
}
static void ConfigSvcSensor(void)
{
uint64_t svc;
uint32_t pack;
status_t status;
power_gdet_data_t gdetData = {0U};
uint32_t rev = SOCCTRL->CHIP_INFO & SOCCIU_CHIP_INFO_REV_NUM_MASK;
status = OCOTP_ReadSVC(&svc);
if (status == kStatus_Success)
{ /* CES */
status = OCOTP_ReadPackage(&pack);
if (status == kStatus_Success)
{
/*
A2 CES: Use SVC voltage.
A1 CES: Keep boot voltage 1.11V.
*/
POWER_InitVoltage((rev == 2U) ? ((uint32_t)svc >> 16) : 0U, pack);
}
/* SVC GDET config */
status = (status == kStatus_Success) ? OCOTP_OtpFuseRead(149, &gdetData.CFG[0]) : status;
status = (status == kStatus_Success) ? OCOTP_OtpFuseRead(150, &gdetData.CFG[1]) : status;
status = (status == kStatus_Success) ? OCOTP_OtpFuseRead(151, &gdetData.CFG[2]) : status;
/* A2 CES load fuse 155 for trim calculation. A1 CES directly use the default trim value in fuse 152. */
status = (status == kStatus_Success) ? OCOTP_OtpFuseRead((rev == 2U) ? 155 : 152, &gdetData.CFG[3]) : status;
status = (status == kStatus_Success) ? OCOTP_OtpFuseRead(153, &gdetData.CFG[4]) : status;
status = (status == kStatus_Success) ? OCOTP_OtpFuseRead(154, &gdetData.CFG[5]) : status;
assert(status == kStatus_Success);
/* Must configure GDET load function for POWER_EnableGDetVSensors(). */
Power_InitLoadGdetCfg(LoadGdetCfg, &gdetData, pack);
}
else
{
/* A1/A2 non-CES */
SystemCoreClockUpdate();
/* LPBG trim */
BUCK11->BUCK_CTRL_EIGHTEEN_REG = 0x6U;
/* Change buck level */
PMU->PMIP_BUCK_LVL = PMU_PMIP_BUCK_LVL_SLEEP_BUCK18_SEL(0x60U) | /* 1.8V */
PMU_PMIP_BUCK_LVL_SLEEP_BUCK11_SEL(0x22U) | /* 0.8V */
PMU_PMIP_BUCK_LVL_NORMAL_BUCK18_SEL(0x60U) | /* 1.8V */
PMU_PMIP_BUCK_LVL_NORMAL_BUCK11_SEL(0x54U); /* 1.05V */
/* Delay 600us */
SDK_DelayAtLeastUs(600, SystemCoreClock);
}
}
/* This function is used to configure static voltage compansation and sensors, and in XIP case, change FlexSPI clock
to a stable source before clock tree(Such as PLL and Main clock) update */
void BOARD_ClockPreConfig(void)
{
OCOTP_OtpInit();
ConfigSvcSensor();
OCOTP_OtpDeinit();
if (BOARD_IS_XIP())
{
/* Move FLEXSPI clock source to T3 256m / 4 to avoid instruction/data fetch issue in XIP when
* updating PLL and main clock.
*/
BOARD_SetFlexspiClock(FLEXSPI, 6U, 4U);
}
else
{
RESET_ClearPeripheralReset(kFLEXSPI_RST_SHIFT_RSTn);
BOARD_DeinitFlash(FLEXSPI);
CLOCK_AttachClk(kNONE_to_FLEXSPI_CLK);
CLOCK_DisableClock(kCLOCK_Flexspi);
RESET_SetPeripheralReset(kFLEXSPI_RST_SHIFT_RSTn);
}
}
/* Update FlexSPI clock source and set flash to full speed */
void BOARD_ClockPostConfig(void)
{
if (BOARD_IS_XIP())
{
/* Call function BOARD_SetFlexspiClock() to set clock source to aux0_pll_clk. */
BOARD_SetFlexspiClock(FLEXSPI, 2U, 2U);
}
else
{
}
}
@@ -0,0 +1,124 @@
/*
* Copyright 2021-2024 NXP
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef _BOARD_H_
#define _BOARD_H_
#include "fsl_common.h"
#include "fsl_gpio.h"
/*******************************************************************************
* Definitions
******************************************************************************/
/*! @brief The board name */
#define BOARD_NAME "FRDM-RW612"
/*! @brief Macro to judge XIP */
#define BOARD_IS_XIP() \
((((uint32_t)BOARD_InitDebugConsole >= 0x08000000U) && ((uint32_t)BOARD_InitDebugConsole < 0x10000000U)) || \
(((uint32_t)BOARD_InitDebugConsole >= 0x18000000U) && ((uint32_t)BOARD_InitDebugConsole < 0x20000000U)))
/*! @brief The UART to use for debug messages. */
#define BOARD_DEBUG_UART_TYPE kSerialPort_Uart
#define BOARD_DEBUG_UART_BASEADDR (uint32_t) FLEXCOMM3
#define BOARD_DEBUG_UART_INSTANCE 3U
#define BOARD_DEBUG_UART USART3
#define BOARD_DEBUG_UART_CLK_FREQ CLOCK_GetFlexCommClkFreq(3)
#define BOARD_DEBUG_UART_FRG_CLK \
(&(const clock_frg_clk_config_t){3, kCLOCK_FrgPllDiv, 255, 0}) /*!< Select FRG3 mux as frg_pll */
#define BOARD_DEBUG_UART_CLK_ATTACH kFRG_to_FLEXCOMM3
#define BOARD_DEBUG_UART_RST kFC3_RST_SHIFT_RSTn
#define BOARD_DEBUG_UART_CLKSRC kCLOCK_Flexcomm3
#define BOARD_UART_IRQ_HANDLER FLEXCOMM3_IRQHandler
#define BOARD_UART_IRQ FLEXCOMM3_IRQn
#ifndef BOARD_DEBUG_UART_BAUDRATE
#define BOARD_DEBUG_UART_BAUDRATE 115200
#endif /* BOARD_DEBUG_UART_BAUDRATE */
#define BOARD_FLEXSPI_PSRAM FLEXSPI
#ifndef BOARD_ENABLE_PSRAM_CACHE
#define BOARD_ENABLE_PSRAM_CACHE 1
#endif
/* Board I2C for codec */
#define BOARD_CODEC_I2C_BASEADDR I2C2
#define BOARD_CODEC_I2C_CLOCK_FREQ CLOCK_GetFlexCommClkFreq(2U)
#define BOARD_CODEC_I2C_INSTANCE 2
#define BOARD_CODEC_I2C_SDA_PORT 0
#define BOARD_CODEC_I2C_SCL_PORT 0
#define BOARD_CODEC_I2C_SDA_PIN 16
#define BOARD_CODEC_I2C_SCL_PIN 17
/* Board led color mapping */
#define LOGIC_LED_ON 0U
#define LOGIC_LED_OFF 1U
/* A fake led on GPIO header */
#ifndef BOARD_LED_BLUE_GPIO
#define BOARD_LED_BLUE_GPIO GPIO
#endif
#define BOARD_LED_BLUE_GPIO_PORT 0U
#ifndef BOARD_LED_BLUE_GPIO_PIN
#define BOARD_LED_BLUE_GPIO_PIN 0U
#endif
#define LED_BLUE_INIT(output) \
GPIO_PinInit(BOARD_LED_BLUE_GPIO, BOARD_LED_BLUE_GPIO_PORT, BOARD_LED_BLUE_GPIO_PIN, \
&(gpio_pin_config_t){kGPIO_DigitalOutput, (output)}) /*!< Enable target LED_BLUE */
#define LED_BLUE_ON() \
GPIO_PortSet(BOARD_LED_BLUE_GPIO, BOARD_LED_BLUE_GPIO_PORT, \
1U << BOARD_LED_BLUE_GPIO_PIN) /*!< Turn on target LED_BLUE */
#define LED_BLUE_OFF() \
GPIO_PortClear(BOARD_LED_BLUE_GPIO, BOARD_LED_BLUE_GPIO_PORT, \
1U << BOARD_LED_BLUE_GPIO_PIN) /*!< Turn off target LED_BLUE */
#define LED_BLUE_TOGGLE() \
GPIO_PortToggle(BOARD_LED_BLUE_GPIO, BOARD_LED_BLUE_GPIO_PORT, \
1U << BOARD_LED_BLUE_GPIO_PIN) /*!< Toggle on target LED_BLUE */
/* Board SW PIN */
#ifndef BOARD_SW2_GPIO
#define BOARD_SW2_GPIO GPIO
#endif
#define BOARD_SW2_GPIO_PORT 0U
#ifndef BOARD_SW2_GPIO_PIN
#define BOARD_SW2_GPIO_PIN 11U
#endif
#define BOARD_ENET0_PHY_ADDRESS (0x02U)
/*! @brief The USIM SMARTCARD PHY configuration. */
#define BOARD_SMARTCARD_MODULE (USIM) /*!< SMARTCARD communicational module instance */
#define BOARD_SMARTCARD_MODULE_IRQ (USIM_IRQn) /*!< SMARTCARD communicational module IRQ handler */
#define BOARD_SMARTCARD_CLOCK_MODULE_CLK_FREQ (CLOCK_GetUsimClkFreq())
#define BOARD_SMARTCARD_CLOCK_VALUE (4000000U) /*!< SMARTCARD clock frequency (4Mhz) */
#define BOARD_SMARTCARD_IRQ_PORT (0)
#define BOARD_SMARTCARD_IRQ_PIN (19)
#define BOARD_SMARTCARD_TS_TIMER_IRQ (CTIMER0_IRQn)
#if defined(__cplusplus)
extern "C" {
#endif /* __cplusplus */
/*******************************************************************************
* API
******************************************************************************/
void BOARD_InitDebugConsole(void);
status_t BOARD_InitPsRam(void);
void BOARD_InitSleepPinConfig(void);
void BOARD_ClockPreConfig(void);
void BOARD_ClockPostConfig(void);
AT_QUICKACCESS_SECTION_CODE(void BOARD_SetFlexspiClock(FLEXSPI_Type *base, uint32_t src, uint32_t divider));
AT_QUICKACCESS_SECTION_CODE(void BOARD_DeinitFlash(FLEXSPI_Type *base));
AT_QUICKACCESS_SECTION_CODE(void BOARD_InitFlash(FLEXSPI_Type *base));
#if defined(__cplusplus)
}
#endif /* __cplusplus */
#endif /* _BOARD_H_ */
@@ -0,0 +1,277 @@
/*
* Copyright 2024 NXP
*
* SPDX-License-Identifier: BSD-3-Clause
*/
/***********************************************************************************************************************
* This file was generated by the MCUXpresso Config Tools. Any manual edits made to this file
* will be overwritten if the respective MCUXpresso Config Tools is used to update this file.
**********************************************************************************************************************/
/*
* How to set up clock using clock driver functions:
*
* 1. Setup clock sources.
*
* 2. Set up all selectors to provide selected clocks.
*
* 3. Set up all dividers.
*/
/* clang-format off */
/* TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
!!GlobalInfo
product: Clocks v14.0
processor: RW612
package_id: RW612ETA2I
mcu_data: ksdk2_0
processor_version: 0.16.9
* BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/
/* clang-format on */
#include "fsl_power.h"
#include "fsl_clock.h"
#include "clock_config.h"
/*******************************************************************************
* Definitions
******************************************************************************/
/*******************************************************************************
* Variables
******************************************************************************/
/*******************************************************************************
************************ BOARD_InitBootClocks function ************************
******************************************************************************/
void BOARD_InitBootClocks(void)
{
BOARD_BootClockRUN();
}
/*******************************************************************************
********************** Configuration BOARD_BootClockRUN ***********************
******************************************************************************/
/* clang-format off */
/* TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
!!Configuration
name: BOARD_BootClockRUN
called_from_default_init: true
outputs:
- {id: audio_pll_clk.outFreq, value: 4246732800/345600007 MHz}
- {id: aux0_pll_clk.outFreq, value: 260 MHz}
- {id: avpll_ch1_clkout.outFreq, value: 4246732800/345600007 MHz}
- {id: avpll_ch2_clkout.outFreq, value: 1415577600/22118401 MHz}
- {id: cau_slp_clk.outFreq, value: 4 MHz}
- {id: clk_32k.outFreq, value: 32 kHz}
- {id: clk_pmu_sys.outFreq, value: 52 MHz}
- {id: els_128m_clk.outFreq, value: 128 MHz}
- {id: els_256m_clk.outFreq, value: 256 MHz}
- {id: els_64m_clk.outFreq, value: 64 MHz}
- {id: ffro_clk_div4.outFreq, value: 640/53 MHz}
- {id: hclk.outFreq, value: 260 MHz}
- {id: lposc_clk_i.outFreq, value: 1 MHz}
- {id: main_clk.outFreq, value: 260 MHz}
- {id: main_pll_clk.outFreq, value: 260 MHz}
- {id: otp_fuse_32m_clk.outFreq, value: 32 MHz}
- {id: refclk_phy.outFreq, value: 40 MHz}
- {id: sfro_clk_i.outFreq, value: 16 MHz}
- {id: systick_fclk.outFreq, value: 260 MHz}
- {id: t3pll_mci_256m.outFreq, value: 256 MHz}
- {id: t3pll_mci_48_60m_irc.outFreq, value: 2560/53 MHz}
- {id: tcpu_mci_clk.outFreq, value: 260 MHz}
- {id: tddr_mci_flexspi_clk.outFreq, value: 320 MHz}
settings:
- {id: CLKCTL0.MAINCLKSELB.sel, value: CLKCTL0.MAINPLLCLKDIV}
- {id: CLKCTL0.MAINPLLCLKDIV.scale, value: '1', locked: true}
- {id: CLKCTL0.PMUFCLKDIV.scale, value: '5', locked: true}
- {id: CLKCTL0.SYSCPUAHBCLKDIV.scale, value: '1', locked: true}
- {id: CLKCTL0.SYSTICKFCLKSEL.sel, value: CLKCTL0.SYSTICKFCLKDIV}
- {id: CLKCTL0.WDT0FCLKSEL.sel, value: NO_CLOCK}
- {id: CLKCTL1.FRGPLLCLKDIV.scale, value: '13', locked: true}
- {id: CLKCTL1.OSEVENTFCLKSEL.sel, value: NO_CLOCK}
- {id: REFCLK_SYS_Config, value: Disabled}
- {id: SYSCTL2.CH1_M.scale, value: '2621440', locked: true}
- {id: SYSCTL2.CH1_OFFSET_DIV.scale, value: '345600007', locked: true}
- {id: SYSCTL2.CH2_M.scale, value: '2621440', locked: true}
- {id: SYSCTL2.CH2_OFFSET_DIV.scale, value: '66355203', locked: true}
- {id: SYSCTL2.T3_FBDIV.scale, value: '64', locked: true}
- {id: SYSCTL2.T3_REFDIV.scale, value: '1', locked: true}
- {id: T3PLL_MCI_213P3M_Config, value: Disabled}
- {id: T3PLL_MCI_FLEXSPI_Config, value: Disabled}
- {id: TCPU_MCI_FLEXSPI_CLK_Config, value: Disabled}
- {id: TDDR_MCI_ENET_CLK_Config, value: Disabled}
sources:
- {id: CAU.XTAL_OSC.outFreq, value: 40 MHz, enabled: true}
* BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/
/* clang-format on */
/*******************************************************************************
* Variables for BOARD_BootClockRUN configuration
******************************************************************************/
const clock_avpll_config_t avpllConfig_BOARD_BootClockRUN =
{
.ch1Freq = kCLOCK_AvPllChFreq12p288m, /* AVPLL channel frequency 12.288 MHz */
.ch2Freq = kCLOCK_AvPllChFreq64m, /* AVPLL channel frequency 64 MHz */
.enableCali = true, /* AVPLL calibration is enabled */
};
/*******************************************************************************
* Code for BOARD_BootClockRUN configuration
******************************************************************************/
void BOARD_BootClockRUN(void)
{
/* Disable GDET and VSensors */
POWER_DisableGDetVSensors();
/* Enable CAU sleep clock for PMU */
if ((PMU->CAU_SLP_CTRL & PMU_CAU_SLP_CTRL_SOC_SLP_RDY_MASK) == 0U)
{
/* Enable the CAU sleep clock. */
CLOCK_EnableClock(kCLOCK_RefClkCauSlp);
}
if ((SYSCTL2->SOURCE_CLK_GATE & SYSCTL2_SOURCE_CLK_GATE_REFCLK_SYS_CG_MASK) != 0U)
{
/* Enable the REFCLK_SYS clock. */
CLOCK_EnableClock(kCLOCK_RefClkSys);
}
/* Initialize T3 PLL and enable outputs that are not clock gated. */
CLOCK_InitT3RefClk(kCLOCK_T3MciIrc48m);
/* Enable FFRO - T3 PLL 48/60 MHz IRC clock output */
CLOCK_EnableClock(kCLOCK_T3PllMciIrcClk);
/* Enable T3 PLL 256 MHz clock output */
CLOCK_EnableClock(kCLOCK_T3PllMci256mClk);
BOARD_ClockPreConfig();
/* Set core clock to safe system oscillator clock for initialization of other sources. */
CLOCK_AttachClk(kSYSOSC_to_MAIN_CLK);
CLOCK_SetClkDiv(kCLOCK_DivSysCpuAhbClk, 1);
/* Initialize TCPU PLL and enable outputs that are not clock gated. */
CLOCK_InitTcpuRefClk(3120000000UL, kCLOCK_TcpuFlexspiDiv10);
/* Enable TCPU PLL MCI clock output */
CLOCK_EnableClock(kCLOCK_TcpuMciClk);
/* Initialize TDDR PLL and enable outputs that are not clock gated. */
CLOCK_InitTddrRefClk(kCLOCK_TddrFlexspiDiv10);
/* Enable TDDR PLL FlexSPI clock output */
CLOCK_EnableClock(kCLOCK_TddrMciFlexspiClk);
/* Initialize AVPLL and enable both channels. */
CLOCK_InitAvPll(&avpllConfig_BOARD_BootClockRUN);
/* Set up clock selectors - Attach clocks to the peripheries */
CLOCK_AttachClk(kRC32K_to_CLK32K); /* Switch CLK32K to RC32K */
/*!< Please note SYSTICK_CLK source is used only if the SysTick SYST_CSR register CLKSOURCE bit is set to 0. */
CLOCK_AttachClk(kSYSTICK_DIV_to_SYSTICK_CLK); /* Switch SYSTICK_CLK to SYSTICK_DIV */
/* Set up dividers */
CLOCK_SetClkDiv(kCLOCK_DivAudioPllClk, 1U); /* Set .AUDIOPLLCLKDIV divider to value 1 */
CLOCK_SetClkDiv(kCLOCK_DivPllFrgClk, 13U); /* Set .FRGPLLCLKDIV divider to value 13 */
CLOCK_SetClkDiv(kCLOCK_DivMainPllClk, 1U); /* Set .MAINPLLCLKDIV divider to value 1 */
CLOCK_SetClkDiv(kCLOCK_DivAux0PllClk, 1U); /* Set .AUX0PLLCLKDIV divider to value 1 */
CLOCK_SetClkDiv(kCLOCK_DivSystickClk, 1U); /* Set .SYSTICKFCLKDIV divider to value 1 */
CLOCK_SetClkDiv(kCLOCK_DivPmuFclk, 5U); /* Set .PMUFCLKDIV divider to value 5 */
/* Select the main clock source for the main system clock (MAINCLKSELA and MAINCLKSELB). */
CLOCK_AttachClk(kMAIN_PLL_to_MAIN_CLK);
BOARD_ClockPostConfig();
/*!< Set SystemCoreClock variable. */
SystemCoreClock = BOARD_BOOTCLOCKRUN_HCLK;
}
/*******************************************************************************
********************** Configuration BOARD_BootClockLPR ***********************
******************************************************************************/
/* clang-format off */
/* TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
!!Configuration
name: BOARD_BootClockLPR
outputs:
- {id: aux0_pll_clk.outFreq, value: 260 MHz}
- {id: clk_32k.outFreq, value: 32 kHz}
- {id: clk_pmu_sys.outFreq, value: 52 MHz}
- {id: els_128m_clk.outFreq, value: 128 MHz}
- {id: els_256m_clk.outFreq, value: 256 MHz}
- {id: els_64m_clk.outFreq, value: 64 MHz}
- {id: hclk.outFreq, value: 260 MHz}
- {id: main_clk.outFreq, value: 260 MHz}
- {id: main_pll_clk.outFreq, value: 260 MHz}
- {id: otp_fuse_32m_clk.outFreq, value: 32 MHz}
- {id: refclk_phy.outFreq, value: 40 MHz}
- {id: refclk_sys.outFreq, value: 40 MHz}
- {id: sfro_clk_i.outFreq, value: 16 MHz}
- {id: systick_fclk.outFreq, value: 260 MHz}
- {id: t3pll_mci_256m.outFreq, value: 256 MHz}
- {id: tcpu_mci_clk.outFreq, value: 260 MHz}
settings:
- {id: AVPLL_Init_Config, value: Disabled}
- {id: CAU_SLP_CLK_Config, value: Disabled}
- {id: CLKCTL0.MAINCLKSELB.sel, value: CLKCTL0.MAINPLLCLKDIV}
- {id: CLKCTL0.MAINPLLCLKDIV.scale, value: '1', locked: true}
- {id: CLKCTL0.SYSOSCBYPASS_SEL.sel, value: NO_CLOCK}
- {id: CLKCTL0.SYSTICKFCLKSEL.sel, value: CLKCTL0.SYSTICKFCLKDIV}
- {id: CLKCTL1.CLKOUTSEL1.sel, value: CLKCTL1.CLKOUTSEL0}
- {id: CLKCTL1.CLKOUTSEL2.sel, value: CLKCTL1.CLKOUTSEL1}
- {id: CLKCTL1.FRGPLLCLKDIV.scale, value: '13', locked: true}
- {id: SYSCTL2.T3_FBDIV.scale, value: '64'}
- {id: SYSCTL2.TCPU_FBDIV.scale, value: '78', locked: true}
- {id: SYSCTL2.TCPU_MCI_FLEXSPI_CLK_DIV.scale, value: '10', locked: true}
- {id: SYSCTL2.TCPU_REFDIV.scale, value: '1', locked: true}
- {id: T3PLL_MCI_213P3M_Config, value: Disabled}
- {id: T3PLL_MCI_48_60M_IRC_Config, value: Disabled}
- {id: T3PLL_MCI_FLEXSPI_Config, value: Disabled}
- {id: TCPU_MCI_FLEXSPI_CLK_Config, value: Disabled}
- {id: TDDR_MCI_ENET_CLK_Config, value: Disabled}
- {id: TDDR_MCI_FLEXSPI_CLK_Config, value: Disabled}
- {id: TDDR_PLL_Init_Config, value: Disabled}
sources:
- {id: CAU.XTAL_OSC.outFreq, value: 40 MHz, enabled: true}
* BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/
/* clang-format on */
/*******************************************************************************
* Variables for BOARD_BootClockLPR configuration
******************************************************************************/
/*******************************************************************************
* Code for BOARD_BootClockLPR configuration
******************************************************************************/
void BOARD_BootClockLPR(void)
{
/* Disable GDET and VSensors */
POWER_DisableGDetVSensors();
/* Enable CAU sleep clock for PMU */
if ((PMU->CAU_SLP_CTRL & PMU_CAU_SLP_CTRL_SOC_SLP_RDY_MASK) == 0U)
{
/* Enable the CAU sleep clock. */
CLOCK_EnableClock(kCLOCK_RefClkCauSlp);
}
if ((SYSCTL2->SOURCE_CLK_GATE & SYSCTL2_SOURCE_CLK_GATE_REFCLK_SYS_CG_MASK) != 0U)
{
/* Enable the REFCLK_SYS clock. */
CLOCK_EnableClock(kCLOCK_RefClkSys);
}
/* Initialize T3 PLL and enable outputs that are not clock gated. */
CLOCK_InitT3RefClk(kCLOCK_T3MciIrc48m);
/* Enable T3 PLL 256 MHz clock output */
CLOCK_EnableClock(kCLOCK_T3PllMci256mClk);
BOARD_ClockPreConfig();
/* Set core clock to safe system oscillator clock for initialization of other sources. */
CLOCK_AttachClk(kSYSOSC_to_MAIN_CLK);
CLOCK_SetClkDiv(kCLOCK_DivSysCpuAhbClk, 1);
/* Initialize TCPU PLL and enable outputs that are not clock gated. */
CLOCK_InitTcpuRefClk(3120000000UL, kCLOCK_TcpuFlexspiDiv10);
/* Enable TCPU PLL MCI clock output */
CLOCK_EnableClock(kCLOCK_TcpuMciClk);
/* Set up clock selectors - Attach clocks to the peripheries */
CLOCK_AttachClk(kRC32K_to_CLK32K); /* Switch CLK32K to RC32K */
/*!< Please note SYSTICK_CLK source is used only if the SysTick SYST_CSR register CLKSOURCE bit is set to 0. */
CLOCK_AttachClk(kSYSTICK_DIV_to_SYSTICK_CLK); /* Switch SYSTICK_CLK to SYSTICK_DIV */
/* Set up dividers */
CLOCK_SetClkDiv(kCLOCK_DivPllFrgClk, 13U); /* Set .FRGPLLCLKDIV divider to value 13 */
CLOCK_SetClkDiv(kCLOCK_DivMainPllClk, 1U); /* Set .MAINPLLCLKDIV divider to value 1 */
CLOCK_SetClkDiv(kCLOCK_DivAux0PllClk, 1U); /* Set .AUX0PLLCLKDIV divider to value 1 */
CLOCK_SetClkDiv(kCLOCK_DivSystickClk, 1U); /* Set .SYSTICKFCLKDIV divider to value 1 */
CLOCK_SetClkDiv(kCLOCK_DivPmuFclk, 5U); /* Set .PMUFCLKDIV divider to value 5 */
/* Select the main clock source for the main system clock (MAINCLKSELA and MAINCLKSELB). */
CLOCK_AttachClk(kMAIN_PLL_to_MAIN_CLK);
/* Deinitialization of the AVPLL. */
CLOCK_DeinitAvPll();
/* Deinitialize TDDR PLL. */
CLOCK_DeinitTddrRefClk();
BOARD_ClockPostConfig();
/*!< Set SystemCoreClock variable. */
SystemCoreClock = BOARD_BOOTCLOCKLPR_HCLK;
}
@@ -0,0 +1,198 @@
/*
* Copyright 2024 NXP
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef _CLOCK_CONFIG_H_
#define _CLOCK_CONFIG_H_
#include "fsl_common.h"
/*******************************************************************************
* Definitions
******************************************************************************/
/*******************************************************************************
************************ BOARD_InitBootClocks function ************************
******************************************************************************/
#if defined(__cplusplus)
extern "C" {
#endif /* __cplusplus*/
/*!
* @brief This function executes default configuration of clocks.
*
*/
void BOARD_InitBootClocks(void);
#if defined(__cplusplus)
}
#endif /* __cplusplus*/
/*******************************************************************************
********************** Configuration BOARD_BootClockRUN ***********************
******************************************************************************/
/*******************************************************************************
* Definitions for BOARD_BootClockRUN configuration
******************************************************************************/
/* Clock outputs (values are in Hz): */
#define BOARD_BOOTCLOCKRUN_AUDIO_PLL_CLK 12287999UL /* Clock consumers of audio_pll_clk output : N/A */
#define BOARD_BOOTCLOCKRUN_AUX0_PLL_CLK 260000000UL /* Clock consumers of aux0_pll_clk output : N/A */
#define BOARD_BOOTCLOCKRUN_AUX1_PLL_CLK 0UL /* Clock consumers of aux1_pll_clk output : N/A */
#define BOARD_BOOTCLOCKRUN_AVPLL_CH1_CLKOUT 12287999UL /* Clock consumers of avpll_ch1_clkout output : N/A */
#define BOARD_BOOTCLOCKRUN_AVPLL_CH2_CLKOUT 63999997UL /* Clock consumers of avpll_ch2_clkout output : N/A */
#define BOARD_BOOTCLOCKRUN_CAU_SLP_CLK 4000000UL /* Clock consumers of cau_slp_clk output : N/A */
#define BOARD_BOOTCLOCKRUN_CLK_32K 32000UL /* Clock consumers of clk_32k output : RTC */
#define BOARD_BOOTCLOCKRUN_CLK_OUT 0UL /* Clock consumers of clk_out output : N/A */
#define BOARD_BOOTCLOCKRUN_CLK_PMU_SYS 52000000UL /* Clock consumers of clk_pmu_sys output : PMU */
#define BOARD_BOOTCLOCKRUN_CTIMER0_FCLK 0UL /* Clock consumers of ctimer0_fclk output : CTIMER0 */
#define BOARD_BOOTCLOCKRUN_CTIMER1_FCLK 0UL /* Clock consumers of ctimer1_fclk output : CTIMER1 */
#define BOARD_BOOTCLOCKRUN_CTIMER2_FCLK 0UL /* Clock consumers of ctimer2_fclk output : CTIMER2 */
#define BOARD_BOOTCLOCKRUN_CTIMER3_FCLK 0UL /* Clock consumers of ctimer3_fclk output : CTIMER3 */
#define BOARD_BOOTCLOCKRUN_DMIC_FCLK 0UL /* Clock consumers of dmic_fclk output : DMIC0 */
#define BOARD_BOOTCLOCKRUN_ELS_128M_CLK 128000000UL /* Clock consumers of els_128m_clk output : ELS */
#define BOARD_BOOTCLOCKRUN_ELS_256M_CLK 256000000UL /* Clock consumers of els_256m_clk output : N/A */
#define BOARD_BOOTCLOCKRUN_ELS_64M_CLK 64000000UL /* Clock consumers of els_64m_clk output : N/A */
#define BOARD_BOOTCLOCKRUN_ELS_FCLK 0UL /* Clock consumers of els_fclk output : ELS */
#define BOARD_BOOTCLOCKRUN_FFRO_CLK_DIV4 12075471UL /* Clock consumers of ffro_clk_div4 output : N/A */
#define BOARD_BOOTCLOCKRUN_FLEXCOMM0_FCLK 0UL /* Clock consumers of flexcomm0_fclk output : FLEXCOMM0 */
#define BOARD_BOOTCLOCKRUN_FLEXCOMM14_FCLK 0UL /* Clock consumers of flexcomm14_fclk output : FLEXCOMM14 */
#define BOARD_BOOTCLOCKRUN_FLEXCOMM1_FCLK 0UL /* Clock consumers of flexcomm1_fclk output : FLEXCOMM1 */
#define BOARD_BOOTCLOCKRUN_FLEXCOMM2_FCLK 0UL /* Clock consumers of flexcomm2_fclk output : FLEXCOMM2 */
#define BOARD_BOOTCLOCKRUN_FLEXCOMM3_FCLK 0UL /* Clock consumers of flexcomm3_fclk output : FLEXCOMM3 */
#define BOARD_BOOTCLOCKRUN_FLEXSPI_FCLK 0UL /* Clock consumers of flexspi_fclk output : FLEXSPI */
#define BOARD_BOOTCLOCKRUN_GAU_FCLK 0UL /* Clock consumers of gau_fclk output : GAU_ACOMP, GAU_BG, GAU_DAC0, GAU_GPADC0, GAU_GPADC1 */
#define BOARD_BOOTCLOCKRUN_HCLK 260000000UL /* Clock consumers of hclk output : AHB_SECURE_CTRL, APU0, APU1, BLEAPU, BLECTRL, BUCK11, BUCK18, CACHE64_CTRL0, CACHE64_CTRL1, CACHE64_POLSEL0, CACHE64_POLSEL1, CAU, CDOG, CLKCTL0, CLKCTL1, CRC, CTIMER0, CTIMER1, CTIMER2, CTIMER3, DMA0, DMA1, DMIC0, ELS, ENET, FLEXCOMM0, FLEXCOMM1, FLEXCOMM14, FLEXCOMM2, FLEXCOMM3, FLEXSPI, FREQME, GAU_ACOMP, GAU_BG, GAU_DAC0, GAU_GPADC0, GAU_GPADC1, GDMA, GPIO, INPUTMUX, ITRC, LCDIC, MCI_IO_MUX, MRT0, MRT1, OCOTP, OSTIMER, PINT, PKC, PMU, POWERQUAD, PUF, ROMCP, RSTCTL0, RSTCTL1, RTC, SCT0, SDU_FBR_CARD, SDU_FN0_CARD, SDU_FN_CARD, SECGPIO, SENSOR_CTRL, SOCCTRL, SOC_OTP_CTRL, SYSCTL0, SYSCTL1, SYSCTL2, SysTick, TRNG, USBOTG, USIM, UTICK, WLAPU, WLCTRL, WWDT0 */
#define BOARD_BOOTCLOCKRUN_LCD_FCLK 0UL /* Clock consumers of lcd_fclk output : LCDIC */
#define BOARD_BOOTCLOCKRUN_LPOSC_CLK_I 1000000UL /* Clock consumers of lposc_clk_i output : N/A */
#define BOARD_BOOTCLOCKRUN_MAIN_CLK 260000000UL /* Clock consumers of main_clk output : N/A */
#define BOARD_BOOTCLOCKRUN_MAIN_PLL_CLK 260000000UL /* Clock consumers of main_pll_clk output : N/A */
#define BOARD_BOOTCLOCKRUN_MCLK_OUT 0UL /* Clock consumers of mclk_out output : N/A */
#define BOARD_BOOTCLOCKRUN_OSEVENT_FCLK 0UL /* Clock consumers of osevent_fclk output : OSTIMER */
#define BOARD_BOOTCLOCKRUN_OTP_FUSE_32M_CLK 32000000UL /* Clock consumers of otp_fuse_32m_clk output : OCOTP */
#define BOARD_BOOTCLOCKRUN_REFCLK_PHY 40000000UL /* Clock consumers of refclk_phy output : USBOTG */
#define BOARD_BOOTCLOCKRUN_REFCLK_SYS 0UL /* Clock consumers of refclk_sys output : N/A */
#define BOARD_BOOTCLOCKRUN_SCT_FCLK 0UL /* Clock consumers of sct_fclk output : SCT0 */
#define BOARD_BOOTCLOCKRUN_SFRO_CLK_I 16000000UL /* Clock consumers of sfro_clk_i output : N/A */
#define BOARD_BOOTCLOCKRUN_SYSOSC_CLK_I 0UL /* Clock consumers of sysosc_clk_i output : N/A */
#define BOARD_BOOTCLOCKRUN_SYSTICK_FCLK 260000000UL /* Clock consumers of systick_fclk output : SysTick */
#define BOARD_BOOTCLOCKRUN_T3PLL_MCI_213P3M 0UL /* Clock consumers of t3pll_mci_213p3m output : N/A */
#define BOARD_BOOTCLOCKRUN_T3PLL_MCI_256M 256000000UL /* Clock consumers of t3pll_mci_256m output : N/A */
#define BOARD_BOOTCLOCKRUN_T3PLL_MCI_48_60M_IRC 48301886UL /* Clock consumers of t3pll_mci_48_60m_irc output : N/A */
#define BOARD_BOOTCLOCKRUN_T3PLL_MCI_FLEXSPI_CLK 0UL /* Clock consumers of t3pll_mci_flexspi_clk output : N/A */
#define BOARD_BOOTCLOCKRUN_TCPU_MCI_CLK 260000000UL /* Clock consumers of tcpu_mci_clk output : N/A */
#define BOARD_BOOTCLOCKRUN_TCPU_MCI_FLEXSPI_CLK 0UL /* Clock consumers of tcpu_mci_flexspi_clk output : N/A */
#define BOARD_BOOTCLOCKRUN_TDDR_MCI_ENET_CLK 0UL /* Clock consumers of tddr_mci_enet_clk output : ENET */
#define BOARD_BOOTCLOCKRUN_TDDR_MCI_FLEXSPI_CLK 320000000UL /* Clock consumers of tddr_mci_flexspi_clk output : N/A */
#define BOARD_BOOTCLOCKRUN_USIM_FCLK 0UL /* Clock consumers of usim_fclk output : USIM */
#define BOARD_BOOTCLOCKRUN_UTICK_FCLK 0UL /* Clock consumers of utick_fclk output : UTICK */
#define BOARD_BOOTCLOCKRUN_WDT0_FCLK 0UL /* Clock consumers of wdt0_fclk output : WWDT0 */
/*! @brief AVPLL set for BOARD_BootClockRUN configuration.
*/
extern const clock_avpll_config_t avpllConfig_BOARD_BootClockRUN;
/*! @brief Clock pre-initialization function.
*/
extern void BOARD_ClockPreConfig(void);
/*! @brief Clock post-initialization function.
*/
extern void BOARD_ClockPostConfig(void);
/*******************************************************************************
* API for BOARD_BootClockRUN configuration
******************************************************************************/
#if defined(__cplusplus)
extern "C" {
#endif /* __cplusplus*/
/*!
* @brief This function executes configuration of clocks.
*
*/
void BOARD_BootClockRUN(void);
#if defined(__cplusplus)
}
#endif /* __cplusplus*/
/*******************************************************************************
********************** Configuration BOARD_BootClockLPR ***********************
******************************************************************************/
/*******************************************************************************
* Definitions for BOARD_BootClockLPR configuration
******************************************************************************/
/* Clock outputs (values are in Hz): */
#define BOARD_BOOTCLOCKLPR_AUDIO_PLL_CLK 0UL /* Clock consumers of audio_pll_clk output : N/A */
#define BOARD_BOOTCLOCKLPR_AUX0_PLL_CLK 260000000UL /* Clock consumers of aux0_pll_clk output : N/A */
#define BOARD_BOOTCLOCKLPR_AUX1_PLL_CLK 0UL /* Clock consumers of aux1_pll_clk output : N/A */
#define BOARD_BOOTCLOCKLPR_AVPLL_CH1_CLKOUT 0UL /* Clock consumers of avpll_ch1_clkout output : N/A */
#define BOARD_BOOTCLOCKLPR_AVPLL_CH2_CLKOUT 0UL /* Clock consumers of avpll_ch2_clkout output : N/A */
#define BOARD_BOOTCLOCKLPR_CAU_SLP_CLK 0UL /* Clock consumers of cau_slp_clk output : N/A */
#define BOARD_BOOTCLOCKLPR_CLK_32K 32000UL /* Clock consumers of clk_32k output : RTC */
#define BOARD_BOOTCLOCKLPR_CLK_OUT 0UL /* Clock consumers of clk_out output : N/A */
#define BOARD_BOOTCLOCKLPR_CLK_PMU_SYS 52000000UL /* Clock consumers of clk_pmu_sys output : PMU */
#define BOARD_BOOTCLOCKLPR_CTIMER0_FCLK 0UL /* Clock consumers of ctimer0_fclk output : CTIMER0 */
#define BOARD_BOOTCLOCKLPR_CTIMER1_FCLK 0UL /* Clock consumers of ctimer1_fclk output : CTIMER1 */
#define BOARD_BOOTCLOCKLPR_CTIMER2_FCLK 0UL /* Clock consumers of ctimer2_fclk output : CTIMER2 */
#define BOARD_BOOTCLOCKLPR_CTIMER3_FCLK 0UL /* Clock consumers of ctimer3_fclk output : CTIMER3 */
#define BOARD_BOOTCLOCKLPR_DMIC_FCLK 0UL /* Clock consumers of dmic_fclk output : DMIC0 */
#define BOARD_BOOTCLOCKLPR_ELS_128M_CLK 128000000UL /* Clock consumers of els_128m_clk output : ELS */
#define BOARD_BOOTCLOCKLPR_ELS_256M_CLK 256000000UL /* Clock consumers of els_256m_clk output : N/A */
#define BOARD_BOOTCLOCKLPR_ELS_64M_CLK 64000000UL /* Clock consumers of els_64m_clk output : N/A */
#define BOARD_BOOTCLOCKLPR_ELS_FCLK 0UL /* Clock consumers of els_fclk output : ELS */
#define BOARD_BOOTCLOCKLPR_FFRO_CLK_DIV4 0UL /* Clock consumers of ffro_clk_div4 output : N/A */
#define BOARD_BOOTCLOCKLPR_FLEXCOMM0_FCLK 0UL /* Clock consumers of flexcomm0_fclk output : FLEXCOMM0 */
#define BOARD_BOOTCLOCKLPR_FLEXCOMM14_FCLK 0UL /* Clock consumers of flexcomm14_fclk output : FLEXCOMM14 */
#define BOARD_BOOTCLOCKLPR_FLEXCOMM1_FCLK 0UL /* Clock consumers of flexcomm1_fclk output : FLEXCOMM1 */
#define BOARD_BOOTCLOCKLPR_FLEXCOMM2_FCLK 0UL /* Clock consumers of flexcomm2_fclk output : FLEXCOMM2 */
#define BOARD_BOOTCLOCKLPR_FLEXCOMM3_FCLK 0UL /* Clock consumers of flexcomm3_fclk output : FLEXCOMM3 */
#define BOARD_BOOTCLOCKLPR_FLEXSPI_FCLK 0UL /* Clock consumers of flexspi_fclk output : FLEXSPI */
#define BOARD_BOOTCLOCKLPR_GAU_FCLK 0UL /* Clock consumers of gau_fclk output : GAU_ACOMP, GAU_BG, GAU_DAC0, GAU_GPADC0, GAU_GPADC1 */
#define BOARD_BOOTCLOCKLPR_HCLK 260000000UL /* Clock consumers of hclk output : AHB_SECURE_CTRL, APU0, APU1, BLEAPU, BLECTRL, BUCK11, BUCK18, CACHE64_CTRL0, CACHE64_CTRL1, CACHE64_POLSEL0, CACHE64_POLSEL1, CAU, CDOG, CLKCTL0, CLKCTL1, CRC, CTIMER0, CTIMER1, CTIMER2, CTIMER3, DMA0, DMA1, DMIC0, ELS, ENET, FLEXCOMM0, FLEXCOMM1, FLEXCOMM14, FLEXCOMM2, FLEXCOMM3, FLEXSPI, FREQME, GAU_ACOMP, GAU_BG, GAU_DAC0, GAU_GPADC0, GAU_GPADC1, GDMA, GPIO, INPUTMUX, ITRC, LCDIC, MCI_IO_MUX, MRT0, MRT1, OCOTP, OSTIMER, PINT, PKC, PMU, POWERQUAD, PUF, ROMCP, RSTCTL0, RSTCTL1, RTC, SCT0, SDU_FBR_CARD, SDU_FN0_CARD, SDU_FN_CARD, SECGPIO, SENSOR_CTRL, SOCCTRL, SOC_OTP_CTRL, SYSCTL0, SYSCTL1, SYSCTL2, SysTick, TRNG, USBOTG, USIM, UTICK, WLAPU, WLCTRL, WWDT0 */
#define BOARD_BOOTCLOCKLPR_LCD_FCLK 0UL /* Clock consumers of lcd_fclk output : LCDIC */
#define BOARD_BOOTCLOCKLPR_LPOSC_CLK_I 0UL /* Clock consumers of lposc_clk_i output : N/A */
#define BOARD_BOOTCLOCKLPR_MAIN_CLK 260000000UL /* Clock consumers of main_clk output : N/A */
#define BOARD_BOOTCLOCKLPR_MAIN_PLL_CLK 260000000UL /* Clock consumers of main_pll_clk output : N/A */
#define BOARD_BOOTCLOCKLPR_MCLK_OUT 0UL /* Clock consumers of mclk_out output : N/A */
#define BOARD_BOOTCLOCKLPR_OSEVENT_FCLK 0UL /* Clock consumers of osevent_fclk output : OSTIMER */
#define BOARD_BOOTCLOCKLPR_OTP_FUSE_32M_CLK 32000000UL /* Clock consumers of otp_fuse_32m_clk output : OCOTP */
#define BOARD_BOOTCLOCKLPR_REFCLK_PHY 40000000UL /* Clock consumers of refclk_phy output : USBOTG */
#define BOARD_BOOTCLOCKLPR_REFCLK_SYS 40000000UL /* Clock consumers of refclk_sys output : N/A */
#define BOARD_BOOTCLOCKLPR_SCT_FCLK 0UL /* Clock consumers of sct_fclk output : SCT0 */
#define BOARD_BOOTCLOCKLPR_SFRO_CLK_I 16000000UL /* Clock consumers of sfro_clk_i output : N/A */
#define BOARD_BOOTCLOCKLPR_SYSOSC_CLK_I 0UL /* Clock consumers of sysosc_clk_i output : N/A */
#define BOARD_BOOTCLOCKLPR_SYSTICK_FCLK 260000000UL /* Clock consumers of systick_fclk output : SysTick */
#define BOARD_BOOTCLOCKLPR_T3PLL_MCI_213P3M 0UL /* Clock consumers of t3pll_mci_213p3m output : N/A */
#define BOARD_BOOTCLOCKLPR_T3PLL_MCI_256M 256000000UL /* Clock consumers of t3pll_mci_256m output : N/A */
#define BOARD_BOOTCLOCKLPR_T3PLL_MCI_48_60M_IRC 0UL /* Clock consumers of t3pll_mci_48_60m_irc output : N/A */
#define BOARD_BOOTCLOCKLPR_T3PLL_MCI_FLEXSPI_CLK 0UL /* Clock consumers of t3pll_mci_flexspi_clk output : N/A */
#define BOARD_BOOTCLOCKLPR_TCPU_MCI_CLK 260000000UL /* Clock consumers of tcpu_mci_clk output : N/A */
#define BOARD_BOOTCLOCKLPR_TCPU_MCI_FLEXSPI_CLK 0UL /* Clock consumers of tcpu_mci_flexspi_clk output : N/A */
#define BOARD_BOOTCLOCKLPR_TDDR_MCI_ENET_CLK 0UL /* Clock consumers of tddr_mci_enet_clk output : ENET */
#define BOARD_BOOTCLOCKLPR_TDDR_MCI_FLEXSPI_CLK 0UL /* Clock consumers of tddr_mci_flexspi_clk output : N/A */
#define BOARD_BOOTCLOCKLPR_USIM_FCLK 0UL /* Clock consumers of usim_fclk output : USIM */
#define BOARD_BOOTCLOCKLPR_UTICK_FCLK 0UL /* Clock consumers of utick_fclk output : UTICK */
#define BOARD_BOOTCLOCKLPR_WDT0_FCLK 0UL /* Clock consumers of wdt0_fclk output : WWDT0 */
/*******************************************************************************
* API for BOARD_BootClockLPR configuration
******************************************************************************/
#if defined(__cplusplus)
extern "C" {
#endif /* __cplusplus*/
/*!
* @brief This function executes configuration of clocks.
*
*/
void BOARD_BootClockLPR(void);
#if defined(__cplusplus)
}
#endif /* __cplusplus*/
#endif /* _CLOCK_CONFIG_H_ */
@@ -0,0 +1,36 @@
/*
* Copyright 2021 NXP.
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include "fsl_common.h"
#include "pin_mux.h"
#include "fsl_io_mux.h"
/* FUNCTION ************************************************************************************************************
*
* Function Name : BOARD_InitBootPins
* Description : Calls initialization functions.
*
* END ****************************************************************************************************************/
void BOARD_InitBootPins(void)
{
BOARD_InitPins();
}
/* FUNCTION ************************************************************************************************************
*
* Function Name : BOARD_InitPins
* Description : Configures pin routing and optionally pin electrical features.
*
* END ****************************************************************************************************************/
void BOARD_InitPins(void) { /*!< Function assigned for the core: Cortex-M33[cm33] */
IO_MUX_SetPinMux(IO_MUX_FC3_USART_DATA);
IO_MUX_SetPinMux(IO_MUX_GPIO11);
}
/***********************************************************************************************************************
* EOF
**********************************************************************************************************************/
@@ -0,0 +1,53 @@
/*
* Copyright 2021 NXP.
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef _PIN_MUX_H_
#define _PIN_MUX_H_
/***********************************************************************************************************************
* Definitions
**********************************************************************************************************************/
/*!
* @addtogroup pin_mux
* @{
*/
/***********************************************************************************************************************
* API
**********************************************************************************************************************/
#if defined(__cplusplus)
extern "C" {
#endif
/*!
* @brief Calls initialization functions.
*
*/
void BOARD_InitBootPins(void);
/*!
* @brief Configures pin routing and optionally pin electrical features.
*
*/
void BOARD_InitPins(void); /*!< Function assigned for the core: Cortex-M4[cm4] */
#if defined(__cplusplus)
}
#endif
/*!
* @}
*/
#endif /* _PIN_MUX_H_ */
/***********************************************************************************************************************
* EOF
**********************************************************************************************************************/
@@ -0,0 +1,64 @@
/*
* Copyright 2020-2021,2024 NXP
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
*/
#ifndef TFM_PARTITION_LOADER_SERVICE
#include "fsl_loader_utils.h"
//! @addtogroup sbloader
//! @{
/*******************************************************************************
* Definitions
******************************************************************************/
/*******************************************************************************
* Prototype
******************************************************************************/
/*******************************************************************************
* Variables
******************************************************************************/
/*******************************************************************************
* Codes
******************************************************************************/
////////////////////////////////////////////////////////////////////////////
//! @brief fw download
////////////////////////////////////////////////////////////////////////////
status_t sb3_fw_download(LOAD_Target_Type loadTarget, uint32_t flag, uint32_t sourceAddr)
{
return sb3_fw_download_impl(loadTarget,flag,sourceAddr);
}
////////////////////////////////////////////////////////////////////////////
//! @brief fw reset
////////////////////////////////////////////////////////////////////////////
status_t sb3_fw_reset(LOAD_Target_Type loadTarget, uint32_t flag, uint32_t sourceAddr)
{
return sb3_fw_reset_impl(loadTarget, flag, sourceAddr);
}
////////////////////////////////////////////////////////////////////////////
//! @brief power on device
////////////////////////////////////////////////////////////////////////////
void power_on_device(LOAD_Target_Type loadTarget)
{
power_on_device_impl(loadTarget);
}
////////////////////////////////////////////////////////////////////////////
//! @brief power off device
////////////////////////////////////////////////////////////////////////////
void power_off_device(LOAD_Target_Type loadTarget)
{
power_off_device_impl(loadTarget);
}
//! @}
////////////////////////////////////////////////////////////////////////////
// EOF
////////////////////////////////////////////////////////////////////////////
#endif /* TFM_PARTITION_LOADER_SERVICE */
@@ -0,0 +1,166 @@
/*
* Copyright 2016-2019, 2021,2024 NXP
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
*/
#ifndef __API_TREE_ROOT_H__
#define __API_TREE_ROOT_H__
#include "fsl_loader_utils.h"
#include "nboot_rom_api_table.h"
////////////////////////////////////////////////////////////////////////////////
// Definitions
////////////////////////////////////////////////////////////////////////////////
// Load and set user appplication boot options stored in specific register
#define LOAD_USER_APP_BOOT_OPTIONS() (SYSCON_USER_APP_BOOT_OPTIONS)
#define CLEAR_USER_APP_BOOT_OPTIONS() (SYSCON_USER_APP_BOOT_OPTIONS = 0u)
#define SET_USER_APP_BOOT_OPTIONS(value) (SYSCON_USER_APP_BOOT_OPTIONS = value)
//! @brief Boot parameters of the user application
//! WORD OFFSET FIELD DESCRIPTION
//! [31:24] TAG Must be '0xEB'
//! [23:20] Boot mode 0:Master boot mode; 1: ISP boot
//! [19:16] Boot interface 0:USART 1:I2C 2:SPI 3:USB HID 4:QSPI 5:USB DFU
//! [15:12] Boot instance(Channel) 0 or 1; For SD or MMC,this is to select the instance
//! For FLEXSPI boot, this select the Channel A or Channel B
//! [11:08] Redundant boot image index Redundant boot image index for FlexSPI NOR flash
//! [07:00] Reserved
//!
//! TAG[31:24] BOOT MODE[23:20] INTERFACE[19:16] INSTANCE[15:12] RBII Reserved[07:00] COMBINATION BOOT ACTION
//! 0xEB 0 0 X X X 0xEB00XXXX MASTR BOOT: USART
//! 0 1 X X X 0xEB01XXXX MASTR BOOT: I2C
//! 0 2 X X X 0xEB02XXXX MASTR BOOT: SPI
//! 0 3 X X X 0xEB03XXXX MASTR BOOT: USB HID
//! 0 4 X 0 X 0xEB0400XX MASTR BOOT: FlexSPI Channel A:boot image index 0
//! 0 4 X 1 X 0xEB0401XX MASTR BOOT: FlexSPI Channel A:boot image index 1
//! 0 4 X 0 X 0xEB0410XX MASTR BOOT: FlexSPI Channel B:boot image index 0
//! 0 4 X 1 X 0xEB0411XX MASTR BOOT: FlexSPI Channel B:boot image index 1
//! 0 5 X X X 0xEB05XXXX MASTR BOOT: USB DFU
//! 1 0 X X X 0xEB10XXXX ISP BOOT: USART
//! 1 1 X X X 0xEB11XXXX ISP BOOT: I2C
//! 1 2 X X X 0xEB12XXXX ISP BOOT: SPI
//!
typedef struct _fsl_user_app_boot_invoke_option
{
union
{
struct
{
uint32_t reserved : 8;
uint32_t boot_image_index : 4;
uint32_t instance : 4;
uint32_t boot_interface : 4;
uint32_t mode : 4;
uint32_t tag : 8;
} B;
uint32_t U;
} option;
} fsl_user_app_boot_invoke_option_t;
//! @brief Boot interface can be selected by user application
//! @note For USB-HID QSPI USB-DFU SD MMC, these interfaces are invalid for ISP boot
enum
{
kUserAppBootPeripheral_UART = 0u,
kUserAppBootPeripheral_I2C = 1u,
kUserAppBootPeripheral_SPI = 2u,
kUserAppBootPeripheral_USB_HID = 3u,
kUserAppBootPeripheral_FLEXSPI = 4u,
kUserAppBootPeripheral_DFU = 5u
};
//! @brief Boot mode can be selected by user application
//! @note For master boot, valid boot insterfaces for user application are USART I2C SPI USB-HID USB-DFU SD MMC
//! For ISP boot, valid boot interfaces for user application are USART I2C SPI
enum
{
kUserAppBootMode_MasterBoot = 0,
kUserAppBootMode_IspBoot = 1,
};
//!@brief OTP driver API Interface for A0
typedef struct
{
uint32_t version;
status_t (*init)(uint32_t src_clk_freq);
status_t (*deinit)(void);
status_t (*fuse_read)(uint32_t addr, uint32_t *data);
status_t (*fuse_program)(uint32_t addr, uint32_t data, bool lock);
status_t (*reload)(void);
status_t (*crc_check)(uint32_t start_addr, uint32_t end_addr, uint32_t crc_addr);
status_t (*crc_calc)(uint32_t *src, uint32_t numberOfWords, uint32_t *crcChecksum);
status_t (*crc_check_sw)(uint32_t *src, uint32_t numberOfWords, uint32_t crc_fuse_idx);
} ocotp_driver_v0_t;
//!@brief OTP driver API Interface for A1/A2
typedef struct
{
uint32_t version;
status_t (*init)(uint32_t src_clk_freq);
status_t (*deinit)(void);
status_t (*fuse_read)(uint32_t addr, uint32_t *data, uint32_t argChk);
status_t (*fuse_program)(uint32_t addr, uint32_t data, bool lock);
status_t (*reload)(void);
status_t (*crc_check)(uint32_t start_addr, uint32_t end_addr, uint32_t crc_addr);
status_t (*crc_calc)(uint32_t *src, uint32_t numberOfWords, uint32_t *crcChecksum);
status_t (*crc_check_sw)(uint32_t *src, uint32_t numberOfWords, uint32_t crc_fuse_idx);
} ocotp_driver_v1_t;
//! @brief Root of the bootloader API tree for A0.
//!
//! An instance of this struct resides in read-only memory in the bootloader. It
//! provides a user application access to APIs exported by the bootloader.
//!
//! @note The order of existing fields must not be changed.
//!
//! @ingroup context
typedef struct BootloaderTree_v0
{
void (*runBootloader)(void *arg); //!< Function to start the bootloader executing.
fsl_standard_version_t version; //!< Bootloader version number.
const char *copyright; //!< Copyright string.
const uint32_t reservedBootloader2;
const nboot_interface_v0_t *nbootDriver; //!< Image authentication API.
const uint32_t reservedBootloader3;
const ocotp_driver_v0_t *otpDriver; //!< OTP driver API.
const fsl_iap_api_interface_t *iapApiDriver;
} bootloader_tree_v0_t;
//! @brief Root of the bootloader API tree for A1/A2.
//!
//! An instance of this struct resides in read-only memory in the bootloader. It
//! provides a user application access to APIs exported by the bootloader.
//!
//! @note The order of existing fields must not be changed.
//!
//! @ingroup context
typedef struct BootloaderTree_v1
{
void (*runBootloader)(void *arg); //!< Function to start the bootloader executing.
fsl_standard_version_t version; //!< Bootloader version number.
const char *copyright; //!< Copyright string.
const uint32_t reservedBootloader2;
const nboot_interface_v1_t *nbootDriver; //!< Image authentication API.
const uint32_t reservedBootloader3;
const ocotp_driver_v1_t *otpDriver; //!< OTP driver API.
const fsl_iap_api_interface_t *iapApiDriver;
} bootloader_tree_v1_t;
#if defined(__cplusplus)
extern "C" {
#endif
#if defined(__cplusplus)
}
#endif
#endif // __API_TREE_ROOT_H__
////////////////////////////////////////////////////////////////////////////////
// EOF
////////////////////////////////////////////////////////////////////////////////
@@ -0,0 +1,36 @@
/*
* Copyright 2016, 2022,2024 NXP
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef __FSL_LOADER_H__
#define __FSL_LOADER_H__
#include <stdint.h>
#include "fsl_common.h"
typedef enum
{
LOAD_WIFI_FIRMWARE = 1,
LOAD_BLE_FIRMWARE,
LOAD_15D4_FIRMWARE,
#ifdef CONFIG_FW_VDLLV2
LOAD_WIFI_VDLL_FIRMWARE,
#endif
LOAD_WIFI_FW_MONOLITHIC = 0x81,
LOAD_BLE_FW_MONOLITHIC = 0x82,
LOAD_15D4_FW_MONOLITHIC = 0x83,
LOAD_TYPE_MAX,
} LOAD_Target_Type;
void power_on_device(LOAD_Target_Type loadTarget);
void power_off_device(LOAD_Target_Type loadTarget);
status_t sb3_fw_download(LOAD_Target_Type loadTarget, uint32_t flag, uint32_t sourceAddr);
status_t sb3_fw_reset(LOAD_Target_Type loadTarget, uint32_t flag, uint32_t sourceAddr);
//! @}
#endif
@@ -0,0 +1,670 @@
/*
* Copyright 2024 NXP
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef __FSL_LOADER_UTILS_H__
#define __FSL_LOADER_UTILS_H__
#include <stdint.h>
#include "fsl_common.h"
#include "fsl_loader.h"
#include "fusemap.h"
#include "fsl_ocotp.h"
#include "fsl_os_abstraction.h"
//! @addtogroup sbloader
//! @{
/*! @brief Status group numbers. */
#define kStatusGroup_SBLoader (101U)
#define NBOOT_SB3_BLOCK_HASH384_SIZE_IN_BYTES (48u)
#define NBOOT_ROOT_OF_TRUST_HASH_SIZE_IN_BYTES (48u)
#define NBOOT_EC_COORDINATE_384_SIZE_IN_BYTES (48u)
#define NBOOT_EC_COORDINATE_MAX_SIZE NBOOT_EC_COORDINATE_384_SIZE_IN_BYTES
#define NBOOT_ROOT_CERT_COUNT (4u)
#define NBOOT_SB3_CHUNK_SIZE_IN_BYTES (256u)
#define NBOOT_KEYINFO_WORDLEN (23u)
#define NXPCLHASH_WA_SIZE_MAX (128u + 64u)
#define NBOOT_CONTEXT_BYTELEN (192u + NXPCLHASH_WA_SIZE_MAX)
#define NBOOT_CONTEXT_WORDLEN (NBOOT_CONTEXT_BYTELEN / sizeof(uint32_t))
#define NXPCLCSS_HASH_RTF_OUTPUT_SIZE ((size_t)32U)
#define SECURE_TERM_PART_LOCK (0x6ac3c36au)
#define SECURE_TERM_PART_OPEN (0xc36ac36au)
#define SECURE_TERM_SECURE_PART_OPEN (0xc36a6ac3u)
#define SECURE_TERM_FA_PART_OPEN (0xc3c36a6au)
#define SECURE_OEM_FA_PART_OPEN (0xc3c3a6a6u)
#define LOADER_RAW_BINARY_FORMAT (0x72617762U)
#ifdef CONFIG_FW_VDLLV2
#define LOADER_VDLL_RAW_BINARY_FORMAT (0x76646c6cU)
#endif
/*! @brief partition table constants. */
#define WIFI_IMAGE_SIZE_MAX (0xa0000U)
#define BLE_IMAGE_SIZE_MAX (0x50000U)
#define Z154_IMAGE_SIZE_MAX (0x50000U)
#ifndef WIFI_IMAGE_A_OFFSET
#define WIFI_IMAGE_A_OFFSET (0x08400000U)
#endif
#define WIFI_IMAGE_B_OFFSET (WIFI_IMAGE_A_OFFSET + WIFI_IMAGE_SIZE_MAX) // 0x4a0000
#define BLE_IMAGE_A_OFFSET (WIFI_IMAGE_B_OFFSET + WIFI_IMAGE_SIZE_MAX) // 0x540000
#define BLE_IMAGE_B_OFFSET (BLE_IMAGE_A_OFFSET + BLE_IMAGE_SIZE_MAX) // 0x590000
#define Z154_IMAGE_A_OFFSET (BLE_IMAGE_B_OFFSET + BLE_IMAGE_SIZE_MAX) // 0x5e0000
#define Z154_IMAGE_B_OFFSET (Z154_IMAGE_A_OFFSET + Z154_IMAGE_SIZE_MAX) // 0x630000
/** Type for nboot status codes */
typedef uint32_t fsl_nboot_status_t;
/**
* \defgroup nbootStatusValues This type defines status return values used by NBOOT functions that are not easily
* disturbed by Fault Attacks
* @{
*/
#define kStatus_NBOOT_Success ((fsl_nboot_status_t)0x5A5A5A5Au) /*!< Operation completed successfully. */
#define kStatus_NBOOT_Fail ((fsl_nboot_status_t)0x5A5AA5A5u) /*!< Operation failed. */
#define kStatus_NBOOT_InvalidArgument ((fsl_nboot_status_t)0x5A5AA5F0u) /*!< Invalid argument passed to the function. */
#define kStatus_NBOOT_RequestTimeout ((fsl_nboot_status_t)0x5A5AA5E1u) /*!< Operation timed out. */
#define kStatus_NBOOT_KeyNotLoaded ((fsl_nboot_status_t)0x5A5AA5E2u) /*!< The requested key is not loaded. */
#define kStatus_NBOOT_AuthFail ((fsl_nboot_status_t)0x5A5AA5E4u) /*!< Authentication failed. */
#define kStatus_NBOOT_OperationNotAvaialable ((fsl_nboot_status_t)0x5A5AA5E5u) /*!< Operation not available on this HW. */
#define kStatus_NBOOT_KeyNotAvailable ((fsl_nboot_status_t)0x5A5AA5E6u) /*!< Key is not avaialble. */
#define kStatus_NBOOT_IvCounterOverflow ((fsl_nboot_status_t)0x5A5AA5E7u) /*!< Overflow of IV counter (PRINCE/IPED). */
#define kStatus_NBOOT_SelftestFail ((fsl_nboot_status_t)0x5A5AA5E8u) /*!< FIPS self-test failure. */
#define kStatus_NBOOT_InvalidDataFormat ((fsl_nboot_status_t)0x5A5AA5E9u) /*!< Invalid data format for example antipole */
#define kStatus_NBOOT_IskCertUserDataTooBig \
((fsl_nboot_status_t)0x5A5AA5EAu) /*!< Size of User data in ISK certificate is greater than 96 bytes */
#define kStatus_NBOOT_IskCertSignatureOffsetTooSmall \
((fsl_nboot_status_t)0x5A5AA5EBu) /*!< Signature offset in ISK certificate is smaller than expected */
#define kStatus_NBOOT_MemcpyFail ((fsl_nboot_status_t)0x5A5A845A) /*!< Unexpected error detected during nboot_memcpy() */
/*! @brief sb3.1 maigc number. */
#define TAG_SB_V3 (0x33766273U) // "sbv3"
/*!
* @brief NBOOT type for the root key revocation
*
* This type defines the NBOOT root key revocation
*
*/
#define kNBOOT_RootKey_Enabled (0xAAu)
#define kNBOOT_RootKey_Revoked (0xBBu)
/*! @brief The size of the root of trust key table hash. */
#define NBOOT_ROOT_ROTKH_SIZE_IN_WORD (12U)
#define NBOOT_ROOT_ROTKH_SIZE_IN_BYTE (NBOOT_ROOT_ROTKH_SIZE_IN_WORD * 4U)
/*! @brief The size of PKC Blob. */
#define NBOOT_PCK_BLOB_SIZE_IN_WORD (12U)
#define NBOOT_PCK_BLOB_SIZE_IN_BYTE (NBOOT_PCK_BLOB_SIZE_IN_WORD * 4U)
/*!
* @brief NBOOT type specifying the elliptic curve to be used
*
* This type defines the elliptic curve type and length
*
*/
#define kNBOOT_RootKey_Ecdsa_P256 (0x0000FE01u)
#define kNBOOT_RootKey_Ecdsa_P384 (0x0000FD02u)
/*!
* @brief NBOOT type for the root key usage
*
* This type defines the NBOOT root key usage
*
*/
#define kNBOOT_RootKeyUsage_DebugCA_ImageCA_FwCA_ImageKey_FwKey (0x0u)
#define kNBOOT_RootKeyUsage_Unused (0x7u)
//! @brief SB loader status codes.
enum _sbloader_status
{
kStatusRomLdrSectionOverrun = MAKE_STATUS(kStatusGroup_SBLoader, 0),
kStatusRomLdrSignature = MAKE_STATUS(kStatusGroup_SBLoader, 1),
kStatusRomLdrSectionLength = MAKE_STATUS(kStatusGroup_SBLoader, 2),
kStatusRomLdrUnencryptedOnly = MAKE_STATUS(kStatusGroup_SBLoader, 3),
kStatusRomLdrEOFReached = MAKE_STATUS(kStatusGroup_SBLoader, 4),
kStatusRomLdrChecksum = MAKE_STATUS(kStatusGroup_SBLoader, 5),
kStatusRomLdrCrc32Error = MAKE_STATUS(kStatusGroup_SBLoader, 6),
kStatusRomLdrUnknownCommand = MAKE_STATUS(kStatusGroup_SBLoader, 7),
kStatusRomLdrIdNotFound = MAKE_STATUS(kStatusGroup_SBLoader, 8),
kStatusRomLdrDataUnderrun = MAKE_STATUS(kStatusGroup_SBLoader, 9),
kStatusRomLdrJumpReturned = MAKE_STATUS(kStatusGroup_SBLoader, 10),
kStatusRomLdrCallFailed = MAKE_STATUS(kStatusGroup_SBLoader, 11),
kStatusRomLdrKeyNotFound = MAKE_STATUS(kStatusGroup_SBLoader, 12),
kStatusRomLdrSecureOnly = MAKE_STATUS(kStatusGroup_SBLoader, 13),
kStatusRomLdrResetReturned = MAKE_STATUS(kStatusGroup_SBLoader, 14),
kStatusRomLdrRollbackBlocked = MAKE_STATUS(kStatusGroup_SBLoader, 15),
kStatusRomLdrInvalidSectionMacCount = MAKE_STATUS(kStatusGroup_SBLoader, 16),
kStatusRomLdrUnexpectedCommand = MAKE_STATUS(kStatusGroup_SBLoader, 17),
kStatusRomLdrBadSBKEK = MAKE_STATUS(kStatusGroup_SBLoader, 18),
kStatusRomLdrPendingJumpCommand = MAKE_STATUS(kStatusGroup_SBLoader, 19),
};
/*!
* @brief Boolean type for the NBOOT functions
*
* This type defines boolean values used by NBOOT functions that are not easily disturbed by Fault Attacks
*
*/
typedef enum _fsl_nboot_bool
{
kNBOOT_TRUE = 0x3C5AC33Cu, /*!< Value for TRUE. */
kNBOOT_TRUE256 = 0x3C5AC35Au, /*!< Value for TRUE when P256 was used to sign the image. */
kNBOOT_TRUE384 = 0x3C5AC3A5u, /*!< Value for TRUE when P384 was used to sign the image. */
kNBOOT_FALSE = 0x5AA55AA5u, /*!< Value for FALSE. */
kNBOOT_OperationAllowed = 0x3c5a33ccU,
kNBOOT_OperationDisallowed = 0x5aa5cc33U,
} fsl_nboot_bool_t;
/** Type for nboot protected status codes */
typedef uint64_t fsl_nboot_status_protected_t;
/*!
* @brief NBOOT type for a timestamp
*
* This type defines the NBOOT timestamp
*
*/
typedef uint32_t fsl_nboot_timestamp_t[2];
typedef uint32_t fsl_nboot_root_key_revocation_t;
typedef uint32_t fsl_nboot_root_key_usage_t;
typedef uint32_t fsl_nboot_root_key_type_and_length_t;
typedef uint32_t fsl_nboot_soc_lifecycle_t;
/*!
* @brief NBOOT type for the root of trust parameters
*
* This type defines the NBOOT root of trust parameters
*
*/
#define kNBOOT_SocRkh_Size_Words_P384 (12u)
#define kNBOOT_SocRkh_Size_Words_P256 (8u)
typedef struct _fsl_nboot_rot_auth_parms
{
/* trusted information originated from CFPA */
fsl_nboot_root_key_revocation_t soc_rootKeyRevocation[NBOOT_ROOT_CERT_COUNT]; /*!< Provided by caller based on NVM
information in CFPA: ROTKH_REVOKE */
uint32_t soc_imageKeyRevocation; /*!< Provided by caller based on NVM information in CFPA: IMAGE_KEY_REVOKE */
/* trusted information originated from CMPA */
uint32_t soc_rkh[kNBOOT_SocRkh_Size_Words_P384]; /*!< Provided by caller based on NVM information in CMPA: ROTKH
(hash of hashes) */
/*!< In case of kNBOOT_RootKey_Ecdsa_P384, sock_rkh[0..11] are used */
/*!< In case of kNBOOT_RootKey_Ecdsa_P256, sock_rkh[0..7] are used */
uint32_t soc_numberOfRootKeys; /* unsigned int, between minimum = 1 and maximum = 4; */
fsl_nboot_root_key_usage_t soc_rootKeyUsage[NBOOT_ROOT_CERT_COUNT]; /* CMPA */
fsl_nboot_root_key_type_and_length_t
soc_rootKeyTypeAndLength; /* static selection between ECDSA P-256 or ECDSA P-384 based root keys */
/* trusted information originated from OTP fuses */
fsl_nboot_soc_lifecycle_t soc_lifecycle;
} fsl_nboot_rot_auth_parms_t;
/*!
* @brief NBOOT SB3.1 header type
*
* This type defines the header used in the SB3.1 manifest
*
*/
typedef struct _fsl_nboot_sb3_header
{
uint32_t magic; /*! offset 0x00: Fixed 4-byte string of 'sbv3' without the trailing NULL */
uint32_t formatVersion; /*! offset 0x04: (major = 3, minor = 1); The format version determines the manifest (block0)
size. */
uint32_t flags; /*! offset 0x08: not defined yet, keep zero for future compatibility */
uint32_t blockCount; /*! offset 0x0C: Number of blocks not including the manifest (block0). */
uint32_t blockSize; /*! offset 0x10: Size in bytes of data block (repeated blockCount times for SB3 data stream). */
fsl_nboot_timestamp_t timeStamp; /*! offset 0x14: 64-bit value used as key derivation data. */
uint32_t firmwareVersion; /*! offset 0x1c: Version number of the included firmware */
uint32_t imageTotalLength; /*! offset 0x20: Total manifest length in bytes, including signatures etc. */
uint32_t imageType; /*! offset 0x24: image type and flags */
uint32_t certificateBlockOffset; /*! offset 0x28: Offset from start of header block to the certificate block. */
uint8_t description[16]; /*! offset 0x32: This field provides description of the file. It is an arbitrary
string injected by the signing tool, which helps to identify the file. */
} fsl_nboot_sb3_header_t;
/*!
* @brief manifest loading parameters
*
* This type defines the NBOOT SB3.1 manifest loading parameters
*
*/
typedef struct _fsl_nboot_sb3_load_manifest_parms
{
fsl_nboot_rot_auth_parms_t soc_RoTNVM; /*! trusted information originated from CFPA and NMPA */
uint32_t soc_trustedFirmwareVersion; /*!< Provided by caller based on NVM information in CFPA: Secure_FW_Version */
uint8_t pckBlob[48]; /*! CSSv2 protected blob with Part Common Key (PCK) */
} fsl_nboot_sb3_load_manifest_parms_t;
/*! @brief Data structure holding input arguments to POR secure boot (authentication) algorithm. Shall be read from SoC
* trusted NVM or SoC fuses. */
typedef struct _fsl_nboot_img_auth_ecdsa_parms
{
/* trusted information originated from CFPA and NMPA */
fsl_nboot_rot_auth_parms_t soc_RoTNVM;
uint32_t soc_trustedFirmwareVersion; /*!< Provided by caller based on NVM information in CFPA: Secure_FW_Version */
} fsl_nboot_img_auth_ecdsa_parms_t;
/*! @brief The size of the blob with Key Blob. */
#define NBOOT_KEY_BLOB_SIZE_IN_BYTE_256 (32)
#define NBOOT_KEY_BLOB_SIZE_IN_BYTE_384 (48)
#define NBOOT_KEY_BLOB_SIZE_IN_BYTE_MAX (NBOOT_KEY_BLOB_SIZE_IN_BYTE_384)
#define NBOOT_SB3_MANIFEST_MAX_SIZE_IN_BYTES (808)
#define NBOOT_SB3_BLOCK_MAX_SIZE_IN_BYTES (308)
// Provides forward reference to the loader context definition.
typedef struct _fsl_ldr_Context_v3 fsl_ldr_Context_v3_t;
//! sb3 section definitions
//! section type
typedef enum _fsl_sectionType
{
kSectionNone = 0, // end or invalid
kSectionDataRange = 1,
kSectionDiffUpdate = 2,
kSectionDDRConfig = 3,
kSectionRegister = 4,
} fsl_section_type_t;
#define SB3_DATA_RANGE_HEADER_FLAGS_ERASE_MASK (0x1u) // bit 0
#define SB3_DATA_RANGE_HEADER_FLAGS_LOAD_MASK (0x2u) // bit 1
#define SB3_DATA_RANGE_HEADER_TAG (0x55aaaa55U)
#define SB3_DATA_ALIGNMENT_SIZE_IN_BYTE (16u)
//! section data range structure
typedef struct fsl_range_header
{
uint32_t tag;
uint32_t startAddress;
uint32_t length;
uint32_t cmd;
} fsl_sb3_data_range_header_t;
typedef struct fsl_range_header_expansion
{
uint32_t memoryId;
uint32_t pad0;
uint32_t pad1;
uint32_t pad2;
} fsl_sb3_data_range_expansion_t;
//! sb3 DATA section header format
typedef struct fsl_section_header
{
uint32_t sectionUid;
uint32_t sectionType;
uint32_t length;
uint32_t _pad;
} fsl_sb3_section_header_t;
// loader command enum
typedef enum _fsl_loader_command_sb3
{
kSB3_CmdInvalid = 0,
kSB3_CmdLoad = 2,
kSB3_CmdExecute = 3,
} fsl_sb3_cmd_t;
//! The all of the allowed command
#define SBLOADER_V3_CMD_SET_ALL ((1u << kSB3_CmdLoad) | (1u << kSB3_CmdExecute))
#define SB3_DATA_BUFFER_SIZE_IN_BYTE (MAX(128, NBOOT_KEY_BLOB_SIZE_IN_BYTE_MAX))
/*! @brief Data structure holding secure counter value used by nboot library */
typedef struct _fsl_nboot_secure_counter
{
uint32_t sc;
uint32_t scAp;
} fsl_nboot_secure_counter_t;
/*!
* @brief NBOOT context type
*
* This type defines the NBOOT context
*
*/
typedef struct _fsl_nboot_context
{
uint32_t totalBlocks; /*!< holds number of SB3 blocks. Initialized by nboot_sb3_load_header(). */
uint32_t processData; /*!< flag, initialized by nboot_sb3_load_header().
SB3 related flag set by NBOOT in case the nboot_sb3_load_block()
provides plain data to output buffer (for processing by ROM SB3 loader */
uint32_t timeout; /*!< timeout value for css operation. In case it is 0, infinite wait is performed */
uint32_t keyinfo[NBOOT_KEYINFO_WORDLEN]; /*!< data for NBOOT key management. */
uint32_t context[NBOOT_CONTEXT_WORDLEN]; /*!< work area for NBOOT lib. */
uint32_t uuid[4]; /*!< holds UUID value from NMPA */
uint32_t prngReadyFlag; /*!< flag, used by nboot_rng_generate_lq_random() to determine whether CSS is ready to
generate rnd number */
uint32_t multipartMacBuffer[1024 / sizeof(uint32_t)];
uint32_t oemShareValidFlag; /*!< flag, used during TP to determine whether valid oemShare was set by
nboot_tp_isp_gen_oem_master_share() */
uint32_t oemShare[4]; /*!< buffer to store OEM_SHARE computed by nxpCLTrustProv_nboot_isp_gen_oem_master_share() */
fsl_nboot_secure_counter_t secureCounter; /*!< Secure counter used by nboot */
uint32_t rtf[NXPCLCSS_HASH_RTF_OUTPUT_SIZE / sizeof(uint32_t)];
uint32_t imageHash[48 / sizeof(uint32_t)];
uint32_t authStatus;
fsl_nboot_bool_t disableProvisioningFirmwareNXP; /*!< Flag to disable execution of NXP signed provisioning Firmwares */
} fsl_nboot_context_t;
//! @brief Structure of version property.
//!
//! @ingroup bl_core
typedef union fsl_StandardVersion
{
struct
{
uint8_t bugfix; //!< bugfix version [7:0]
uint8_t minor; //!< minor version [15:8]
uint8_t major; //!< major version [23:16]
char name; //!< name [31:24]
};
uint32_t version; //!< combined version numbers
#if defined(__cplusplus)
StandardVersion() : version(0)
{
}
StandardVersion(uint32_t version) : version(version)
{
}
#endif
} fsl_standard_version_t;
//!@brief Memory region information table
typedef struct fsl_mem_region
{
uint32_t start;
uint32_t end;
} fsl_mem_region_t;
//! @brief Memory Attribute Structure
typedef struct _fsl_mem_attribute
{
uint32_t memId;
uint32_t regionCount;
fsl_mem_region_t *memRegions;
void *context;
} fsl_mem_attribute_t;
typedef struct _fsl_arena_context
{
uint32_t start;
uint32_t end;
uint32_t nextAddr;
} fsl_arena_context_t;
//!@brief Memory region interface structure
typedef struct fsl_api_memory_region_interface
{
status_t (*init)(fsl_mem_attribute_t *attr);
#if defined(ROM_API_HAS_FEATURE_MEM_READ)
#if ROM_API_HAS_FEATURE_MEM_READ
status_t (*read)(fsl_mem_attribute_t *attr, uint32_t addr, uint32_t leth, uint8_t *buf);
#endif
#endif
status_t (*write)(fsl_mem_attribute_t *attr, uint32_t addr, uint32_t len, const uint8_t *buf);
status_t (*fill)(fsl_mem_attribute_t *attr, uint32_t addr, uint32_t len, uint32_t pattern);
status_t (*flush)(fsl_mem_attribute_t *attr);
status_t (*erase)(fsl_mem_attribute_t *attr, uint32_t addr, uint32_t len);
status_t (*config)(fsl_mem_attribute_t *attr, uint32_t *buf);
status_t (*erase_all)(fsl_mem_attribute_t *attr);
status_t (*alloc_ctx)(fsl_arena_context_t *ctx, fsl_mem_attribute_t *attr, void *miscParams);
} fsl_api_memory_region_interface_t;
/*******************************************************************************
* Definitions
******************************************************************************/
//! @brief Contiguous RAM region count
#define RAM_REGION_COUNT (2U)
//! @brief Contiguous FLEXSPINOR meomry count
#define FLEXSPINOR_REGION_COUNT (1U)
//! @brief Memory Interface count
#define MEM_INTERFACE_COUNT (2U)
//!@brief FlexSPI LUT Sequence structure
typedef struct _fsl_lut_sequence
{
uint8_t seqNum; //!< Sequence Number, valid number: 1-16
uint8_t seqId; //!< Sequence Index, valid number: 0-15
uint16_t reserved;
} fsl_flexspi_lut_seq_t;
//!@brief FlexSPI Pad Configuration Override
typedef struct
{
uint8_t pu_pd_override_en;
uint8_t pu_pd_value;
uint8_t sr_config_override_en;
uint8_t sr_config_value;
} fsl_flexspi_pad_config_override_t;
typedef struct
{
uint8_t time_100ps; // Data valid time, in terms of 100ps
uint8_t delay_cells; // Data valid time, in terms of delay cells
} fsl_flexspi_dll_time_t;
//!@brief FlexSPI Memory Configuration Block
typedef struct _fsl_FlexSPIConfig
{
uint32_t tag; //!< [0x000-0x003] Tag, fixed value 0x42464346UL
uint32_t version; //!< [0x004-0x007] Version,[31:24] -'V', [23:16] - Major, [15:8] - Minor, [7:0] - bugfix
uint32_t reserved0; //!< [0x008-0x00b] Reserved for future use
uint8_t readSampleClkSrc; //!< [0x00c-0x00c] Read Sample Clock Source, valid value: 0/1/3
uint8_t csHoldTime; //!< [0x00d-0x00d] CS hold time, default value: 3
uint8_t csSetupTime; //!< [0x00e-0x00e] CS setup time, default value: 3
uint8_t columnAddressWidth; //!< [0x00f-0x00f] Column Address with, for HyperBus protocol, it is fixed to 3, For
//! Serial NAND, need to refer to datasheet
uint8_t deviceModeCfgEnable; //!< [0x010-0x010] Device Mode Configure enable flag, 1 - Enable, 0 - Disable
uint8_t deviceModeType; //!< [0x011-0x011] Specify the configuration command type:Quad Enable, DPI/QPI/OPI switch,
//! Generic configuration, etc.
uint16_t waitTimeCfgCommands; //!< [0x012-0x013] Wait time for all configuration commands, unit: 100us, Used for
//! DPI/QPI/OPI switch or reset command
fsl_flexspi_lut_seq_t deviceModeSeq; //!< [0x014-0x017] Device mode sequence info, [7:0] - LUT sequence id, [15:8] - LUt
//! sequence number, [31:16] Reserved
uint32_t deviceModeArg; //!< [0x018-0x01b] Argument/Parameter for device configuration
uint8_t configCmdEnable; //!< [0x01c-0x01c] Configure command Enable Flag, 1 - Enable, 0 - Disable
uint8_t configModeType[3]; //!< [0x01d-0x01f] Configure Mode Type, similar as deviceModeTpe
fsl_flexspi_lut_seq_t
configCmdSeqs[3]; //!< [0x020-0x02b] Sequence info for Device Configuration command, similar as deviceModeSeq
uint32_t reserved1; //!< [0x02c-0x02f] Reserved for future use
uint32_t configCmdArgs[3]; //!< [0x030-0x03b] Arguments/Parameters for device Configuration commands
uint32_t reserved2; //!< [0x03c-0x03f] Reserved for future use
uint32_t controllerMiscOption; //!< [0x040-0x043] Controller Misc Options, see Misc feature bit definitions for more
//! details
uint8_t deviceType; //!< [0x044-0x044] Device Type: See Flash Type Definition for more details
uint8_t sflashPadType; //!< [0x045-0x045] Serial Flash Pad Type: 1 - Single, 2 - Dual, 4 - Quad, 8 - Octal
uint8_t serialClkFreq; //!< [0x046-0x046] Serial Flash Frequencey, device specific definitions, See System Boot
//! Chapter for more details
uint8_t lutCustomSeqEnable; //!< [0x047-0x047] LUT customization Enable, it is required if the program/erase cannot
//! be done using 1 LUT sequence, currently, only applicable to HyperFLASH
uint32_t reserved3[2]; //!< [0x048-0x04f] Reserved for future use
uint32_t sflashA1Size; //!< [0x050-0x053] Size of Flash connected to A1
uint32_t sflashA2Size; //!< [0x054-0x057] Size of Flash connected to A2 (unused/not applicable on RW610)
uint32_t sflashB1Size; //!< [0x058-0x05b] Size of Flash connected to B1
uint32_t sflashB2Size; //!< [0x05c-0x05f] Size of Flash connected to B2 (unused/not applicable on RW610)
fsl_flexspi_pad_config_override_t csPadSettingOverride; //!< [0x060-0x063] CS pad setting override value
fsl_flexspi_pad_config_override_t sclkPadSettingOverride; //!< [0x064-0x067] SCK pad setting override value
fsl_flexspi_pad_config_override_t dataPadSettingOverride; //!< [0x068-0x06b] data pad setting override value
fsl_flexspi_pad_config_override_t dqsPadSettingOverride; //!< [0x06c-0x06f] DQS pad setting override value
uint32_t timeoutInMs; //!< [0x070-0x073] Timeout threshold for read status command
uint32_t commandInterval; //!< [0x074-0x077] CS deselect interval between two commands
fsl_flexspi_dll_time_t dataValidTime[2]; //!< [0x078-0x07b] CLK edge to data valid time for PORT A and PORT B
uint16_t busyOffset; //!< [0x07c-0x07d] Busy offset, valid value: 0-31
uint16_t busyBitPolarity; //!< [0x07e-0x07f] Busy flag polarity, 0 - busy flag is 1 when flash device is busy, 1 -
//! busy flag is 0 when flash device is busy
uint32_t lookupTable[64]; //!< [0x080-0x17f] Lookup table holds Flash command sequences
fsl_flexspi_lut_seq_t lutCustomSeq[12]; //!< [0x180-0x1af] Customizable LUT Sequences
uint32_t dll0CrVal; //!> [0x1b0-0x1b3] Customizable DLL0CR setting
uint32_t dll1CrVal; //!> [0x1b4-0x1b7] Customizable DLL1CR setting
uint32_t reserved4[2]; //!< [0x1b8-0x1bf] Reserved for future use
} fsl_flexspi_mem_config_t;
typedef struct fsl_soc_memory_map_struct
{
struct
{
uint32_t start;
uint32_t end;
} ramRegions[RAM_REGION_COUNT];
struct
{
uint32_t start;
uint32_t end;
} flexspiNorRegions[FLEXSPINOR_REGION_COUNT];
} fsl_soc_mem_regions_t;
//!@brief Memory entry data structure
typedef struct fsl_memory_map_entry
{
fsl_mem_attribute_t *memoryAttribute;
const fsl_api_memory_region_interface_t *memoryInterface;
} fsl_api_memory_map_entry_t;
//!@brief API initialization data structure
typedef struct fsl_kb_api_parameter_struct
{
uint32_t allocStart;
uint32_t allocSize;
} fsl_kp_api_init_param_t;
//!@brief Memory context structure
typedef struct fsl_memory_context_struct
{
status_t (*flush)(fsl_mem_attribute_t *attr);
fsl_mem_attribute_t *attr;
} fsl_mem_context_t;
/*
* Serial NOR configuration block
*/
typedef struct _fsl_flexspi_nor_config
{
fsl_flexspi_mem_config_t memConfig; //!< Common memory configuration info via FlexSPI
uint32_t pageSize; //!< Page size of Serial NOR
uint32_t sectorSize; //!< Sector size of Serial NOR
uint8_t ipcmdSerialClkFreq; //!< Clock frequency for IP command
uint8_t isUniformBlockSize; //!< Sector/Block size is the same
uint8_t isDataOrderSwapped; //!< Data order (D0, D1, D2, D3) is swapped (D1,D0, D3, D2)
uint8_t reserved0[1]; //!< Reserved for future use
uint8_t serialNorType; //!< Serial NOR Flash type: 0/1/2/3
uint8_t needExitNoCmdMode; //!< Need to exit NoCmd mode before other IP command
uint8_t halfClkForNonReadCmd; //!< Half the Serial Clock for non-read command: true/false
uint8_t needRestoreNoCmdMode; //!< Need to Restore NoCmd mode after IP commmand execution
uint32_t blockSize; //!< Block size
uint32_t flashStateCtx; //!< Flash State Context
uint32_t reserve2[10]; //!< Reserved for future use
} fsl_flexspi_nor_config_t;
//!@brief The API context structure
typedef struct fsl_api_core_context
{
fsl_soc_mem_regions_t memRegions;
fsl_arena_context_t arenaCtx;
fsl_flexspi_nor_config_t flexspinorCfg;
fsl_mem_context_t memCtx;
fsl_ldr_Context_v3_t *sbloaderCtx;
fsl_nboot_context_t *nbootCtx;
uint8_t *sharedBuf;
fsl_api_memory_map_entry_t memEntries[MEM_INTERFACE_COUNT];
} fsl_api_core_context_t;
//!@brief IAP API Interface structure
typedef struct fsl_iap_api_interface_struct
{
fsl_standard_version_t version; //!< IAP API version number.
status_t (*api_init)(fsl_api_core_context_t *coreCtx, const fsl_kp_api_init_param_t *param);
status_t (*api_deinit)(fsl_api_core_context_t *coreCtx);
status_t (*mem_init)(fsl_api_core_context_t *ctx);
status_t (*mem_read)(fsl_api_core_context_t *ctx, uint32_t addr, uint32_t len, uint8_t *buf, uint32_t memoryId);
status_t (*mem_write)(fsl_api_core_context_t *ctx, uint32_t addr, uint32_t len, const uint8_t *buf, uint32_t memoryId);
status_t (*mem_fill)(fsl_api_core_context_t *ctx, uint32_t addr, uint32_t len, uint32_t pattern, uint32_t memoryId);
status_t (*mem_flush)(fsl_api_core_context_t *ctx);
status_t (*mem_erase)(fsl_api_core_context_t *ctx, uint32_t addr, uint32_t len, uint32_t memoryId);
status_t (*mem_config)(fsl_api_core_context_t *ctx, uint32_t *buf, uint32_t memoryId);
status_t (*mem_erase_all)(fsl_api_core_context_t *ctx, uint32_t memoryId);
status_t (*fsl_sbloader_init)(fsl_api_core_context_t *ctx);
status_t (*fsl_sbloader_pump)(fsl_api_core_context_t *ctx, uint8_t *data, uint32_t length);
status_t (*fsl_sbloader_finalize)(fsl_api_core_context_t *ctx);
} fsl_iap_api_interface_t;
//! Function pointer definition for all loader action functions.
// typedef status_t (*fsl_pLdrFnc_v3_t)(ldr_Context_v3_t *);
typedef status_t (*fsl_pLdrFnc_v3_t)(fsl_api_core_context_t *n);
//! Loader context definition.
struct _fsl_ldr_Context_v3
{
fsl_pLdrFnc_v3_t Action; //!< pointer to loader action function
uint32_t block_size; //!< size of each block in bytes
uint32_t block_data_size; //!< data size in bytes (NBOOT_SB3_CHUNK_SIZE_IN_BYTES)
uint32_t block_data_total; //!< data max size in bytes (block_size * data_size
uint32_t block_buffer_size; //!< block0 and block size
uint32_t block_buffer_position;
uint8_t block_buffer[MAX(NBOOT_SB3_MANIFEST_MAX_SIZE_IN_BYTES,
NBOOT_SB3_BLOCK_MAX_SIZE_IN_BYTES)]; //! will be used for both block0 and blockx
uint32_t processedBlocks;
uint8_t data_block_offset; //! data block offset in a block.
bool in_data_block; //!< in progress of handling a data block within a block
uint8_t *data_block;
uint32_t data_block_position;
bool in_data_section; //!< in progress of handling a data section within a data block
uint32_t data_section_handled;
fsl_sb3_section_header_t data_section_header;
bool in_data_range; //!< in progress of handling a data range within a data section
uint32_t data_range_handled;
uint32_t data_range_gap;
fsl_sb3_data_range_header_t data_range_header;
bool has_data_range_expansion;
fsl_sb3_data_range_expansion_t data_range_expansion;
uint32_t commandSet; //!< support command set during sb file handling
uint32_t data_position;
uint8_t data_buffer[SB3_DATA_BUFFER_SIZE_IN_BYTE]; //!< temporary data buffer
uint32_t fuse_cmd_position;
uint8_t fuse_cmd_buffer[32 * 4]; //!< used for fuse command
};
#if defined(__cplusplus)
extern "C" {
#endif // __cplusplus
#if defined(__cplusplus)
}
#endif // __cplusplus
#define BIT0 (1UL << 0U)
void power_on_device_impl(LOAD_Target_Type loadTarget);
void power_off_device_impl(LOAD_Target_Type loadTarget);
void reset_device(LOAD_Target_Type loadTarget);
status_t load_service(LOAD_Target_Type loadTarget, uint32_t sourceAddr);
status_t sb3_fw_download_impl(LOAD_Target_Type loadTarget, uint32_t flag, uint32_t sourceAddr);
status_t sb3_fw_reset_impl(LOAD_Target_Type loadTarget, uint32_t flag, uint32_t sourceAddr);
fsl_nboot_status_t nboot_hal_get_sb3_manifest_params(fsl_nboot_context_t *context, fsl_nboot_sb3_load_manifest_parms_t *parms);
status_t loader_process_sb_file(uint32_t readOffset);
status_t fsl_sbloader_init(fsl_api_core_context_t *ctx);
status_t fsl_sbloader_finalize(fsl_api_core_context_t *ctx);
uint8_t get_chip_revision(void);
//! @}
#endif /* __FSL_LOADER_UTILS_H__ */
@@ -0,0 +1,44 @@
/*
* Copyright 2020-2021 NXP
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
*/
#ifndef __LIFE_CYCLE_H__
#define __LIFE_CYCLE_H__
/*******************************************************************************
* Definitions
******************************************************************************/
/*! @brief Life cycle definitions. */
#define LIFECYCLE_NXP_BLANK (0x0u)
#define LIFECYCLE_NXP_DEV_NON_SEC (0xFDu)
#define LIFECYCLE_NXP_DEV_SEC (0xFEu)
#define LIFECYCLE_NXP_PROVISIONED (0x1u)
#define LIFECYCLE_OEM_OPEN (0x3u)
#define LIFECYCLE_OEM_SECURE (0x7u)
#define LIFECYCLE_OEM_CLOSED (0xFu)
#define LIFECYCLE_OEM_FIELD_RETURN (0x1Fu)
#define LIFECYCLE_NXP_FIELD_RETURN (0x3Fu)
#define LIFECYCLE_OEM_LOCKED (0xCFu)
#define LIFECYCLE_SHREDDED (0xFFu)
#define DIS_ROM_HIDIND_MASK (0xF00000u)
#define DIS_ROM_HIDIND_SHIFT (20u)
/*******************************************************************************
* Variables
******************************************************************************/
/*******************************************************************************
* API
******************************************************************************/
uint32_t get_lifecycle_state(void);
#endif
@@ -0,0 +1,40 @@
/*
* Copyright 2020-2021 NXP
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef __NBOOT_ROM_API_TABLE_H__
#define __NBOOT_ROM_API_TABLE_H__
typedef int romapi_status_t;
typedef struct
{
romapi_status_t (*nboot_rsvd0)(void);
fsl_nboot_status_t (*nboot_context_init)(fsl_nboot_context_t *context);
fsl_nboot_status_t (*nboot_context_deinit)(fsl_nboot_context_t *context);
fsl_nboot_status_protected_t (*nboot_sb3_load_manifest)(fsl_nboot_context_t *context,
uint32_t *manifest,
fsl_nboot_sb3_load_manifest_parms_t *parms);
fsl_nboot_status_protected_t (*nboot_sb3_load_block)(fsl_nboot_context_t *context, uint32_t *block);
fsl_nboot_status_protected_t (*nboot_rsvd1)(void);
fsl_nboot_status_protected_t (*nboot_rsvd2)(void);
} nboot_interface_v0_t;
typedef struct
{
romapi_status_t (*romapi_rng_generate_random)(uint8_t *output, size_t outputByteLen);
fsl_nboot_status_t (*nboot_context_init)(fsl_nboot_context_t *context);
fsl_nboot_status_t (*nboot_context_deinit)(fsl_nboot_context_t *context);
fsl_nboot_status_protected_t (*nboot_sb3_load_manifest)(fsl_nboot_context_t *context,
uint32_t *manifest,
fsl_nboot_sb3_load_manifest_parms_t *parms);
fsl_nboot_status_protected_t (*nboot_sb3_load_block)(fsl_nboot_context_t *context, uint32_t *block);
fsl_nboot_status_protected_t (*nboot_img_authenticate_ecdsa)(fsl_nboot_context_t *context,
uint8_t imageStartAddress[],
fsl_nboot_bool_t *isSignatureVerified,
fsl_nboot_img_auth_ecdsa_parms_t *parms);
} nboot_interface_v1_t;
#endif /* _NBOOT_ROM_API_TABLE_H_ */
@@ -0,0 +1,42 @@
/*
* Copyright 2020 - 2021 NXP
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
*/
#include <stdint.h>
#include <stdbool.h>
#include "life_cycle.h"
#include "fusemap.h"
/*******************************************************************************
* Definitions
******************************************************************************/
/*******************************************************************************
* Prototype
******************************************************************************/
/*******************************************************************************
* Variables
******************************************************************************/
/*******************************************************************************
* Codes
******************************************************************************/
uint32_t get_lifecycle_state(void)
{
uint32_t lifeCycleStateOtpShadow = OTP_LCS_FUSE_VALUE();
uint32_t lifeCycleStateRedundantOtpShadow = OTP_LCS_REDUNDANT_FUSE_VALUE();
if (lifeCycleStateOtpShadow != lifeCycleStateRedundantOtpShadow)
{
while (true)
{
; /* No necessary actions. */
}
}
return ((lifeCycleStateOtpShadow & OTP_LCS_FUSE_MASK) >> OTP_LCS_FUSE_SHIFT);
}
@@ -0,0 +1,304 @@
/*
* Copyright 2020 - 2021,2024 NXP
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
*/
#include <limits.h>
#include "fusemap.h"
#include "fsl_loader_utils.h"
#include "life_cycle.h"
#include "fsl_ocotp.h"
/*******************************************************************************
* Definitions
******************************************************************************/
#define NBOOT_HAL_PRINTF(...)
/*******************************************************************************
* Prototype
******************************************************************************/
/*!
* @brief Get the root security parameters.
*
* Read the root security configurations from OTP.
*
* @param context NBOOT context.
* @param parms Root security parameters.
* @retval kStatus_NBOOT_Fail Operate successfully.
* @retval kStatus_NBOOT_InvalidArgument Invalid values of the parms
* @retval kStatus_NBOOT_Fail Failed to operate.
*/
static fsl_nboot_status_t nboot_hal_get_root_auth_parms(fsl_nboot_context_t *context, fsl_nboot_rot_auth_parms_t *parms);
/*!
* @brief Get the ROTK revoke settings.
*
* Read the OTP_ROTK_REVOKE.
*
* @param rotkRevoke ROTK revoke state.
* @param rotkCnt ROTK count.
* @retval kStatus_NBOOT_Fail Operate successfully.
* @retval kStatus_NBOOT_Fail Failed to operate.
*/
static inline fsl_nboot_status_t nboot_hal_get_rotk_revoke(fsl_nboot_root_key_revocation_t *rotkRevoke, uint32_t rotkCnt);
/*!
* @brief Get the ROTKH.
*
* Read the IFR_ROTKH.
*
* @param rotkh ROTKH value.
* @param rotkhSize ROTKH size in bytes.
* @retval kStatus_NBOOT_Fail Operate successfully.
* @retval kStatus_NBOOT_Fail Failed to operate.
*/
static fsl_nboot_status_t nboot_hal_get_rotkh(uint32_t *rotkh, uint32_t rotkhSize);
/*!
* @brief Get the type of the root keys.
*
* Get the root key type
*
* @param rootKeyType Type of the root keys.
* @retval kStatus_NBOOT_Fail Operate successfully.
* @retval kStatus_NBOOT_Fail Failed to operate.
*/
static inline fsl_nboot_status_t nboot_hal_get_root_key_type(fsl_nboot_root_key_type_and_length_t *rootKeyType);
/*!
* @brief Get the Part Common Key(PCK).
*
* Read the IFR_PCK_BLOB.
*
* @param pckBlob PCK blob.
* @param pckBlobSize PCK blob size in byte.
* @retval kStatus_NBOOT_Fail Operate successfully.
* @retval kStatus_NBOOT_Fail Failed to operate.
*/
static inline fsl_nboot_status_t nboot_hal_get_pck_blob(uint8_t *pckBlob, uint32_t pckBlobSize);
/*******************************************************************************
* Codes
******************************************************************************/
static inline uint32_t set_antipole(uint32_t value)
{
return (value & 0xFFFFu) | (~(value & 0xFFFFu) << 16);
}
static fsl_nboot_status_t nboot_hal_get_root_auth_parms(fsl_nboot_context_t *context, fsl_nboot_rot_auth_parms_t *parms)
{
if ((NULL == context) || (NULL == parms))
{
return kStatus_NBOOT_InvalidArgument;
}
fsl_nboot_status_t status = kStatus_NBOOT_Fail;
do
{
status =
nboot_hal_get_rotk_revoke(&parms->soc_rootKeyRevocation[0],
sizeof(parms->soc_rootKeyRevocation) / sizeof(parms->soc_rootKeyRevocation[0]));
if (status != kStatus_NBOOT_Success)
{
break;
}
status = nboot_hal_get_rotkh(&parms->soc_rkh[0], sizeof(parms->soc_rkh));
if (status != kStatus_NBOOT_Success)
{
break;
}
parms->soc_numberOfRootKeys = 0u;
parms->soc_rootKeyUsage[1] = kNBOOT_RootKeyUsage_Unused;
parms->soc_rootKeyUsage[2] = kNBOOT_RootKeyUsage_Unused;
parms->soc_rootKeyUsage[3] = kNBOOT_RootKeyUsage_Unused;
for (size_t i = 0; i < (sizeof(parms->soc_rootKeyUsage) / sizeof(parms->soc_rootKeyUsage[0])); i++)
{
if ((parms->soc_rootKeyUsage[i] & OTP_ROTK0_USAGE_FUSE_MASK) != kNBOOT_RootKeyUsage_Unused)
{
parms->soc_numberOfRootKeys++;
}
}
status = nboot_hal_get_root_key_type(&parms->soc_rootKeyTypeAndLength);
if (status != kStatus_NBOOT_Success)
{
break;
}
parms->soc_lifecycle = (fsl_nboot_soc_lifecycle_t)set_antipole(get_lifecycle_state());
status = kStatus_NBOOT_Success;
} while (false);
if (status != kStatus_NBOOT_Success)
{
(void)memset(parms, 0, sizeof(*parms));
}
return status;
}
static inline fsl_nboot_status_t nboot_hal_get_rotk_revoke(fsl_nboot_root_key_revocation_t *rotkRevoke, uint32_t rotkCnt)
{
/* No need to check the input arguments for this inline functions. */
assert(rotkRevoke);
assert(rotkCnt == NBOOT_ROOT_CERT_COUNT);
/* Set all root key to 'revoked' state */
for (uint32_t i = 0u; i < rotkCnt; i++)
{
rotkRevoke[i] = kNBOOT_RootKey_Enabled;
}
return kStatus_NBOOT_Success;
}
static fsl_nboot_status_t nboot_hal_get_rotkh(uint32_t *rotkh, uint32_t rotkhSize)
{
/* No need to check the input arguments for this inline functions. */
assert(rotkh);
assert(rotkhSize == (uint32_t)NBOOT_ROOT_ROTKH_SIZE_IN_BYTE);
fsl_nboot_status_t status = kStatus_NBOOT_Success;
/* root key hash fixed in Flash memory */
#ifdef USE_ENG_CERTIFICATE
rotkh[0] = 0xd0cfb419U;
rotkh[1] = 0x4037ee3cU;
rotkh[2] = 0xde74393eU;
rotkh[3] = 0x0156d0a3U;
rotkh[4] = 0x373b8677U;
rotkh[5] = 0x6b6aee3dU;
rotkh[6] = 0x619b459eU;
rotkh[7] = 0xfa33f31dU;
rotkh[8] = 0x00000000U;
rotkh[9] = 0x00000000U;
rotkh[10] = 0x00000000U;
rotkh[11] = 0x00000000U;
#else
if ((get_chip_revision() == 0U))
{
rotkh[0] = 0x60DFBEE6U;
rotkh[1] = 0x8799305FU;
rotkh[2] = 0xBA9E4AE6U;
rotkh[3] = 0x1908394FU;
rotkh[4] = 0x7AC4F934U;
rotkh[5] = 0xEF76BF41U;
rotkh[6] = 0x2E27796EU;
rotkh[7] = 0x94DB19A0U;
rotkh[8] = 0x00000000U;
rotkh[9] = 0x00000000U;
rotkh[10] = 0x00000000U;
rotkh[11] = 0x00000000U;
}
else if ((get_chip_revision() == 1U))
{
rotkh[0] = 0x9C758C58U;
rotkh[1] = 0x0A5CCEAAU;
rotkh[2] = 0x850DAD41U;
rotkh[3] = 0x1371EEBAU;
rotkh[4] = 0xB7874851U;
rotkh[5] = 0x53C5BA44U;
rotkh[6] = 0xF236F964U;
rotkh[7] = 0x3320ECDFU;
rotkh[8] = 0x00000000U;
rotkh[9] = 0x00000000U;
rotkh[10] = 0x00000000U;
rotkh[11] = 0x00000000U;
}
else if ((get_chip_revision() == 2U))
{
rotkh[0] = 0xE7C7E9BBU;
rotkh[1] = 0x12C8C535U;
rotkh[2] = 0x37E61148U;
rotkh[3] = 0x2BE7F18CU;
rotkh[4] = 0x8F0E3094U;
rotkh[5] = 0xB2BA7F32U;
rotkh[6] = 0xEC9B4ECBU;
rotkh[7] = 0xAD9FC941U;
rotkh[8] = 0x00000000U;
rotkh[9] = 0x00000000U;
rotkh[10] = 0x00000000U;
rotkh[11] = 0x00000000U;
}
else
{
; /* none to do */
}
#endif
return status;
}
static inline fsl_nboot_status_t nboot_hal_get_root_key_type(fsl_nboot_root_key_type_and_length_t *rootKeyType)
{
/* No need to check the input arguments for this inline functions. */
assert(rootKeyType);
*rootKeyType = kNBOOT_RootKey_Ecdsa_P256;
return kStatus_NBOOT_Success;
}
static inline fsl_nboot_status_t nboot_hal_get_pck_blob(uint8_t *pckBlob, uint32_t pckBlobSize)
{
/* No need to check the input arguments for this inline functions. */
assert(pckBlob);
assert(pckBlobSize == (uint32_t)NBOOT_PCK_BLOB_SIZE_IN_BYTE);
fsl_nboot_status_t status = kStatus_NBOOT_Fail;
status_t otpStatus = kStatus_Fail;
do
{
uint32_t fuseIdxStart = OTP_NXP_WIFI_SK_MK_31_0_FUSE_IDX;
for (int i = 0; i < (NBOOT_PCK_BLOB_SIZE_IN_BYTE / 4); i++)
{
otpStatus = OCOTP_OtpFuseRead(fuseIdxStart, (uint32_t *)(&pckBlob[4 * i]));
if (otpStatus != kStatus_Success)
{
return kStatus_NBOOT_Fail;
}
++fuseIdxStart;
}
status = kStatus_NBOOT_Success;
} while (false);
return status;
}
fsl_nboot_status_t nboot_hal_get_sb3_manifest_params(fsl_nboot_context_t *context, fsl_nboot_sb3_load_manifest_parms_t *parms)
{
if ((NULL == context) || (NULL == parms))
{
return kStatus_NBOOT_InvalidArgument;
}
fsl_nboot_status_t status = kStatus_NBOOT_Fail;
do
{
status = nboot_hal_get_root_auth_parms(context, &parms->soc_RoTNVM);
if (status != kStatus_NBOOT_Success)
{
break;
}
status = nboot_hal_get_pck_blob(&parms->pckBlob[0], sizeof(parms->pckBlob));
if (status != kStatus_NBOOT_Success)
{
break;
}
status = kStatus_NBOOT_Success;
} while (false);
if (status != kStatus_NBOOT_Success)
{
(void)memset(parms, 0, sizeof(*parms));
}
return status;
}
@@ -0,0 +1,38 @@
1.Examples that support monolithic image download do not need the steps 2-6 to load fw:
Wi-Fi examples: wifi_cli, wifi_wpa_supplicant, wifi_cli_static, wifi_cert, wifi_cli_fw_dump, wifi_cli_prov, wifi_test_mode
ncp examples: ncp_device
coex examples: coex_cli, coex_supplicant_cli
These examples can load cpu1/2 fw automatically, don't need to load them seperatly.
2. FW image names:
Production FW, for users:
rw61x_sb_wifi_a2.bin, for CPU1_wifi of redfinch a2 board
rw61x_sb_ble_a2.bin, for CPU2_ble of redfinch a2 board
rw61x_sb_ble_15d4_combo_a2.bin, for CPU2_ble_15.4_combo of redfinch a2 board
3. where to get FW image(Production and mfg_FW):
In the directory: /components/conn_fwloader/fw_bin
4. How to load FW(Production and mfg_FW):
Need to write the FW image to flash first, then the loadservice will download FW when power on.
For example, the CMD to write CPU1 image to flash in J-link window:
loadbin C:\xxx\rw61x_sb_wifi_xx.bin,0x08400000
The CMD to write CPU2_ble image to flash in J-link window:
loadbin C:\xxx\rw61x_sb_ble_xx.bin,0x08540000
The CMD to write CPU2_15.4 image to flash in J-link window:
loadbin C:\xxx\rw61x_sb_ble_15d4_combo_xx.bin,0x085e0000
5. How to generate the C files to be compiled in the monolithic binary:
In a shell go to directory /components/conn_fwloader. Enter the following command:
'python script/fw_bin2c_conv.py -t sb fw_bin'
or 'python script/fw_bin2c_conv.py -t raw fw_bin':
This results in generating the C files under fw_bin/A1 and fw_bin/A2 subdirectories.
6. Remap mechanism support
Whenever the remap feature is active, the flash should not be accessed in direct mode.
As a consequence, no structure cast should be done on flash direct addresses. Likewise memcpy operations
should be avoided. Instead all flash accesses must be done via staging buffers in RAM, that
get loaded using the mflash driver.
@@ -0,0 +1,144 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2022-2023 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
#ifndef COMPILER_TOOLCHAIN_H_
#define COMPILER_TOOLCHAIN_H_
/* for armclang */
#if defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
#define CSS_IDATA_SEGMENT __attribute__((section("CSS_IDATA_SEGMENT")))
#define CSS_CONST_SEGMENT __attribute__((section("CSS_CONST_SEGMENT_SECTION")))
#define MCUX_FUP_ATTRIBUTE __attribute__((aligned(4))) __attribute__((section("MCUX_OBFUSCATED_FUP_SEGMENT")))
#define UNUSED_PARAM __attribute__((unused))
/*
Use of UNALIGNED on ARMCLANG
The __unaligned keyword is a type qualifier that tells the compiler to treat the pointer or variable as an unaligned pointer or variable.
www.keil.com/support/man/docs/armclang_ref/armclang_ref_pfl1493130433688.htm
The use of __attribute__((packed)) is incorrect on ARMCLANG
The packed type attribute specifies that a type must have the smallest possible alignment. This attribute only applies to struct and union types.
www.keil.com/support/man/docs/armclang_ref/armclang_ref_chr1393328521340.htm
-munaligned-access is the default for architectures that support unaligned accesses to data. This default applies to all architectures supported by Arm Compiler for Embedded 6, except Armv6-M, and Armv8-M without the Main Extension.
*/
#define UNALIGNED __unaligned
#define MCUX_CSSL_UNUSED(p) ((void) (p))
/* Macro for alligning buffers to cpu word */
#define ALIGNED __attribute__((aligned(4)))
/* using the gcc toolchain file for both gcc and armgcc */
#elif defined ( __GNUC__ )
#define CSS_IDATA_SEGMENT
#define CSS_CONST_SEGMENT
#define MCUX_FUP_ATTRIBUTE __attribute__((aligned(4)))
#define UNUSED_PARAM __attribute__((unused))
#define UNALIGNED
/* Macro for alligning buffers to cpu word */
#define ALIGNED __attribute__((aligned(4)))
/* for armcc compiler */
#elif defined ( __CC_ARM )
#define CSS_IDATA_SEGMENT __attribute__((section("CSS_IDATA_SEGMENT")))
#define CSS_CONST_SEGMENT __attribute__((section("CSS_CONST_SEGMENT")))
#define MCUX_FUP_ATTRIBUTE __attribute__((aligned(4))) __attribute__((section("MCUX_OBFUSCATED_FUP_SEGMENT")))
#define UNUSED_PARAM __attribute__((unused))
#define UNALIGNED __packed
/* Macro for alligning buffers to cpu word */
#define ALIGNED __attribute__((aligned(4)))
/* for ghs compiler */
#elif defined ( __ghs__ )
#define CSS_IDATA_SEGMENT
#define CSS_CONST_SEGMENT
#define MCUX_FUP_ATTRIBUTE __attribute__((aligned(4)))
#define UNUSED_PARAM __attribute__((unused))
#define UNALIGNED
/* Macro for alligning buffers to cpu word */
#define ALIGNED __attribute__((aligned(4)))
/* for iar compiler */
#elif defined ( __ICCARM__ )
#define CSS_IDATA_SEGMENT __attribute__((section("CSS_IDATA_SEGMENT")))
#define CSS_CONST_SEGMENT __attribute__((section("CSS_CONST_SEGMENT")))
#define MCUX_FUP_ATTRIBUTE __attribute__((aligned(4))) __attribute__((section(".mcux_obfuscated_fup_segment")))
#define UNUSED_PARAM __attribute__((unused))
#define UNALIGNED __packed
/* Macro for alligning buffers to cpu word */
#define ALIGNED __attribute__((aligned(4)))
/* for llvm */
#elif defined ( __clang__ )
#define CSS_IDATA_SEGMENT
#define CSS_CONST_SEGMENT
#define MCUX_FUP_ATTRIBUTE __attribute__((aligned(4)))
#define UNUSED_PARAM __attribute__((unused))
#define UNALIGNED
/* Macro for alligning buffers to cpu word */
#define ALIGNED __attribute__((aligned(4)))
#endif
#if defined(__ghs__) || defined( __ICCARM__ ) || (defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) || defined(__GNUC__)
#define GHS_ICCARM_ARMCC_GT_10_5_GNUC
#endif
#if defined(__ghs__) || defined(__gcc__) || defined(__ICCARM__) || defined(__GNUC__)
#define GHS_GCC_ICCARM_GNUC
#endif
#if defined(__ghs__) || defined(__gcc__) || defined(__ICCARM__)
#define GHS_GCC_ICCARM
#endif
#if defined(__ICCARM__) || defined(__ARMCC_VERSION) || defined(__CC_ARM) || defined(__GNUC__)
#define ICCARM_ARMCC_GNUC
#endif
#if defined(__ICCARM__) || defined(__ARMCC_VERSION) || defined(__GNUC__)
#define ICCARM_ARMCLANG_GNUC
#endif
#if defined (__ARMCC_VERSION) && (__ARMCC_VERSION < 6010050)
#define ARMCC_LT_10_5 //6.01 build 0050
#endif
#if defined ( __CC_ARM )
/* Arm Compiler 4/5 */
#define MCUX_CL_COMPILER_ARMCC
#define MCUX_CL_COMPILER_ARM_COMPILER
#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) && (__ARMCC_VERSION < 6100100)
/* Arm Compiler 6.6 LTM (armclang) */
#define MCUX_CL_COMPILER_ARMCLANG_LTM
#define MCUX_CL_COMPILER_ARM_COMPILER
#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6100100)
/* Arm Compiler above 6.10.1 (armclang) */
#define MCUX_CL_COMPILER_ARMCLANG
#define MCUX_CL_COMPILER_ARM_COMPILER
#elif defined (_clang_)
#define MCUX_CL_COMPILER_ARM_COMPILER /* i.e. Version 6.01 build 0019 */
#endif
#if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && !defined(inline) && !defined(__cplusplus)
#define ARMCC_MSC_VER_NOT_INLINE_NOT_CPP
#endif
#endif /* COMPILER_TOOLCHAIN_H_ */
@@ -0,0 +1,46 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2023 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/**
* \file mcuxClBuffer_Internal.h
* \brief Internal functions of the mcuxClBuffer component
*/
#ifndef MCUXCLBUFFER_INTERNAL_H_
#define MCUXCLBUFFER_INTERNAL_H_
#include <mcuxClCore_Platform.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Include the configuration for the buffer types. */
#include <mcuxClBuffer_Cfg.h>
/* Include the selected implementation of the buffer types. */
#if defined(MCUXCLBUFFER_USE_OBJECT) && (1 == MCUXCLBUFFER_USE_OBJECT)
# include <internal/mcuxClBuffer_Internal_Object.h>
#elif defined(MCUXCLBUFFER_USE_POINTER) && (1 == MCUXCLBUFFER_USE_POINTER)
# include <internal/mcuxClBuffer_Internal_Pointer.h>
#else
# error "No buffer type implementation found/configured."
#endif
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* MCUXCLBUFFER_INTERNAL_H_ */
@@ -0,0 +1,310 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2022-2023 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/**
* \file mcuxClBuffer_Internal_Pointer.h
* \brief Provides the internal API & implementation for the plain C pointer buffer types.
*/
#ifndef MCUXCLBUFFER_INTERNAL_POINTER_H_
#define MCUXCLBUFFER_INTERNAL_POINTER_H_
#include <mcuxClToolchain.h>
#include <mcuxClCore_Platform.h>
#include <mcuxClBuffer.h>
#include <mcuxClBuffer_Pointer.h>
#include <mcuxCsslDataIntegrity.h>
#include <mcuxClMemory_Copy.h>
#include <internal/mcuxClMemory_Copy_Internal.h>
#include <internal/mcuxClMemory_CopyWords_Internal.h>
#include <mcuxClMemory_Copy_Reversed.h>
#include <internal/mcuxClMemory_CopySecure_Internal.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* \defgroup clBufferUsage Buffer read/write functionality
* \brief Buffer read/write functionality.
* \ingroup mcuxClBuffer
*/
/* TODO CLNS-10260: finalize the implementation and especially update all the memory functions that are called from here, once CLNS-9401 is finished.
* Appropriate memory functions should be called, to properly handle the security and the different cases of length/alignment (e.g. length being a multiple of 4 or power of 2).
*/
/**
* \brief Writes the pointer of \p bufSrc plus the \p offset in \p ppDest.
*
* \param bufSrc Input buffer
* \param offset Offset of the input buffer
* \param bufCpuWa Not used
* \param ppDest Pointer to the address where the result is written to
* \param byteLength Not used
*
* \return Status of the operation.
*/
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClBuffer_inputBufferToCPU)
static inline MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClBuffer_Status_t) mcuxClBuffer_inputBufferToCPU(mcuxCl_InputBuffer_t bufSrc, uint32_t offset, uint8_t *bufCpuWa UNUSED_PARAM, const uint8_t **ppDest, uint32_t byteLength UNUSED_PARAM)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClBuffer_inputBufferToCPU);
*ppDest = (const uint8_t *)bufSrc + offset;
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClBuffer_inputBufferToCPU, MCUXCLBUFFER_STATUS_OK);
}
/**
* \brief Perform a read from the buffer
*
* \param bufSrc Input buffer from which the data shall be read.
* \param offset Offset into the buffer at which the read operation shall start.
* \param pDst Pointer to the memory location where the data will be stored.
* \param byteLength Amount of bytes that will be read.
* \return Status of the operation.
*/
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClBuffer_read)
static inline MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClBuffer_Status_t) mcuxClBuffer_read(mcuxCl_InputBuffer_t bufSrc, uint32_t offset, uint8_t *pDst, uint32_t byteLength)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClBuffer_read);
MCUX_CSSL_DI_EXPUNGE(memCpyParams, ((uint32_t) pDst) + ((uint32_t) bufSrc) + byteLength + offset);
MCUX_CSSL_FP_FUNCTION_CALL(copy_status ,mcuxClMemory_copy_int(pDst, &bufSrc[offset], byteLength));
if(MCUXCLMEMORY_STATUS_OK != copy_status)
{
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClBuffer_read, MCUXCLBUFFER_STATUS_FAULT);
}
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClBuffer_read, MCUXCLBUFFER_STATUS_OK,
MCUX_CSSL_FP_FUNCTION_CALLED(mcuxClMemory_copy_int)
);
}
/**
* \brief Perform a word-wise read from the buffer
*
* \param bufSrc Input buffer from which the data shall be read.
* \param offset Offset into the buffer at which the read operation shall start.
* \param pDst Pointer to the memory location where the data will be stored.
* \param byteLength Amount of bytes that will be read.
* \return Status of the operation.
*/
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClBuffer_read_word)
static inline MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClBuffer_Status_t) mcuxClBuffer_read_word(mcuxCl_InputBuffer_t bufSrc, uint32_t offset, uint8_t *pDst, uint32_t byteLength)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClBuffer_read_word);
MCUX_CSSL_DI_EXPUNGE(memCpyParams, ((uint32_t) pDst) + ((uint32_t) bufSrc) + byteLength + offset);
MCUX_CSSL_FP_FUNCTION_CALL(copy_status, mcuxClMemory_copy_words_int(pDst, &bufSrc[offset], byteLength));
if(MCUXCLMEMORY_STATUS_OK != copy_status)
{
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClBuffer_read_word, MCUXCLBUFFER_STATUS_FAULT);
}
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClBuffer_read_word, MCUXCLBUFFER_STATUS_OK,
MCUX_CSSL_FP_FUNCTION_CALLED(mcuxClMemory_copy_words_int)
);
}
/**
* \brief Perform an read with endianess reversal from the buffer
*
* \param bufSrc Input buffer from which the data shall be read.
* \param offset Offset into the buffer at which the read operation shall start.
* \param pDst Pointer to the memory location where the data will be stored.
* \param byteLength Amount of bytes that will be read.
* \return Status of the operation.
*/
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClBuffer_read_reverse)
static inline MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClBuffer_Status_t) mcuxClBuffer_read_reverse(mcuxCl_InputBuffer_t bufSrc, uint32_t offset, uint8_t *pDst, uint32_t byteLength)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClBuffer_read_reverse);
MCUXCLMEMORY_FP_MEMORY_COPY_REVERSED(pDst, &bufSrc[offset], byteLength);
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClBuffer_read_reverse, MCUXCLBUFFER_STATUS_OK,
MCUX_CSSL_FP_FUNCTION_CALLED(mcuxClMemory_copy_reversed));
}
/**
* \brief Perform a secure read from the buffer
*
* \param bufSrc Input buffer from which the data shall be read.
* \param offset Offset into the buffer at which the read operation shall start.
* \param pDst Pointer to the memory location where the data will be stored.
* \param byteLength Amount of bytes that will be read.
* \return Status of the operation.
*/
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClBuffer_read_secure)
static inline MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClBuffer_Status_t) mcuxClBuffer_read_secure(mcuxCl_InputBuffer_t bufSrc, uint32_t offset, uint8_t *pDst, uint32_t byteLength)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClBuffer_read_secure);
MCUXCLMEMORY_FP_MEMORY_COPY(pDst, &bufSrc[offset], byteLength);
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClBuffer_read_secure, MCUXCLBUFFER_STATUS_OK,
MCUX_CSSL_FP_FUNCTION_CALLED(mcuxClMemory_copy));
}
/**
* \brief Perform a secure read with endianess reversal from the buffer
*
* \param bufSrc Input buffer from which the data shall be read.
* \param offset Offset into the buffer at which the read operation shall start.
* \param pDst Pointer to the memory location where the data will be stored.
* \param byteLength Amount of bytes that will be read.
* \return Status of the operation.
*/
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClBuffer_read_secure_reverse)
static inline MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClBuffer_Status_t) mcuxClBuffer_read_secure_reverse(mcuxCl_InputBuffer_t bufSrc, uint32_t offset, uint8_t *pDst, uint32_t byteLength)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClBuffer_read_secure_reverse);
MCUXCLMEMORY_FP_MEMORY_COPY_REVERSED(pDst, &bufSrc[offset], byteLength);
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClBuffer_read_secure_reverse, MCUXCLBUFFER_STATUS_OK,
MCUX_CSSL_FP_FUNCTION_CALLED(mcuxClMemory_copy_reversed));
}
/**
* \brief Perform a write to the buffer
*
* \param bufDst Output buffer to which the data shall be written.
* \param offset Offset into the buffer at which the write operation shall start.
* \param pSrc Pointer to the memory location from where the data will be read.
* \param byteLength Amount of bytes that will be written.
* \return Status of the operation.
*/
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClBuffer_write)
static inline MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClBuffer_Status_t) mcuxClBuffer_write(mcuxCl_Buffer_t bufDst, uint32_t offset, const uint8_t *pSrc, uint32_t byteLength)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClBuffer_write);
MCUX_CSSL_DI_EXPUNGE(memCpyParams, ((uint32_t) pSrc) + ((uint32_t) bufDst) + byteLength + offset);
MCUX_CSSL_FP_FUNCTION_CALL(copy_status ,mcuxClMemory_copy_int(&bufDst[offset], pSrc, byteLength));
if(MCUXCLMEMORY_STATUS_OK != copy_status)
{
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClBuffer_write, MCUXCLBUFFER_STATUS_FAULT);
}
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClBuffer_write, MCUXCLBUFFER_STATUS_OK,
MCUX_CSSL_FP_FUNCTION_CALLED(mcuxClMemory_copy_int)
);
}
/**
* \brief Perform a word-wise write to the buffer
*
* \param bufDst Output buffer to which the data shall be written.
* \param offset Offset into the buffer at which the write operation shall start.
* \param pSrc Pointer to the memory location from where the data will be read.
* \param byteLength Amount of bytes that will be written.
* \return Status of the operation.
*/
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClBuffer_write_word)
static inline MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClBuffer_Status_t) mcuxClBuffer_write_word(mcuxCl_Buffer_t bufDst, uint32_t offset, const uint8_t *pSrc, uint32_t byteLength)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClBuffer_write_word);
MCUX_CSSL_DI_EXPUNGE(memCpyParams, ((uint32_t) pSrc) + ((uint32_t) bufDst) + byteLength + offset);
MCUX_CSSL_FP_FUNCTION_CALL(copy_status, mcuxClMemory_copy_words_int(&bufDst[offset], pSrc, byteLength));
if(MCUXCLMEMORY_STATUS_OK != copy_status)
{
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClBuffer_write_word, MCUXCLBUFFER_STATUS_FAULT);
}
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClBuffer_write_word, MCUXCLBUFFER_STATUS_OK,
MCUX_CSSL_FP_FUNCTION_CALLED(mcuxClMemory_copy_words_int)
);
}
/**
* \brief Perform a write with endianess reversal to the buffer
*
* \param bufDst Output buffer to which the data shall be written.
* \param offset Offset into the buffer at which the write operation shall start.
* \param pSrc Pointer to the memory location from where the data will be read.
* \param byteLength Amount of bytes that will be written.
* \return Status of the operation.
*/
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClBuffer_write_reverse)
static inline MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClBuffer_Status_t) mcuxClBuffer_write_reverse(mcuxCl_Buffer_t bufDst, uint32_t offset, const uint8_t *pSrc, uint32_t byteLength)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClBuffer_write_reverse);
MCUXCLMEMORY_FP_MEMORY_COPY_REVERSED(&bufDst[offset], pSrc, byteLength);
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClBuffer_write_reverse, MCUXCLBUFFER_STATUS_OK,
MCUX_CSSL_FP_FUNCTION_CALLED(mcuxClMemory_copy_reversed));
}
/**
* \brief Perform a secure write to the buffer
*
* \param bufDst Output buffer to which the data shall be written.
* \param offset Offset into the buffer at which the write operation shall start.
* \param pSrc Pointer to the memory location from where the data will be read.
* \param byteLength Amount of bytes that will be written.
* \return Status of the operation.
*/
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClBuffer_write_secure)
static inline MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClBuffer_Status_t) mcuxClBuffer_write_secure(mcuxCl_Buffer_t bufDst, uint32_t offset, const uint8_t *pSrc, uint32_t byteLength)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClBuffer_write_secure);
MCUX_CSSL_DI_EXPUNGE(memCpyParams, ((uint32_t) pSrc) + ((uint32_t) bufDst) + byteLength + offset);
MCUX_CSSL_FP_FUNCTION_CALL(copy_status, mcuxClMemory_copy_secure_int(&bufDst[offset], pSrc, byteLength));
if(MCUXCLMEMORY_STATUS_OK != copy_status)
{
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClBuffer_write_secure, MCUXCLBUFFER_STATUS_FAULT);
}
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClBuffer_write_secure, MCUXCLBUFFER_STATUS_OK,
MCUX_CSSL_FP_FUNCTION_CALLED(mcuxClMemory_copy_secure_int));
}
/**
* \brief Perform a secure write with endianess reversal to the buffer
*
* \param bufDst Output buffer to which the data shall be written.
* \param offset Offset into the buffer at which the write operation shall start.
* \param pSrc Pointer to the memory location from where the data will be read.
* \param byteLength Amount of bytes that will be written.
* \return Status of the operation.
*/
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClBuffer_write_secure_reverse)
static inline MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClBuffer_Status_t) mcuxClBuffer_write_secure_reverse(mcuxCl_Buffer_t bufDst, uint32_t offset, const uint8_t *pSrc, uint32_t byteLength)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClBuffer_write_secure_reverse);
MCUXCLMEMORY_FP_MEMORY_COPY_REVERSED(&bufDst[offset], pSrc, byteLength);
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClBuffer_write_secure_reverse, MCUXCLBUFFER_STATUS_OK, MCUX_CSSL_FP_FUNCTION_CALLED(mcuxClMemory_copy_reversed));
}
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* MCUXCLBUFFER_INTERNAL_POINTER_H_ */
@@ -0,0 +1,266 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2022-2024 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/**
* \file mcuxClBuffer.h
* \brief Provides the API for the CL buffer types.
*/
#ifndef MCUXCLBUFFER_H_
#define MCUXCLBUFFER_H_
#include <mcuxClCore_Platform.h>
#include <mcuxClBuffer_Constants.h>
/* Include the actual implementation of the flow protection mechanism. */
#include <mcuxClBuffer_Impl.h>
/**
* \addtogroup mcuxClAPI MCUX CL -- API
*
* \defgroup mcuxClBuffer Buffer API
* \brief CL Buffer types.
* \ingroup mcuxClAPI
*/
/**
* \defgroup clBufInit Buffer initialization functionality
* \brief Buffer initialization functionality.
* \ingroup mcuxClBuffer
*
* Two sets of default buffer initializations are provided, each with
* read-only (RO, for mcuxCl_InputBuffer_t) and read-write (RW, for mcuxCl_Buffer_t)
* variants:
* - Plain: basic CPU copy operations (aligned when possible)
* - DMA: utilizing DMA peripherals
*
* \note The DMA variants will be mapped to plain for buffer implementations
* that do not support DMA operations.
*
* Additionally a custom initializer is provided as well as some aliases
* that can be used as shorthand notation.
*/
/**
* \def MCUXCLBUFFER_INIT
* \brief Initialize an input/output buffer (mcuxCl_Buffer_t).
* \api
* \ingroup clBufInit
*
* This macro is an alias for \p MCUXCLBUFFER_INIT_RW.
*
* \see MCUXCLBUFFER_INIT_RW
*
* \param name the name to be used for the buffer variable
* \param info pointer to a data structure that holds relevant information for the handler
* \param ptr pointer to the memory location of the buffer
* \param size size of the buffer - RFU
*/
#define MCUXCLBUFFER_INIT(name, info, ptr, size) \
MCUXCLBUFFER_INIT_RW(name, info, ptr, size)
/**
* \def MCUXCLBUFFER_INIT_RO
* \brief Initialize an input buffer (mcuxCl_InputBuffer_t) with plain CPU handling.
* \api
* \ingroup clBufInit
*
* This macro can be used to initialize an input buffer that will be handled
* using plain CPU operations.
*
* \param name the name to be used for the buffer variable
* \param info pointer to a data structure that holds relevant information for the handler
* \param ptr pointer to the memory location of the buffer
* \param size size of the buffer - RFU
*/
#define MCUXCLBUFFER_INIT_RO(name, info, ptr, size) \
MCUXCLBUFFER_INIT_PLAIN_RO_IMPL(name, info, ptr, size)
/**
* \def MCUXCLBUFFER_INIT_RW
* \brief Initialize an input/output buffer (mcuxCl_Buffer_t) with plain CPU handling.
* \api
* \ingroup clBufInit
*
* This macro can be used to initialize an input/output buffer that will be
* handled using plain CPU operations.
*
* \param name the name to be used for the buffer variable
* \param info pointer to a data structure that holds relevant information for the handler
* \param ptr pointer to the memory location of the buffer
* \param size size of the buffer - RFU
*/
#define MCUXCLBUFFER_INIT_RW(name, info, ptr, size) \
MCUXCLBUFFER_INIT_PLAIN_RW_IMPL(name, info, ptr, size)
/**
* \def MCUXCLBUFFER_INIT_DMA_RO
* \brief Initialize an input buffer (mcuxCl_InputBuffer_t) with DMA handling.
* \api
* \ingroup clBufInit
*
* This macro can be used to initialize an input buffer that will be handled
* using DMA operations.
*
* \note DMA operations are only supported for object-oriented buffer implementations.
*
* \param name the name to be used for the buffer variable
* \param info pointer to a data structure that holds relevant information for the handler
* \param ptr pointer to the memory location of the buffer
* \param size size of the buffer - RFU
*/
#define MCUXCLBUFFER_INIT_DMA_RO(name, info, ptr, size) \
MCUXCLBUFFER_INIT_DMA_RO_IMPL(name, info, ptr, size)
/**
* \def MCUXCLBUFFER_INIT_DMA_RW
* \brief Initialize an input/output buffer (mcuxCl_Buffer_t) with DMA handling.
* \api
* \ingroup clBufInit
*
* This macro can be used to initialize an input/output buffer that will be
* handled using DMA operations.
*
* \note DMA operations are only supported for object-oriented buffer implementations.
*
* \param name the name to be used for the buffer variable
* \param info pointer to a data structure that holds relevant information for the handler
* \param ptr pointer to the memory location of the buffer
* \param size size of the buffer - RFU
*/
#define MCUXCLBUFFER_INIT_DMA_RW(name, info, ptr, size) \
MCUXCLBUFFER_INIT_DMA_RW_IMPL(name, info, ptr, size)
/**
* \def MCUXCLBUFFER_INIT_DMA
* \brief Initialize an input/output buffer (mcuxCl_Buffer_t) with DMA handling.
* \api
* \ingroup clBufInit
*
* This macro is an alias for \p MCUXCLBUFFER_INIT_RW.
*
* \see MCUXCLBUFFER_INIT_RW
*
* \param name the name to be used for the buffer variable
* \param info pointer to a data structure that holds relevant information for the handler
* \param ptr pointer to the memory location of the buffer
* \param size size of the buffer - RFU
*/
#define MCUXCLBUFFER_INIT_DMA(name, info, ptr, size) \
MCUXCLBUFFER_INIT_DMA_RW(name, info, ptr, size)
/**
* \def MCUXCLBUFFER_INIT_CUSTOM
* \brief Initialize an input/output buffer with custom handler
* \api
* \ingroup clBufInit
*
* This macro can be used to initialize an input/output buffer with a custom
* handler.
*
* \note Custom handlers are only supported for object-oriented buffer
* implementations.
*
* \param name the name to be used for the buffer variable
* \param handler the callback function that will handle the buffer operations
* \param info pointer to a data structure that holds relevant information for the handler
* \param spec specification of the buffer properties
* \param ptr pointer to the memory location of the buffer
* \param size size of the buffer - RFU
*/
#define MCUXCLBUFFER_INIT_CUSTOM(name, handler, info, spec, ptr, size) \
MCUXCLBUFFER_INIT_CUSTOM_IMPL(name, handler, info, spec, ptr, size)
/**
* \defgroup clBufUpdate Buffer manipulation functionality
* \brief Input/output buffer manipulation functionality.
* \ingroup mcuxClBuffer
*/
/**
* \def MCUXCLBUFFER_UPDATE
* \brief Update the buffer pointer with the given offset.
* \api
* \ingroup clBufUpdate
*
* \param name the name of the buffer variable to update.
* \param offset the amount of bytes that the buffer pointer should be moved.
*/
#define MCUXCLBUFFER_UPDATE(name, offset) \
MCUXCLBUFFER_UPDATE_IMPL(name, offset)
/**
* \def MCUXCLBUFFER_DERIVE_RO
* \brief Derive a new input buffer object from an existing one (updated with the given offset).
* \api
* \ingroup clBufUpdate
*
* \param name the name of the buffer variable to create.
* \param original the name of the buffer variable that will be cloned.
* \param offset the amount of bytes that the buffer pointer should be moved.
*/
#define MCUXCLBUFFER_DERIVE_RO(name, original, offset) \
MCUXCLBUFFER_DERIVE_RO_IMPL(name, original, offset)
/**
* \def MCUXCLBUFFER_DERIVE_RW
* \brief Derive a new input/output buffer object from an existing one (updated with the given offset).
* \api
* \ingroup clBufUpdate
*
* \param name the name of the buffer variable to create.
* \param original the name of the buffer variable that will be cloned.
* \param offset the amount of bytes that the buffer pointer should be moved.
*/
#define MCUXCLBUFFER_DERIVE_RW(name, original, offset) \
MCUXCLBUFFER_DERIVE_RW_IMPL(name, original, offset)
/**
* \def MCUXCLBUFFER_SET
* \brief Update the buffer pointer the a new memory location.
* \api
* \ingroup clBufUpdate
*
* \param name the name of the buffer variable to update
* \param ptr pointer to the memory location of the buffer
* \param size size of the buffer - RFU
*/
#define MCUXCLBUFFER_SET(name, ptr, size) \
MCUXCLBUFFER_SET_IMPL(name, ptr, size)
/**
* \def MCUXCLBUFFER_GET
* \brief Get the pointer of the buffer
* \api
* \ingroup clBufUpdate
*
* \param name the name of the buffer variable
*/
#define MCUXCLBUFFER_GET(name) \
MCUXCLBUFFER_GET_IMPL(name)
/**
* \def MCUXCLBUFFER_IS_NULL
* \brief Check the buffer and its pointer against NULL
* \api
* \ingroup clBufUpdate
*
* \param name the name of the buffer variable
*/
#define MCUXCLBUFFER_IS_NULL(name) \
MCUXCLBUFFER_IS_NULL_IMPL(name)
#endif /* MCUXCLBUFFER_H_ */
@@ -0,0 +1,48 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2022-2023 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/**
* \file mcuxClBuffer_Cfg.h
* \brief Configuration of the implementation for the buffer types.
*/
#ifndef MCUXCLBUFFER_CFG_H_
#define MCUXCLBUFFER_CFG_H_
#include <mcuxClCore_Platform.h>
/**
* \addtogroup mcuxClCFG MCUX CL -- Configurations
*
* \defgroup mcuxClBuffer_CFG Buffer Configuration
* \brief Configuration options for the buffer types.
* \ingroup mcuxClCFG
*/
/**
* \def MCUXCLBUFFER_USE_OBJECT
* \brief If set to 1, use the object oriented buffer implementation.
* \ingroup mcuxClBuffer_CFG
*/
#define MCUXCLBUFFER_USE_OBJECT 0
/**
* \def MCUXCLBUFFER_USE_POINTER
* \brief If set to 1, use the plain C pointer buffer implementation.
* \ingroup mcuxClBuffer_CFG
*/
#define MCUXCLBUFFER_USE_POINTER 1
/* Basic configuration sanity check */
#endif /* MCUXCLBUFFER_CFG_H_ */
@@ -0,0 +1,41 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2023 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/** \file mcuxClBuffer_Constants.h
* \brief Constants for use with the mcuxClBuffer component */
#ifndef MCUXCLBUFFER_CONSTANTS_H_
#define MCUXCLBUFFER_CONSTANTS_H_
#include <mcuxClCore_Platform.h>
/**
* \defgroup clBufferConstants Buffer constants
* \brief Buffer constants
* \ingroup mcuxClBuffer
*/
/**
* \brief Buffer status code
*
* This type provides information about the status of the Buffer operation that
* has been performed.
*/
typedef uint32_t mcuxClBuffer_Status_t;
/* Error codes */
#define MCUXCLBUFFER_STATUS_ERROR ((mcuxClBuffer_Status_t) 0x01235330u)
#define MCUXCLBUFFER_STATUS_OK ((mcuxClBuffer_Status_t) 0x01232E03u)
#define MCUXCLBUFFER_STATUS_FAULT ((mcuxClBuffer_Status_t) 0x0123F0F0u)
#endif /* MCUXCLBUFFER_CONSTANTS_H_ */
@@ -0,0 +1,36 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2022-2023 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/**
* \file mcuxClBuffer_Impl.h
* \brief Selection of the implementation for the buffer types.
*/
#ifndef MCUXCLBUFFER_IMPL_H_
#define MCUXCLBUFFER_IMPL_H_
#include <mcuxClCore_Platform.h>
/* Include the configuration for the buffer types. */
#include <mcuxClBuffer_Cfg.h>
/* Include the selected implementation of the buffer types. */
#if defined(MCUXCLBUFFER_USE_OBJECT) && (1 == MCUXCLBUFFER_USE_OBJECT)
# include <mcuxClBuffer_Object.h>
#elif defined(MCUXCLBUFFER_USE_POINTER) && (1 == MCUXCLBUFFER_USE_POINTER)
# include <mcuxClBuffer_Pointer.h>
#else
# error "No buffer type implementation found/configured."
#endif
#endif /* MCUXCLBUFFER_IMPL_H_ */
@@ -0,0 +1,231 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2022-2024 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/**
* \file mcuxClBuffer_Pointer.h
* \brief Provides the implementation for the basic C pointer buffer types.
*/
#ifndef MCUXCLBUFFER_POINTER_H_
#define MCUXCLBUFFER_POINTER_H_
#include <mcuxClCore_Platform.h>
#include <mcuxCsslFlowProtection.h>
/**
* \addtogroup mcuxClAPI MCUX CL -- API
*
* \addtogroup mcuxClBuffer Buffer API
* \brief Essential types and functionality.
* \ingroup mcuxClAPI
*/
/**
* \defgroup clBufferTypes Buffer type definitions
* \brief Types used by the buffer operations.
* \ingroup mcuxClBuffer
*/
/**
* \brief Input buffer type
* \ingroup clBufferTypes
*
* This type provides a pointer to the memory location that should be used to
* read input data from.
*/
typedef const uint8_t * mcuxCl_InputBuffer_t;
/**
* \brief Input/output buffer type
* \ingroup clBufferTypes
*
* This type provides a pointer to the memory location that can be used for
* both reading input data and writing output data.
*/
typedef uint8_t * mcuxCl_Buffer_t;
/**
* \brief Perform a read from the buffer
*
* \param bufSrc Input buffer from which the data shall be read.
* \param offset Offset into the buffer at which the read operation shall start.
* \param pDst Pointer to the memory location where the data will be stored.
* \param byteLength Amount of bytes that will be read.
* \return Status of the operation.
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClBuffer_import)
MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClBuffer_Status_t) mcuxClBuffer_import(mcuxCl_InputBuffer_t bufSrc, uint32_t offset, uint8_t *pDst, uint32_t byteLength);
/**
* \brief Perform a write to the buffer
*
* \param bufDst Output buffer to which the data shall be written.
* \param offset Offset into the buffer at which the write operation shall start.
* \param pSrc Pointer to the memory location from where the data will be read.
* \param byteLength Amount of bytes that will be written.
* \return Status of the operation.
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClBuffer_export)
MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClBuffer_Status_t) mcuxClBuffer_export(mcuxCl_Buffer_t bufDst, uint32_t offset, const uint8_t *pSrc, uint32_t byteLength);
/**
* \def MCUXCLBUFFER_INIT_PLAIN_RO_IMPL
* \brief Initialize an input buffer with plain CPU handling.
* \ingroup clBufInit
*
* This macro can be used to initialize an input buffer that will be handled
* using plain CPU operations.
*
* \param _name the name to be used for the buffer variable
* \param _info unused for the current implementation
* \param _ptr pointer to the memory location of the buffer
* \param _size unused for the current implementation
*/
#define MCUXCLBUFFER_INIT_PLAIN_RO_IMPL(_name, _info, _ptr, _size) \
mcuxCl_InputBuffer_t (_name) = (mcuxCl_InputBuffer_t)(_ptr)
/**
* \def MCUXCLBUFFER_INIT_PLAIN_RW_IMPL
* \brief Initialize an input/output buffer with plain CPU handling.
* \ingroup clBufInit
*
* This macro can be used to initialize an input/output buffer that will be
* handled using plain CPU operations.
*
* \param _name the name to be used for the buffer variable
* \param _info unused for the current implementation
* \param _ptr pointer to the memory location of the buffer
* \param _size unused for the current implementation
*/
#define MCUXCLBUFFER_INIT_PLAIN_RW_IMPL(_name, _info, _ptr, _size) \
mcuxCl_Buffer_t (_name) = (mcuxCl_Buffer_t)(_ptr)
/**
* \def MCUXCLBUFFER_INIT_DMA_RO_IMPL
* \brief DMA handling is not supported. Initialize an input buffer with plain CPU handling.
* \ingroup clBufInit
*
* This buffer implementation does not support DMA handling, so CPU handling is used as a fallback.
* This macro is an alias for \p MCUXCLBUFFER_INIT_PLAIN_RO_IMPL.
*
* \param _name the name to be used for the buffer variable
* \param _info unused for the current implementation
* \param _ptr pointer to the memory location of the buffer
* \param _size unused for the current implementation
*/
#define MCUXCLBUFFER_INIT_DMA_RO_IMPL(_name, _info, _ptr, _size) \
MCUXCLBUFFER_INIT_PLAIN_RO_IMPL(_name, _info, _ptr, _size)
/**
* \def MCUXCLBUFFER_INIT_DMA_RW_IMPL
* \brief DMA handling is not supported. Initialize an input/output buffer with plain CPU handling.
* \ingroup clBufInit
*
* This buffer implementation does not support DMA handling, so CPU handling is used as a fallback.
* This macro is an alias for \p MCUXCLBUFFER_INIT_PLAIN_RW_IMPL.
*
* \param _name the name to be used for the buffer variable
* \param _info unused for the current implementation
* \param _ptr pointer to the memory location of the buffer
* \param _size unused for the current implementation
*/
#define MCUXCLBUFFER_INIT_DMA_RW_IMPL(_name, _info, _ptr, _size) \
MCUXCLBUFFER_INIT_PLAIN_RW_IMPL(_name, _info, _ptr, _size)
/**
* \def MCUXCLBUFFER_INIT_CUSTOM_IMPL
* \brief Usage of custom handler is not supported. Initialize an input/output buffer with plain CPU handling.
* \ingroup clBufInit
*
* This macro is an alias for \p MCUXCLBUFFER_INIT_PLAIN_RW_IMPL.
*
* \param _name the name to be used for the buffer variable
* \param _handler unused for the current implementation
* \param _info unused for the current implementation
* \param _spec unused for the current implementation
* \param _ptr pointer to the memory location of the buffer
* \param _size unused for the current implementation
*/
#define MCUXCLBUFFER_INIT_CUSTOM_IMPL(_name, _handler, _info, _spec, _ptr, _size) \
MCUXCLBUFFER_INIT_PLAIN_RW_IMPL(_name, _info, _ptr, _size)
/**
* \def MCUXCLBUFFER_UPDATE_IMPL
* \brief Update the buffer pointer with the given offset.
* \ingroup clBufUpdate
*
* \param _name the name of the buffer variable to update
* \param _offset the amount of bytes that the buffer pointer should be moved.
*/
#define MCUXCLBUFFER_UPDATE_IMPL(_name, _offset) \
do { (_name) += (_offset); } while(false)
/**
* \def MCUXCLBUFFER_DERIVE_RO_IMPL
* \brief Derive a new input buffer object from an existing one (updated with the given offset).
* \ingroup clBufUpdate
*
* \param _name the name of the buffer variable to create.
* \param _original the name of the buffer variable that will be cloned.
* \param _offset the amount of bytes that the buffer pointer should be moved.
*/
#define MCUXCLBUFFER_DERIVE_RO_IMPL(_name, _original, _offset) \
mcuxCl_InputBuffer_t (_name) = (mcuxCl_InputBuffer_t) &(_original)[_offset]
/**
* \def MCUXCLBUFFER_DERIVE_RW_IMPL
* \brief Derive a new input/output buffer object from an existing one (updated with the given offset).
* \ingroup clBufUpdate
*
* \param _name the name of the buffer variable to create.
* \param _original the name of the buffer variable that will be cloned.
* \param _offset the amount of bytes that the buffer pointer should be moved.
*/
#define MCUXCLBUFFER_DERIVE_RW_IMPL(_name, _original, _offset) \
mcuxCl_Buffer_t (_name) = (mcuxCl_Buffer_t) &(_original)[_offset]
/**
* \def MCUXCLBUFFER_SET_IMPL
* \brief Update the buffer pointer the a new memory location.
* \ingroup clBufUpdate
*
* \param _name the name of the buffer variable to update
* \param _ptr pointer to the memory location of the buffer
* \param _size unused for the current implementation
*/
#define MCUXCLBUFFER_SET_IMPL(_name, _ptr, _size) \
do { (_name) = (_ptr); } while(false)
/**
* \def MCUXCLBUFFER_GET_IMPL
* \brief Get the pointer of the buffer
* \ingroup clBufUpdate
*
* \param _name the name of the buffer variable
*/
#define MCUXCLBUFFER_GET_IMPL(_name) \
(_name)
/**
* \def MCUXCLBUFFER_IS_NULL_IMPL
* \brief Check the buffer pointer against NULL
* \ingroup clBufUpdate
*
* \param _name the name of the buffer variable
*/
#define MCUXCLBUFFER_IS_NULL_IMPL(_name) \
(NULL == MCUXCLBUFFER_GET_IMPL(_name))
#endif /* MCUXCLBUFFER_POINTER_H_ */
@@ -0,0 +1,47 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2023 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/**
* \file mcuxClBuffer.c
* \brief Provides the internal implementation for the plain C pointer buffer types.
*/
#include <mcuxClToolchain.h>
#include <mcuxClCore_Platform.h>
#include <mcuxClBuffer.h>
#include <mcuxCsslDataIntegrity.h>
#include <mcuxCsslFlowProtection.h>
#include <mcuxClCore_FunctionIdentifiers.h>
#include <internal/mcuxClBuffer_Internal.h>
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClBuffer_export)
MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClBuffer_Status_t) mcuxClBuffer_export(mcuxCl_Buffer_t bufDst, uint32_t offset, const uint8_t *pSrc, uint32_t byteLength)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClBuffer_export);
MCUX_CSSL_FP_FUNCTION_CALL(status, mcuxClBuffer_write(bufDst, offset, pSrc, byteLength));
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClBuffer_export, status, MCUX_CSSL_FP_FUNCTION_CALLED(mcuxClBuffer_write));
}
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClBuffer_import)
MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClBuffer_Status_t) mcuxClBuffer_import(mcuxCl_InputBuffer_t bufSrc, uint32_t offset, uint8_t *pDst, uint32_t byteLength)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClBuffer_import);
MCUX_CSSL_FP_FUNCTION_CALL(status, mcuxClBuffer_read(bufSrc, offset, pDst, byteLength));
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClBuffer_import, status, MCUX_CSSL_FP_FUNCTION_CALLED(mcuxClBuffer_read));
}
@@ -0,0 +1,89 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2020-2023 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
#ifndef MCUXCLCORE_EXAMPLES_H_
#define MCUXCLCORE_EXAMPLES_H_
#include <mcuxClCore_Platform.h>
#include <mcuxClCore_Macros.h>
#include <mcuxCsslFlowProtection.h>
/**
* \def MCUXCLEXAMPLE_FUNCTION
* \brief Macro to indicate that the symbol is an example function.
*/
// TODO CLNS-3599: #define MCUXCLEXAMPLE_FUNCTION(_name) uint32_t _name(void)
#define MCUXCLEXAMPLE_FUNCTION(_name) \
MCUX_CSSL_ANALYSIS_START_PATTERN_EXAMPLE_FUNCTION() \
bool _name(void) \
MCUX_CSSL_ANALYSIS_STOP_PATTERN_EXAMPLE_FUNCTION()
/**
* \def MCUXCLEXAMPLE_STATUS_OK
* \brief Example execution completed successfully.
*/
#define MCUXCLEXAMPLE_STATUS_OK true // TODO CLNS-3599: 0xC001C0DEu
/**
* \def MCUXCLEXAMPLE_OK
* \brief Example execution completed successfully.
* \deprecated{Replaced by MCUXCLEXAMPLE_STATUS_OK}
*/
#define MCUXCLEXAMPLE_OK MCUXCLEXAMPLE_STATUS_OK
/**
* \def MCUXCLEXAMPLE_STATUS_ERROR
* \brief Example execution resulted in an unexpected error.
*/
#define MCUXCLEXAMPLE_STATUS_ERROR false // TODO CLNS-3599: 0xEEEEEEEEu
/**
* \def MCUXCLEXAMPLE_ERROR
* \brief Example execution resulted in an unexpected error.
* \deprecated{Replaced by MCUXCLEXAMPLE_STATUS_ERROR}
*/
#define MCUXCLEXAMPLE_ERROR MCUXCLEXAMPLE_STATUS_ERROR
/**
* \def MCUXCLEXAMPLE_STATUS_FAILURE
* \brief Example execution resulted in an expected failure.
*/
#define MCUXCLEXAMPLE_STATUS_FAILURE false // TODO CLNS-3599: 0xFFFFFFFFu
/**
* \def MCUXCLEXAMPLE_FAILURE
* \brief Example execution resulted in an expected failure.
* \deprecated{Replaced by MCUXCLEXAMPLE_STATUS_FAILURE}
*/
#define MCUXCLEXAMPLE_FAILURE MCUXCLEXAMPLE_STATUS_FAILURE
/**
* \brief Assert whether two buffers are equal.
*/
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClCore_assertEqual)
static inline bool mcuxClCore_assertEqual(const uint8_t * const x, const uint8_t * const y, uint32_t length)
{
for (uint32_t i = 0; i < length; ++i)
{
if (x[i] != y[i])
{
return false;
}
}
return true;
}
#endif /* MCUXCLCORE_EXAMPLES_H_ */
@@ -0,0 +1,57 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2023 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/**
* @file mcuxClCore_Macros.h
* @brief Definition of macros.
*
*/
#ifndef MCUXCLCORE_MACROS_H_
#define MCUXCLCORE_MACROS_H_
/* Macro to calculate the rounded down number of words that fit into the specified size */
#define MCUXCLCORE_NUM_OF_WORDS_FLOOR(wordsize, size) \
((size) / (wordsize))
/* Macro to calculate the rounded up number of words needed to fit an object of the specified size */
#define MCUXCLCORE_NUM_OF_WORDS_CEIL(wordsize, size) \
(((size) + (wordsize) - 1u) / (wordsize))
/* Macro to calculate the rounded down number of CPU words that fit into the specified size */
#define MCUXCLCORE_NUM_OF_CPUWORDS_FLOOR(size) \
MCUXCLCORE_NUM_OF_WORDS_FLOOR(sizeof(uint32_t), size)
/* Macro to calculate the rounded up number of CPU words needed to fit an object of the specified size */
#define MCUXCLCORE_NUM_OF_CPUWORDS_CEIL(size) \
MCUXCLCORE_NUM_OF_WORDS_CEIL(sizeof(uint32_t), size)
/* Macro to round up a given size to the nearest multiple of a specified word size */
#define MCUXCLCORE_ALIGN_TO_WORDSIZE(wordsize, size) \
(MCUXCLCORE_NUM_OF_WORDS_CEIL(wordsize, size) * (wordsize))
/* Macro to round up a given size to the nearest multiple of the CPU word size */
#define MCUXCLCORE_ALIGN_TO_CPU_WORDSIZE(size) \
MCUXCLCORE_ALIGN_TO_WORDSIZE(sizeof(uint32_t), size)
/* Macro to calculate the maximum of two values */
#define MCUXCLCORE_MAX(a, b) \
MCUX_CSSL_ANALYSIS_START_SUPPRESS_CONTROLLING_EXPRESSION_IS_INVARIANT("Fixed values are allowed as macro inputs") \
(((a) > (b)) ? (a) : (b)) \
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_CONTROLLING_EXPRESSION_IS_INVARIANT()
/* Macro to calculate the minimum of two values */
#define MCUXCLCORE_MIN(a, b) \
(((a) < (b)) ? (a) : (b))
#endif /* MCUXCLCORE_MACROS_H_ */
@@ -0,0 +1,23 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2021 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
#ifndef MCUXCLCORE_PLATFORM_H_
#define MCUXCLCORE_PLATFORM_H_
#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>
#include <mcuxClConfig.h> // Exported features flags header
#endif /* MCUXCLCORE_PLATFORM_H_ */
@@ -0,0 +1,33 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2022-2023 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
#ifndef MCUXCLCORE_TOOLCHAIN_H_
#define MCUXCLCORE_TOOLCHAIN_H_
#include <mcuxClCore_Platform.h>
#include <mcuxCsslFlowProtection.h>
MCUX_CSSL_FP_FUNCTION_DEF(mcuxCl_Core_Swap64)
static inline uint64_t mcuxCl_Core_Swap64(uint64_t value)
{
return __builtin_bswap64(value);
}
MCUX_CSSL_FP_FUNCTION_DEF(mcuxCl_Core_Swap32)
static inline uint32_t mcuxCl_Core_Swap32(uint32_t value)
{
return __builtin_bswap32(value);
}
#endif /* MCUXCLCORE_TOOLCHAIN_H_ */
@@ -0,0 +1,364 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2020-2023 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/** @file mcuxClEls_Internal.h
* @brief Provide macros for mcuxClEls internal use.
* This header declares internal macros to deduplicate code and support for internal use only. */
#ifndef MCUXCLELS_INTERNAL_H_
#define MCUXCLELS_INTERNAL_H_
#include <mcuxClConfig.h> // Exported features flags header
#include <platform_specific_headers.h>
#include <stdint.h>
#include <stdbool.h>
#include <mcuxCsslFlowProtection.h>
#include <internal/mcuxClEls_Internal_mapping.h>
#include <internal/mcuxClEls_SfrAccess.h>
#include <mcuxCsslAnalysis.h>
#include <mcuxClEls_Common.h>
#include <mcuxClEls_Types.h>
#ifdef __cplusplus
extern "C" {
#endif
/**** ****/
/**** ELS Hardware Abstraction Layer ****/
/**** ****/
/** Asserts the correctness of the supplied parameters*/
#define MCUXCLELS_INPUT_PARAM_CHECK(x_) if((x_)) { return MCUXCLELS_STATUS_SW_INVALID_PARAM; }
#define MCUXCLELS_INPUT_PARAM_CHECK_PROTECTED(funcid, x_) \
do \
{ \
if ((x_)) \
{ \
MCUX_CSSL_FP_FUNCTION_EXIT(funcid, MCUXCLELS_STATUS_SW_INVALID_PARAM); \
} \
MCUX_CSSL_ANALYSIS_START_SUPPRESS_BOOLEAN_TYPE_FOR_CONDITIONAL_EXPRESSION() \
} while (false) \
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_BOOLEAN_TYPE_FOR_CONDITIONAL_EXPRESSION()
#define ELS_CMD_BIG_ENDIAN ((uint8_t) 0x01U) ///< ELS command option specifying big-endian byte order
#define ELS_CMD_LITTLE_ENDIAN ((uint8_t) 0x00U) ///< ELS command option specifying little-endian byte order
// Utility code of mcuxClEls implementation
/** Sets the variable-size input buffer from which the input 0 of the ELS operation will be transferred via DMA. */
static inline void mcuxClEls_setInput0(const uint8_t *pInput, uint32_t inputSize)
{
MCUXCLELS_SFR_WRITE(ELS_DMA_SRC0, (uint32_t) pInput);
MCUXCLELS_SFR_WRITE(ELS_DMA_SRC0_LEN, inputSize);
}
/** Sets the fixed-size input buffer from which the input 0 of the ELS operation will be transferred via DMA. */
static inline void mcuxClEls_setInput0_fixedSize(const uint8_t *pInput)
{
MCUXCLELS_SFR_WRITE(ELS_DMA_SRC0, (uint32_t) pInput);
}
/** Sets the fixed-size input buffer from which the input 1 of the ELS operation will be transferred via DMA. */
static inline void mcuxClEls_setInput1_fixedSize(const uint8_t *pInput)
{
MCUXCLELS_SFR_WRITE(ELS_DMA_SRC1, (uint32_t) pInput);
}
/** Sets the variable-size input buffer from which the input 2 of the ELS operation will be transferred via DMA. */
static inline void mcuxClEls_setInput2(const uint8_t *pInput, uint32_t inputSize)
{
MCUXCLELS_SFR_WRITE(ELS_DMA_SRC2, (uint32_t) pInput);
MCUXCLELS_SFR_WRITE(ELS_DMA_SRC2_LEN, inputSize);
}
/** Sets the fixed-size input buffer from which the input 2 of the ELS operation will be transferred via DMA. */
static inline void mcuxClEls_setInput2_fixedSize(const uint8_t * pInput)
{
MCUXCLELS_SFR_WRITE(ELS_DMA_SRC2, (uint32_t) pInput);
}
/** Sets the variable-size output buffer to which the result of the ELS operation will be transferred via DMA. */
static inline void mcuxClEls_setOutput(uint8_t *pOutput, uint32_t outputSize)
{
MCUXCLELS_SFR_WRITE(ELS_DMA_RES0, (uint32_t) pOutput);
MCUXCLELS_SFR_WRITE(ELS_DMA_RES0_LEN, outputSize);
}
/** Sets the output buffer to which the result of the ELS operation will be transferred via DMA. */
static inline void mcuxClEls_setOutput_fixedSize(uint8_t *pOutput)
{
MCUXCLELS_SFR_WRITE(ELS_DMA_RES0, (uint32_t) pOutput);
}
/** Sets the ELS keystore index 0, for commands that access a single key. */
static inline void mcuxClEls_setKeystoreIndex0(uint32_t index)
{
MCUXCLELS_SFR_WRITE(ELS_KIDX0, index);
}
/** Sets the ELS keystore index 1, for commands that access 2 keys. */
static inline void mcuxClEls_setKeystoreIndex1(uint32_t index)
{
MCUXCLELS_SFR_WRITE(ELS_KIDX1, index);
}
#ifdef MCUXCL_FEATURE_ELS_PUK_INTERNAL
/** Sets the ELS keystore index 2, for commands that access 3 keys. */
static inline void mcuxClEls_setKeystoreIndex2(uint32_t index)
{
MCUXCLELS_SFR_WRITE(ELS_KIDX2, index);
}
#endif /* MCUXCL_FEATURE_ELS_PUK_INTERNAL */
/** Sets the ELS requested key properties, for commands that create a key. */
static inline void mcuxClEls_setRequestedKeyProperties(uint32_t properties)
{
MCUXCLELS_SFR_WRITE(ELS_KPROPIN, properties);
}
/** Starts an ELS command. */
static inline void mcuxClEls_startCommand(uint32_t command, uint32_t cmdcfg0, uint32_t byteOrder)
{
uint32_t ctrl = MCUXCLELS_SFR_FIELD_FORMAT(ELS_CTRL, ELS_CMD, command)
| MCUXCLELS_SFR_FIELD_FORMAT(ELS_CTRL, ELS_START, 1u)
| MCUXCLELS_SFR_FIELD_FORMAT(ELS_CTRL, ELS_EN, 1u)
| MCUXCLELS_SFR_FIELD_FORMAT(ELS_CTRL, BYTE_ORDER, byteOrder);
MCUXCLELS_SFR_WRITE(ELS_CMDCFG0, cmdcfg0);
MCUXCLELS_SFR_WRITE(ELS_CTRL, ctrl);
}
/** Gets a specific field in the given SFR value, according to the given mask and shift value.
* @retval @c value of the requested field in the given ELS SFR value */
static inline uint32_t mcuxClEls_getSfrField(uint32_t sfrValue, uint32_t mask, uint32_t shift)
{
return ((uint32_t)(sfrValue & mask) >> shift);
}
/** Set a specific field in the given SFR value, according to the given mask and shift value.
* The unrelated fields/bits will not be changed */
static inline void mcuxClEls_setSfrField(volatile uint32_t *pSfr, uint32_t value, uint32_t mask, uint32_t shift)
{
MCUX_CSSL_ANALYSIS_START_SUPPRESS_HARDWARE_ACCESS("Sfr offset from address")
/* get the current value of the SFR and clear the bits that will be set */
uint32_t sfrValue = *pSfr & (~mask);
/* set the bits and re-write the full value to the SFR */
*pSfr = sfrValue | (((uint32_t)(value << shift)) & mask);
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_HARDWARE_ACCESS()
}
/** Tests if the ELS is in BUSY state.
* @retval @c true if the ELS is in BUSY state */
static inline bool mcuxClEls_isBusy(void)
{
return (0u != MCUXCLELS_SFR_BITREAD(ELS_STATUS, ELS_BUSY) );
}
/** Macros to access the bit fields for the ELS_STATUS SFR */
#define MCUXCLELS_SFR_STATUS_ELS_BUSY ELS_BUSY
#define MCUXCLELS_SFR_STATUS_ELS_IRQ ELS_IRQ
#define MCUXCLELS_SFR_STATUS_ELS_ERR ELS_ERR
#define MCUXCLELS_SFR_STATUS_PRNG_RDY PRNG_RDY
#define MCUXCLELS_SFR_STATUS_ECDSA_VFY_STATUS ECDSA_VFY_STATUS
#define MCUXCLELS_SFR_STATUS_PPROT PPROT
#define MCUXCLELS_SFR_STATUS_DRBG_ENT_LVL DRBG_ENT_LVL
#define MCUXCLELS_SFR_STATUS_DTRNG_BUSY DTRNG_BUSY
#define MCUXCLELS_SFR_STATUS_ELS_LOCKED ELS_LOCKED
/** Gets a specific field in the ELS_STATUS SFR.
* @param field: Any field name in MCUXCLELS_SFR_STATUS_* */
#define MCUXCLELS_GET_STATUS_FIELD(field) \
mcuxClEls_getSfrField(MCUXCLELS_SFR_READ(ELS_STATUS), MCUXCLELS_SFR_FIELD_MASK(ELS_STATUS, field), MCUXCLELS_SFR_FIELD_SHIFT(ELS_STATUS, field))
/** Macros to access the bit fields for the ELS_CTRL SFR */
#define MCUXCLELS_SFR_CTRL_ELS_EN ELS_EN
#define MCUXCLELS_SFR_CTRL_START ELS_START
#define MCUXCLELS_SFR_CTRL_RESET ELS_RESET
#define MCUXCLELS_SFR_CTRL_CMD ELS_CMD
#define MCUXCLELS_SFR_CTRL_BYTE_ORDER BYTE_ORDER
/** Gets a specific field in the ELS_CTRL SFR.
* @param field: Any field name in MCUXCLELS_SFR_CTRL_* */
#define MCUXCLELS_GET_CTRL_FIELD(field) \
mcuxClEls_getSfrField(MCUXCLELS_SFR_READ(ELS_CTRL), MCUXCLELS_SFR_FIELD_MASK(ELS_CTRL, field), MCUXCLELS_SFR_FIELD_SHIFT(ELS_CTRL, field))
/** Sets a specific field in the ELS_CTRL SFR. The unrelated fields/bits will not be changed
* @param field: Any field name in MCUXCLELS_SFR_CTRL_*
* @param value: The value to set the requested SFR field to */
#define MCUXCLELS_SET_CTRL_FIELD(field, value) \
mcuxClEls_setSfrField(&MCUXCLELS_SFR_READ(ELS_CTRL), (value), MCUXCLELS_SFR_FIELD_MASK(ELS_CTRL, field), MCUXCLELS_SFR_FIELD_SHIFT(ELS_CTRL, field))
/** Macros to access the bit fields for the ELS_CFG SFR */
#define MCUXCLELS_SFR_CFG_ADCTRL ADCTRL
#define MCUXCLELS_SFR_CFG_SHA2_DIRECT SHA2_DIRECT
/** Gets a specific field in the ELS_CFG SFR.
* @param field: Any field name in MCUXCLELS_SFR_CFG_* */
#define MCUXCLELS_GET_CFG_FIELD(field) \
mcuxClEls_getSfrField(MCUXCLELS_SFR_READ(ELS_CFG), MCUXCLELS_SFR_FIELD_MASK(ELS_CFG, field), MCUXCLELS_SFR_FIELD_SHIFT(ELS_CFG, field))
/** Sets a specific field in the ELS_CFG SFR. The unrelated fields/bits will not be changed
* @param field: Any field name in MCUXCLELS_SFR_CFG_*
* @param value: The value to set the requested SFR field to */
#define MCUXCLELS_SET_CFG_FIELD(field, value) \
mcuxClEls_setSfrField(&MCUXCLELS_SFR_READ(ELS_CFG), (value), MCUXCLELS_SFR_FIELD_MASK(ELS_CFG, field), MCUXCLELS_SFR_FIELD_SHIFT(ELS_CFG, field))
/** Macros to access the bit fields for the ELS_ERR_STATUS SFR */
#define MCUXCLELS_SFR_ERR_STATUS_BUS_ERR BUS_ERR
#define MCUXCLELS_SFR_ERR_STATUS_OPN_ERR OPN_ERR
#define MCUXCLELS_SFR_ERR_STATUS_ALG_ERR ALG_ERR
#define MCUXCLELS_SFR_ERR_STATUS_ITG_ERR ITG_ERR
#define MCUXCLELS_SFR_ERR_STATUS_FLT_ERR FLT_ERR
#define MCUXCLELS_SFR_ERR_STATUS_PRNG_ERR PRNG_ERR
#define MCUXCLELS_SFR_ERR_STATUS_ERR_LVL ERR_LVL
#define MCUXCLELS_SFR_ERR_STATUS_DTRNG_ERR DTRNG_ERR
/** Gets a specific field in the ELS_ERR_STATUS SFR.
* @param field: Any field name in MCUXCLELS_SFR_ERR_STATUS_* */
#define MCUXCLELS_GET_ERROR_STATUS_FIELD(field) \
mcuxClEls_getSfrField(MCUXCLELS_SFR_READ(ELS_ERR_STATUS), MCUXCLELS_SFR_FIELD_MASK(ELS_ERR_STATUS, field), MCUXCLELS_SFR_FIELD_SHIFT(ELS_ERR_STATUS, field))
/** Checks if a specific error bit in the ELS_ERR_STATUS SFR is set.
* @retval @c true if the requested ELS error status bit is set */
#define MCUXCLELS_IS_ERROR_BIT_SET(field) \
(1u == MCUXCLELS_GET_ERROR_STATUS_FIELD(field))
/** Macros to access the bit fields for the ELS_CMDCRC_CTRL SFR */
#define MCUXCLELS_SFR_CMDCRC_CTRL_CMDCRC_RST CMDCRC_RST
#define MCUXCLELS_SFR_CMDCRC_CTRL_CMDCRC_EN CMDCRC_EN
/** Sets a specific field in the ELS_CMDCRC_CTRL SFR. The unrelated fields/bits will not be changed
* @param field: Any field name in MCUXCLELS_SFR_CMDCRC_CTRL_*
* @param value: The value to set the requested SFR field to */
#define MCUXCLELS_SET_CMDCRC_CTRL_FIELD(field, value) \
mcuxClEls_setSfrField(&MCUXCLELS_SFR_READ(ELS_CMDCRC_CTRL), (value), MCUXCLELS_SFR_FIELD_MASK(ELS_CMDCRC_CTRL, field), MCUXCLELS_SFR_FIELD_SHIFT(ELS_CMDCRC_CTRL, field))
/** Macros to access the bit fields for the ELS_SHA2_CTRL SFR */
#define MCUXCLELS_SFR_SHA2_CTRL_SHA2_START SHA2_START
#define MCUXCLELS_SFR_SHA2_CTRL_SHA2_RST SHA2_RST
#define MCUXCLELS_SFR_SHA2_CTRL_SHA2_INIT SHA2_INIT
#define MCUXCLELS_SFR_SHA2_CTRL_SHA2_LOAD SHA2_LOAD
#define MCUXCLELS_SFR_SHA2_CTRL_SHA2_MODE SHA2_MODE
#define MCUXCLELS_SFR_SHA2_CTRL_SHA2_BYTE_ORDER SHA2_BYTE_ORDER
/** Gets a specific field in the ELS_SHA2_CTRL SFR.
* @param field: Any field name in MCUXCLELS_SFR_SHA2_CTRL_* */
#define MCUXCLELS_GET_SHA2_CTRL_FIELD(field) \
mcuxClEls_getSfrField(MCUXCLELS_SFR_READ(ELS_SHA2_CTRL), MCUXCLELS_SFR_FIELD_MASK(ELS_SHA2_CTRL, field), MCUXCLELS_SFR_FIELD_SHIFT(ELS_SHA2_CTRL, field))
/** Sets a specific field in the ELS_SHA2_CTRL SFR. The unrelated fields/bits will not be changed
* @param field: Any field name in MCUXCLELS_SFR_SHA2_CTRL_*
* @param value: The value to set the requested SFR field to */
#define MCUXCLELS_SET_SHA2_CTRL_FIELD(field, value) \
mcuxClEls_setSfrField(&MCUXCLELS_SFR_READ(ELS_SHA2_CTRL), (value), MCUXCLELS_SFR_FIELD_MASK(ELS_SHA2_CTRL, field), MCUXCLELS_SFR_FIELD_SHIFT(ELS_SHA2_CTRL, field))
/** Macro to access the bit fields for the ELS_SHA2_STATUS SFR */
#define MCUXCLELS_SFR_SHA2_STATUS_SHA2_BUSY SHA2_BUSY
/** Gets a specific field in the ELS_SHA2_STATUS SFR.
* @param field: Any field name in MCUXCLELS_SFR_SHA2_STATUS_* */
#define MCUXCLELS_GET_SHA2_STATUS_FIELD(field) \
mcuxClEls_getSfrField(MCUXCLELS_SFR_READ(ELS_SHA2_STATUS), MCUXCLELS_SFR_FIELD_MASK(ELS_SHA2_STATUS, field), MCUXCLELS_SFR_FIELD_SHIFT(ELS_SHA2_STATUS, field))
#ifdef MCUXCL_FEATURE_ELS_GLITCHDETECTOR
/**
* Macros to access the bit fields for the ELS_GDET_EVTCNT SFR
* */
#define MCUXCLELS_SFR_GDET_EVTCNT_GDET_EVTCNT GDET_EVTCNT
#define MCUXCLELS_SFR_GDET_EVTCNT_GDET_EVTCNT_CLR_DONE GDET_EVTCNT_CLR_DONE
/** Gets a specific field in ELS_GDET_EVTCNT SFR.
* @param field: Any field name in MCUXCLELS_SFR_GDET_EVTCNT_* */
#define MCUXCLELS_GET_GDET_EVTCNT_FIELD(field) \
mcuxClEls_getSfrField(MCUXCLELS_SFR_READ(ELS_GDET_EVTCNT), MCUXCLELS_SFR_FIELD_MASK(ELS_GDET_EVTCNT, field), MCUXCLELS_SFR_FIELD_SHIFT(ELS_GDET_EVTCNT, field))
#endif /* MCUXCL_FEATURE_ELS_GLITCHDETECTOR */
/** Macros to access the bit fields for the ELS_INT_ENABLE SFR */
#define MCUXCLELS_SFR_INT_ENABLE_INT_EN INT_EN
#ifdef MCUXCL_FEATURE_ELS_GLITCHDETECTOR
#define MCUXCLELS_SFR_INT_ENABLE_GDET_INT_EN GDET_INT_EN
#endif /* MCUXCL_FEATURE_ELS_GLITCHDETECTOR */
/** Gets a specific field in the ELS_INT_ENABLE SFR.
* @param field: Any field name in MCUXCLELS_SFR_INT_ENABLE_* */
#define MCUXCLELS_GET_INT_ENABLE_FIELD(field) \
mcuxClEls_getSfrField(MCUXCLELS_SFR_READ(ELS_INT_ENABLE), MCUXCLELS_SFR_FIELD_MASK(ELS_INT_ENABLE, field), MCUXCLELS_SFR_FIELD_SHIFT(ELS_INT_ENABLE, field))
/* Total buffer size in output, which is used for cache maintenance */
#define MCUXCLELS_HASH_BUFFER_SIZE(options) MCUXCLELS_HASH_BUFFER_SIZE_DIGEST(options) + MCUXCLELS_HASH_BUFFER_SIZE_RTF(options)
#define MCUXCLELS_HASH_BUFFER_SIZE_RTF(options) ( (MCUXCLELS_HASH_RTF_OUTPUT_ENABLE == options.bits.rtfoe) ? MCUXCLELS_HASH_RTF_OUTPUT_SIZE : 0u )
#define MCUXCLELS_HASH_BUFFER_SIZE_DIGEST(options) ( (1u < options.bits.hashmd) ? MCUXCLELS_HASH_OUTPUT_SIZE_SHA_512 : MCUXCLELS_HASH_OUTPUT_SIZE_SHA_256 )
#ifdef MCUXCL_FEATURE_ELS_ITERATIVE_SEEDING
extern uint32_t mcuxClEls_rng_drbg_block_counter;
#define MCUXCLELS_RNG_DRBG_ITERATIVE_SEEDING_ITERATIONS 8u
#define MCUXCLELS_RNG_DRBG_BLOCK_COUNTER_THRESHOLD 4096u
#define MCUXCLELS_RNG_DRBG_ECCKEYGEN_INCREASE 10u
#define MCUXCLELS_RNG_DRBG_ECCSIGN_INCREASE 14u
#define MCUXCLELS_RNG_DRBG_ECCVERIFY_INCREASE 5u
#define MCUXCLELS_RNG_DRBG_KEYDELETE128_INCREASE 4u
#define MCUXCLELS_RNG_DRBG_KEYDELETE256_INCREASE 6u
#define MCUXCLELS_RNG_DRBG_DRBGREQUEST_INCREASE(outputLength) ((outputLength + 15u) / 16u)
/**
* @brief This function resets the internal ELS DRBG block counter and reseeds the ELS DRBG
* using the iterative reseeding procedure
*
* @retval #MCUXCLELS_STATUS_SW_FAULT if a failure occurred
* @retval #MCUXCLELS_STATUS_OK on successful operation
*/
MCUX_CSSL_ANALYSIS_START_PATTERN_DESCRIPTIVE_IDENTIFIER()
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_Dtrng_IterativeReseeding_Reseed)
MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_Dtrng_IterativeReseeding_Reseed(const uint8_t *pDtrngConfig);
MCUX_CSSL_ANALYSIS_STOP_PATTERN_DESCRIPTIVE_IDENTIFIER()
#endif /* MCUXCL_FEATURE_ELS_ITERATIVE_SEEDING */
/**
* @brief This function provides error handling for mcuxClEls_KeyExport_Async function
*
* @param[in] pOutput The memory address of the exported key which will be cleared
* @param[in] keyLength The key length which will be cleared
* @param[in] interrupt_state_old The interrupts state which will be restored
*
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_handleKeyExportError)
MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_handleKeyExportError(uint8_t *pOutput, size_t keyLength, mcuxClEls_InterruptOptionEn_t interrupt_state_old);
/* Functional macro to check for ELS Level 1 errors */
#define MCUXCLELS_LEVEL1_ERROR(returnCode) (MCUXCLELS_STATUS_HW_OPERATIONAL == (returnCode)) || (MCUXCLELS_STATUS_HW_ALGORITHM == (returnCode)) || (MCUXCLELS_STATUS_HW_BUS == (returnCode))
/** read from ELS PRNG SFR. */
static inline uint32_t mcuxClEls_readPrngOut(void)
{
return MCUXCLELS_SFR_READ(ELS_PRNG_DATOUT);
}
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* MCUXCLELS_INTERNAL_H_ */
@@ -0,0 +1,67 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2020-2023 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/**
* @file mcuxClEls_Internal_Common.h
* @brief ELS header for common internal functionality.
*/
#ifndef MCUXCLELS_INTERNAL_COMMON_H_
#define MCUXCLELS_INTERNAL_COMMON_H_
#include <mcuxClConfig.h> // Exported features flags header
#include <mcuxClEls_Common.h> // Common types
#include <platform_specific_headers.h>
#ifdef __cplusplus
extern "C" {
#endif
/**********************************************
* CONSTANTS
**********************************************/
/**
* @def MCUXCLELS_HW_VERSION
* @ingroup mcuxClEls_Common
* @brief Compatible ELS hardware IP version for the CLNS release that this header is part of.
*/
#ifndef MCUXCL_FEATURE_ELS_GET_FW_VERSION
#define MCUXCLELS_HW_VERSION ((mcuxClEls_HwVersion_t) { \
.bits = { \
.revision = (uint32_t) ELS_HW_VERSION_REVISION, \
.minor = (uint32_t) ELS_HW_VERSION_MINOR, \
.major = (uint32_t) ELS_HW_VERSION_MAJOR, \
.level = (uint32_t) ELS_HW_VERSION_LEVEL \
} \
})
#else /* MCUXCL_FEATURE_ELS_GET_FW_VERSION */
#define MCUXCLELS_HW_VERSION ((mcuxClEls_HwVersion_t) { \
.bits = { \
.revision = (uint32_t) ELS_HW_VERSION_REVISION, \
.minor = (uint32_t) ELS_HW_VERSION_MINOR, \
.major = (uint32_t) ELS_HW_VERSION_MAJOR, \
.fw_revision = (uint32_t) ELS_HW_VERSION_FW_REVISION, \
.fw_minor = (uint32_t) ELS_HW_VERSION_FW_MINOR, \
.fw_major = (uint32_t) ELS_HW_VERSION_FW_MAJOR \
} \
})
#endif /* MCUXCL_FEATURE_ELS_GET_FW_VERSION */
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* MCUXCLELS_INTERNAL_COMMON_H_ */
@@ -0,0 +1,105 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2022 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/**
* @file mcuxClEls_Internal_mapping.h
* @brief Header providing mapping for legacy definitions (with CSS)
*/
#ifndef MCUXCLELS_INTERNAL_MAPPING_H_
#define MCUXCLELS_INTERNAL_MAPPING_H_
#if !defined(ELS_KS_CNT)
#define ELS_KS_CNT CSS_KS_CNT
#endif
#if !defined(ID_CFG_ELS_CMD_AUTH_CIPHER)
#define ID_CFG_ELS_CMD_AUTH_CIPHER ID_CFG_CSS_CMD_AUTH_CIPHER
#endif
#if !defined(ID_CFG_ELS_CMD_CHAL_RESP_GEN)
#define ID_CFG_ELS_CMD_CHAL_RESP_GEN ID_CFG_CSS_CMD_CHAL_RESP_GEN
#endif
#if !defined(ID_CFG_ELS_CMD_CIPHER)
#define ID_CFG_ELS_CMD_CIPHER ID_CFG_CSS_CMD_CIPHER
#endif
#if !defined(ID_CFG_ELS_CMD_CKDF)
#define ID_CFG_ELS_CMD_CKDF ID_CFG_CSS_CMD_CKDF
#endif
#if !defined(ID_CFG_ELS_CMD_CMAC)
#define ID_CFG_ELS_CMD_CMAC ID_CFG_CSS_CMD_CMAC
#endif
#if !defined(ID_CFG_ELS_CMD_DRBG_TEST)
#define ID_CFG_ELS_CMD_DRBG_TEST ID_CFG_CSS_CMD_DRBG_TEST
#endif
#if !defined(ID_CFG_ELS_CMD_DTRNG_CFG_LOAD)
#define ID_CFG_ELS_CMD_DTRNG_CFG_LOAD ID_CFG_CSS_CMD_DTRNG_CFG_LOAD
#endif
#if !defined(ID_CFG_ELS_CMD_DTRNG_EVAL)
#define ID_CFG_ELS_CMD_DTRNG_EVAL ID_CFG_CSS_CMD_DTRNG_EVAL
#endif
#if !defined(ID_CFG_ELS_CMD_DTRNG_PRVL_CFG_LOAD)
#define ID_CFG_ELS_CMD_DTRNG_PRVL_CFG_LOAD ID_CFG_CSS_CMD_DTRNG_PRVL_CFG_LOAD
#endif
#if !defined(ID_CFG_ELS_CMD_ECKXH)
#define ID_CFG_ELS_CMD_ECKXH ID_CFG_CSS_CMD_ECKXH
#endif
#if !defined(ID_CFG_ELS_CMD_ECSIGN)
#define ID_CFG_ELS_CMD_ECSIGN ID_CFG_CSS_CMD_ECSIGN
#endif
#if !defined(ID_CFG_ELS_CMD_ECVFY)
#define ID_CFG_ELS_CMD_ECVFY ID_CFG_CSS_CMD_ECVFY
#endif
#if !defined(ID_CFG_ELS_CMD_GDET_CFG_LOAD)
#define ID_CFG_ELS_CMD_GDET_CFG_LOAD ID_CFG_CSS_CMD_GDET_CFG_LOAD
#endif
#if !defined(ID_CFG_ELS_CMD_GDET_TRIM)
#define ID_CFG_ELS_CMD_GDET_TRIM ID_CFG_CSS_CMD_GDET_TRIM
#endif
#if !defined(ID_CFG_ELS_CMD_HASH)
#define ID_CFG_ELS_CMD_HASH ID_CFG_CSS_CMD_HASH
#endif
#if !defined(ID_CFG_ELS_CMD_HKDF)
#define ID_CFG_ELS_CMD_HKDF ID_CFG_CSS_CMD_HKDF
#endif
#if !defined(ID_CFG_ELS_CMD_HMAC)
#define ID_CFG_ELS_CMD_HMAC ID_CFG_CSS_CMD_HMAC
#endif
#if !defined(ID_CFG_ELS_CMD_KDELETE)
#define ID_CFG_ELS_CMD_KDELETE ID_CFG_CSS_CMD_KDELETE
#endif
#if !defined(ID_CFG_ELS_CMD_KEYGEN)
#define ID_CFG_ELS_CMD_KEYGEN ID_CFG_CSS_CMD_KEYGEN
#endif
#if !defined(ID_CFG_ELS_CMD_KEYIN)
#define ID_CFG_ELS_CMD_KEYIN ID_CFG_CSS_CMD_KEYIN
#endif
#if !defined(ID_CFG_ELS_CMD_KEYOUT)
#define ID_CFG_ELS_CMD_KEYOUT ID_CFG_CSS_CMD_KEYOUT
#endif
#if !defined(ID_CFG_ELS_CMD_KEYPROV)
#define ID_CFG_ELS_CMD_KEYPROV ID_CFG_CSS_CMD_KEYPROV
#endif
#if !defined(ID_CFG_ELS_CMD_TLS)
#define ID_CFG_ELS_CMD_TLS ID_CFG_CSS_CMD_TLS
#endif
#if (!defined(ID_CFG_ELS_CMD_RND_REQ)) && defined(ID_CFG_CSS_CMD_RND_REQ)
#define ID_CFG_ELS_CMD_RND_REQ ID_CFG_CSS_CMD_RND_REQ
#endif
#if (!defined(ID_CFG_ELS_CMD_DRBG_REQ)) && defined(ID_CFG_CSS_CMD_DRBG_REQ)
#define ID_CFG_ELS_CMD_DRBG_REQ ID_CFG_CSS_CMD_DRBG_REQ
#endif
#endif /* MCUXCLELS_INTERNAL_MAPPING_H_ */
@@ -0,0 +1,92 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2022-2023 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/** @file mcuxClEls_SfrAccess.h
* @brief Provide macros for mcuxClEls internal use.
* This header declares internal macros to deduplicate code and support for internal use only. */
#ifndef MCUXCLELS_SFRACCESS_H_
#define MCUXCLELS_SFRACCESS_H_
#include <mcuxClConfig.h> // Exported features flags header
#include <platform_specific_headers.h>
#include <stdint.h>
#include <stdbool.h>
#include <internal/mcuxClEls_Internal_mapping.h>
#ifdef __cplusplus
extern "C" {
#endif
/**** ****/
/**** ELS Hardware Abstraction Layer ****/
/**** ****/
/**
* Definitions for accessing ELS SFRs via, e.g., IP_ELS->STATUS.
*/
/** Helper macros for constructing SFR field name constants */
#define MCUXCLELS_PASTE(a,b) a ## b
#define MCUXCLELS_CONCAT(a,b) MCUXCLELS_PASTE(a,b)
#define MCUXCLELS_SFR_FIELD(prefix,sfr,field) MCUXCLELS_CONCAT(prefix, sfr ## _ ## field)
/** Helper macros to get the mask and shift values for a specific ELS SFR field */
#define MCUXCLELS_SFR_FIELD_MASK(sfr, field) MCUXCLELS_CONCAT(MCUXCLELS_SFR_FIELD(ELS_SFR_PREFIX,sfr,field), _MASK)
#define MCUXCLELS_SFR_FIELD_SHIFT(sfr, field) MCUXCLELS_CONCAT(MCUXCLELS_SFR_FIELD(ELS_SFR_PREFIX,sfr,field), _SHIFT)
#define MCUXCLELS_SFR_FIELD_FORMAT(sfr, field, val) (MCUXCLELS_SFR_FIELD(ELS_SFR_PREFIX,sfr,field) (val))
/**********************************************************/
/* Helper macros for ELS SFR access */
/**********************************************************/
/** Read from ELS SFR */
#define MCUXCLELS_SFR_READ(sfr) (ELS_SFR_BASE->ELS_SFR_NAME(sfr))
/** Write to ELS SFR */
#define MCUXCLELS_SFR_WRITE(sfr, value) \
do{ \
MCUX_CSSL_ANALYSIS_START_SUPPRESS_HARDWARE_ACCESS("Sfr offset from address") \
ELS_SFR_BASE->ELS_SFR_NAME(sfr) = (value); \
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_HARDWARE_ACCESS() \
} while(false)
/** Read from ELS SFR bit field */
#define MCUXCLELS_SFR_BITREAD(sfr, bit) \
((ELS_SFR_BASE->ELS_SFR_NAME(sfr) & MCUXCLELS_SFR_FIELD_MASK(sfr, bit)) >> MCUXCLELS_SFR_FIELD_SHIFT(sfr, bit))
/** Set bit field of ELS SFR (read-modify-write) */
#define MCUXCLELS_SFR_BITSET(sfr, bit) \
do{ ELS_SFR_BASE->ELS_SFR_NAME(sfr) |= MCUXCLELS_SFR_FIELD_MASK(sfr, bit); } while(false)
/** Clear bit field of ELS SFR (read-modify-write) */
#define MCUXCLELS_SFR_BITCLEAR(sfr, bit) \
do{ ELS_SFR_BASE->ELS_SFR_NAME(sfr) &= (~ (uint32_t) MCUXCLELS_SFR_FIELD_MASK(sfr, bit)); } while(false)
/** Set value of multi-bit field of ELS SFR (read-modify-write) */
#define MCUXCLELS_SFR_BITVALSET(sfr, bit, val) \
do{ \
uint32_t temp = ELS_SFR_BASE->ELS_SFR_NAME(sfr) & (~ (uint32_t) MCUXCLELS_SFR_FIELD_MASK(sfr, bit)); \
MCUX_CSSL_ANALYSIS_START_SUPPRESS_HARDWARE_ACCESS("Sfr offset from address") \
ELS_SFR_BASE->ELS_SFR_NAME(sfr) = temp | ((val) << MCUXCLELS_SFR_FIELD_SHIFT(sfr, bit)) & MCUXCLELS_SFR_FIELD_MASK(sfr, bit); \
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_HARDWARE_ACCESS() \
} while(false)
/**** ------------------------------ ****/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* MCUXCLELS_SFRACCESS_H_ */
@@ -0,0 +1,256 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2020, 2022 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/**
* @file mcuxClEls.h
* @brief Top-level include file for the ELS driver
*
* This includes headers for all of the functionality provided by the ELS IP.
*
* @defgroup mcuxClEls mcuxClEls
* @brief ELS driver
*
* This component abstracts the hardware access to the ELS IP.
* The library exposes the following hardware functionality:
* <ol>
* <li> COMMON
* <ul>
* <li> Determine information of the underlying ELS hardware IP
* <ul> <li> #mcuxClEls_GetHwVersion </ul>
* @if MCUXCL_FEATURE_ELS_HWCONFIG
* <ul> <li> #mcuxClEls_GetHwConfig </ul>
* @endif
* <ul> <li> #mcuxClEls_GetHwState </ul>
* <li> ELS enabling, disabling, and software reset
* <ul> <li> #mcuxClEls_Enable_Async </ul>
* <ul> <li> #mcuxClEls_Reset_Async </ul>
* <ul> <li> #mcuxClEls_Disable </ul>
* <li> Interrupt management
* <ul> <li> #mcuxClEls_SetIntEnableFlags </ul>
* <ul> <li> #mcuxClEls_GetIntEnableFlags </ul>
* <ul> <li> #mcuxClEls_ResetIntFlags </ul>
* <ul> <li> #mcuxClEls_SetIntFlags </ul>
* <li> Wait for completion of an ELS operation
* <ul> <li> #mcuxClEls_WaitForOperation </ul>
* <ul> <li> #mcuxClEls_LimitedWaitForOperation </ul>
* <li> Error handling
* <ul> <li> #mcuxClEls_ResetErrorFlags </ul>
* <ul> <li> #mcuxClEls_GetErrorCode </ul>
* <ul> <li> #mcuxClEls_GetErrorLevel </ul>
* <li> Random delay feature for AES based operations
* <ul> <li> #mcuxClEls_SetRandomStartDelay </ul>
* <ul> <li> #mcuxClEls_GetRandomStartDelay </ul>
* @if MCUXCL_FEATURE_ELS_LOCKING
* <li> ELS Locking
* <ul> <li> #mcuxClEls_GetLock </ul>
* <ul> <li> #mcuxClEls_ReleaseLock </ul>
* <ul> <li> #mcuxClEls_IsLocked </ul>
* <ul> <li> #mcuxClEls_SetMasterUnlock </ul>
* @endif
* @if MCUXCL_FEATURE_ELS_RESP_GEN
* <li> Calculate response to a hardware generated challenge
* <ul> <li> #mcuxClEls_RespGen_Async </ul>
* @endif
* @if MCUXCL_FEATURE_ELS_DMA_ADDRESS_READBACK
* <li> Final Address Readback (security feature)
* <ul> <li> #mcuxClEls_GetLastDmaAddress </ul>
* @endif
* @if MCUXCL_FEATURE_ELS_DMA_FINAL_ADDRESS_READBACK
* <li> Final Address Compare (security feature)
* <ul> <li> #mcuxClEls_CompareDmaFinalOutputAddress </ul>
* @endif
* </ul>
* <li> CRC
* <ul>
* <li> Command CRC checks
* <ul> <li> #mcuxClEls_ConfigureCommandCRC </ul>
* <ul> <li> #mcuxClEls_GetCommandCRC </ul>
* <ul> <li> #mcuxClEls_VerifyVsRefCRC </ul>
* <ul> <li> #mcuxClEls_UpdateRefCRC </ul>
* </ul>
* <li> HASH
* <ul>
* <li> SHA-2 hashing
* <ul> <li> #mcuxClEls_Hash_Async </ul>
* @if MCUXCL_FEATURE_ELS_SHA_DIRECT
* <li> SHA-2 hashing in direct mode
* <ul> <li> #mcuxClEls_ShaDirect_Enable </ul>
* <ul> <li> #mcuxClEls_ShaDirect_Disable </ul>
* <ul> <li> #mcuxClEls_Hash_ShaDirect </ul>
* @endif
* </ul>
* @if MCUXCL_FEATURE_ELS_HMAC
* <li> HMAC (Keyed-Hash Message Authentication Code)
* <ul>
* <li> HMAC
* <ul> <li> #mcuxClEls_Hmac_Async </ul>
* </ul>
* @endif
* @if MCUXCL_FEATURE_ELS_CMAC
* <li> CMAC (Cipher-Based Message Authentication Code)
* <ul>
* <li> CMAC
* <ul> <li> #mcuxClEls_Cmac_Async </ul>
* </ul>
* @endif
* <li> CIPHER (Symmetric Encryption)
* <ul>
* <li> AES
* <ul> <li> #mcuxClEls_Cipher_Async </ul>
* </ul>
* @if MCUXCL_FEATURE_ELS_AEAD
* <li> AEAD (Authenticated Encryption with Associated Data)
* <ul>
* <li> Authenticated Encryption with Associated Data
* <ul>
* <li> #mcuxClEls_Aead_Init_Async
* <li> #mcuxClEls_Aead_UpdateAad_Async
* <li> #mcuxClEls_Aead_UpdateData_Async
* <li> #mcuxClEls_Aead_Finalize_Async
* </ul>
* </ul>
* @endif
* <li> KEY MANAGEMENT
* <ul>
* @if MCUXCL_FEATURE_ELS_KEY_MGMT_DELETE
* <li> Key deletion
* <ul> <li> #mcuxClEls_KeyDelete_Async </ul>
* @endif
* @if MCUXCL_FEATURE_ELS_KEY_MGMT_KEYPROV
* <li> Key provisioning
* <ul> <li> #mcuxClEls_KeyProvision_Async </ul>
* @endif
* @if MCUXCL_FEATURE_ELS_KEY_MGMT_KEYPROV_ROM
* <li> Key provisioning (ROM)
* <ul> <li> #mcuxClEls_KeyProvisionRom_Async </ul>
* @endif
* <li> Key import
* <ul> <li> #mcuxClEls_KeyImport_Async </ul>
* @if MCUXCL_FEATURE_ELS_PUK_INTERNAL
* <li> Public key import
* <ul> <li> #mcuxClEls_KeyImportPuk_Async </ul>
* @endif
* @if MCUXCL_FEATURE_ELS_KEY_MGMT_EXPORT
* <li> Key export
* <ul> <li> #mcuxClEls_KeyExport_Async </ul>
* @endif
* <li> Key properties
* <ul> <li> #mcuxClEls_GetKeyProperties </ul>
* </ul>
* @if MCUXCL_FEATURE_ELS_RNG
* <li> RNG
* <ul>
* <li> Random data generation using DRBG
* <ul> <li> #mcuxClEls_Rng_DrbgRequest_Async </ul>
* @if MCUXCL_FEATURE_ELS_RND_RAW
* <li> Get raw (unprocessed) random data from the DTRNG
* <ul> <li> #mcuxClEls_Rng_DrbgRequestRaw_Async </ul>
* @endif
* <li> FIPS CAVP test mode
* <ul> <li> #mcuxClEls_Rng_DrbgTestInstantiate_Async </ul>
* <ul> <li> #mcuxClEls_Rng_DrbgTestExtract_Async </ul>
* <ul> <li> #mcuxClEls_Rng_DrbgTestAesEcb_Async </ul>
* <ul> <li> #mcuxClEls_Rng_DrbgTestAesCtr_Async </ul>
* <li> Configuration of the DTRNG
* <ul> <li> #mcuxClEls_Rng_Dtrng_ConfigLoad_Async </ul>
* <ul> <li> #mcuxClEls_Rng_Dtrng_ConfigEvaluate_Async </ul>
* <li> PRNG
* @if MCUXCL_FEATURE_ELS_PRND_INIT
* <ul> <li> #mcuxClEls_Prng_Init_Async </ul>
* @endif
* <ul> <li> #mcuxClEls_Prng_GetRandomWord </ul>
* <ul> <li> #mcuxClEls_Prng_GetRandom </ul>
* </ul>
* @endif
* <li> ECC (Elliptic Curve Cryptography)
* <ul>
* <li> ECC Key generation
* <ul> <li> #mcuxClEls_EccKeyGen_Async </ul>
* @if MCUXCL_FEATURE_ELS_ECC_KEY_EXCHANGE
* <li> ECC key exchange
* <ul> <li> #mcuxClEls_EccKeyExchange_Async </ul>
* @if MCUXCL_FEATURE_ELS_PUK_INTERNAL
* <ul> <li> #mcuxClEls_EccKeyExchangeInt_Async </ul>
* @endif
* @endif
* <li> ECC signature generation
* <ul> <li> #mcuxClEls_EccSign_Async </ul>
* <li> ECC signature verification
* <ul> <li> #mcuxClEls_EccVerify_Async </ul>
* @if MCUXCL_FEATURE_ELS_PUK_INTERNAL
* <ul> <li> #mcuxClEls_EccVerifyInt_Async </ul>
* @endif
* </ul>
* <li> KEY DERIVATION
* <ul>
* <li> Key derivation
* <ul>
* @if MCUXCL_FEATURE_ELS_CKDF
* <li> #mcuxClEls_Ckdf_Sp800108_Async
* @if MCUXCL_FEATURE_ELS_CKDF_SP80056C
* <li> #mcuxClEls_Ckdf_Sp80056c_Extract_Async
* <li> #mcuxClEls_Ckdf_Sp80056c_Expand_Async
* @endif
* @endif
* @if MCUXCL_FEATURE_ELS_HKDF
* <li> #mcuxClEls_Hkdf_Rfc5869_Async
* <li> #mcuxClEls_Hkdf_Sp80056c_Async
* @endif
* </ul>
* @if MCUXCL_FEATURE_ELS_TLS
* <li> Master Key and Session Key derivation
* <ul>
* <li> #mcuxClEls_TlsGenerateMasterKeyFromPreMasterKey_Async
* <li> #mcuxClEls_TlsGenerateSessionKeysFromMasterKey_Async
* </ul>
* @endif
* </ul>
* @if MCUXCL_FEATURE_ELS_GLITCHDETECTOR
* <li> ELS Glitch Detector control
* <ul>
* <li> #mcuxClEls_GlitchDetector_LoadConfig_Async
* <li> #mcuxClEls_GlitchDetector_Trim_Async
* <li> #mcuxClEls_GlitchDetector_GetEventCounter
* <li> #mcuxClEls_GlitchDetector_ResetEventCounter
* </ul>
* @endif
* </ol>
*
* After each call to a function ending in <tt>_Async</tt>, one of the waiting functions #mcuxClEls_WaitForOperation or #mcuxClEls_LimitedWaitForOperation must be called to ensure completion.
* The waiting functions may fail, e.g., when the ELS enters an error state.
*/
#ifndef MCUXCLELS_H_
#define MCUXCLELS_H_
#include <mcuxClConfig.h> // Exported features flags header
#include <mcuxClEls_Types.h>
#include <mcuxClEls_Common.h>
#ifdef MCUXCL_FEATURE_ELS_CMD_CRC
#include <mcuxClEls_Crc.h>
#endif /* MCUXCL_FEATURE_ELS_CMD_CRC */
#include <mcuxClEls_Hash.h>
#include <mcuxClEls_Hmac.h>
#include <mcuxClEls_Cmac.h>
#include <mcuxClEls_Cipher.h>
#include <mcuxClEls_Aead.h>
#include <mcuxClEls_KeyManagement.h>
#include <mcuxClEls_Rng.h>
#include <mcuxClEls_Ecc.h>
#include <mcuxClEls_Kdf.h>
#ifdef MCUXCL_FEATURE_ELS_GLITCHDETECTOR
#include <mcuxClEls_GlitchDetector.h>
#endif /* MCUXCL_FEATURE_ELS_GLITCHDETECTOR */
#endif /* MCUXCLELS_H_ */
@@ -0,0 +1,457 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2020-2023 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/**
* @file mcuxClEls_Aead.h
* @brief ELS header for Authenticated Encryption with Associated Data (AEAD).
*
* This header exposes functions that enable using the ELS for Authenticated Encryption with Associated Data (AEAD).
* The AEAD algorithm supported by ELS is AES in Galois/Counter Mode (GCM), as described in NIST Special Publication
* 800-38D.
*/
/**
* @defgroup mcuxClEls_Aead mcuxClEls_Aead
* @brief This part of the @ref mcuxClEls driver supports Authenticated Encryption with Associated Data (AEAD).
* @ingroup mcuxClEls
* @{
*/
#ifndef MCUXCLELS_AEAD_H_
#define MCUXCLELS_AEAD_H_
#include <mcuxClConfig.h> // Exported features flags header
#include <mcuxClEls_Common.h> // Common functionality
#ifdef __cplusplus
extern "C" {
#endif
/**********************************************
* CONSTANTS
**********************************************/
/**
* @defgroup mcuxClEls_Aead_Macros mcuxClEls_Aead_Macros
* @brief Defines all macros of @ref mcuxClEls_Aead
* @ingroup mcuxClEls_Aead
* @{
*/
/**
* @defgroup MCUXCLELS_AEAD_ MCUXCLELS_AEAD_
* @brief Defines macros used to initialize #mcuxClEls_AeadOption_t
* @ingroup mcuxClEls_Aead_Macros
* @{
*/
#define MCUXCLELS_AEAD_ENCRYPT ((uint8_t)0x00U) ///< Set #mcuxClEls_AeadOption_t.dcrpt to this value to encrypt data
#define MCUXCLELS_AEAD_DECRYPT ((uint8_t)0x01U) ///< Set #mcuxClEls_AeadOption_t.dcrpt to this value to decrypt data
#define MCUXCLELS_AEAD_STATE_IN_DISABLE ((uint8_t)0x00U) ///< Set #mcuxClEls_AeadOption_t.acpsie to this value to load the GCM state from ELS
#define MCUXCLELS_AEAD_STATE_IN_ENABLE ((uint8_t)0x01U) ///< Set #mcuxClEls_AeadOption_t.acpsie to this value to load the GCM state from the context
#define MCUXCLELS_AEAD_LASTINIT_TRUE ((uint8_t)0x01U) ///< Set #mcuxClEls_AeadOption_t.lastinit to this value if this is the last call to init
#define MCUXCLELS_AEAD_LASTINIT_FALSE ((uint8_t)0x00U) ///< Set #mcuxClEls_AeadOption_t.lastinit to this value if this is not the last call to init
#define MCUXCLELS_AEAD_EXTERN_KEY ((uint8_t)0x01U) ///< Set #mcuxClEls_AeadOption_t.extkey to this value to use an external key
#define MCUXCLELS_AEAD_INTERN_KEY ((uint8_t)0x00U) ///< Set #mcuxClEls_AeadOption_t.extkey to this value to use a key from the ELS keystore
#define MCUXCLELS_AEAD_ACPMOD_INIT ((uint8_t)0x00U) ///< Set #mcuxClEls_AeadOption_t.acpmod to this value for Init mode. For internal use
#define MCUXCLELS_AEAD_ACPMOD_AADPROC ((uint8_t)0x01U) ///< Set #mcuxClEls_AeadOption_t.acpmod to this value for Process Additional Authenticated Data mode. For internal use
#define MCUXCLELS_AEAD_ACPMOD_MSGPROC ((uint8_t)0x02U) ///< Set #mcuxClEls_AeadOption_t.acpmod to this value for Process Message mode. For internal use
#define MCUXCLELS_AEAD_ACPMOD_FINAL ((uint8_t)0x03U) ///< Set #mcuxClEls_AeadOption_t.acpmod to this value for Finalize mode. For internal use
#ifndef MCUXCL_FEATURE_ELS_NO_INTERNAL_STATE_FLAGS
#define MCUXCLELS_AEAD_STATE_OUT_ENABLE ((uint8_t)0x01U) ///< Set #mcuxClEls_AeadOption_t.acpsoe to this value to save the state to the context. For internal use
#endif /* MCUXCL_FEATURE_ELS_NO_INTERNAL_STATE_FLAGS */
/**
* @}
*/
#define MCUXCLELS_AEAD_IV_BLOCK_SIZE 16U ///< AES-GCM IV Granularity: 128 bit (16 bytes)
#define MCUXCLELS_AEAD_AAD_BLOCK_SIZE 16U ///< AES-GCM AAD Granularity: 128 bit (16 bytes)
#define MCUXCLELS_AEAD_TAG_SIZE 16U ///< tag size: Tag generation supports only a 128 bit wide tag (16 bytes)
#define MCUXCLELS_AEAD_CONTEXT_SIZE 80U ///< context size: 512 bit (64 bytes) + 16 bytes for finalize
/**
* @}
*/
/**********************************************
* TYPEDEFS
**********************************************/
/**
* @defgroup mcuxClEls_Aead_Types mcuxClEls_Aead_Types
* @brief Defines all types of @ref mcuxClEls_Aead
* @ingroup mcuxClEls_Aead
* @{
*/
/**
* @brief Command option bit field for #mcuxClEls_Aead_Init_Async, #mcuxClEls_Aead_UpdateAad_Async, #mcuxClEls_Aead_UpdateData_Async and #mcuxClEls_Aead_Finalize_Async.
*/
typedef union
{
struct
{
uint32_t value; ///< Accesses the bit field as a full word
} word; ///< Access #mcuxClEls_AeadOption_t word-wise
struct
{
uint32_t :1; ///< RFU
uint32_t dcrpt :1; ///< Defines if encryption or decryption shall be performed
uint32_t acpmod :2; ///< This field is managed internally
#ifndef MCUXCL_FEATURE_ELS_NO_INTERNAL_STATE_FLAGS
uint32_t acpsoe :1; ///< This field is managed internally
#else
uint32_t :1; ///< RFU
#endif /* MCUXCL_FEATURE_ELS_NO_INTERNAL_STATE_FLAGS */
uint32_t acpsie :1; ///< This field is managed internally
uint32_t msgendw :4; ///< The size of the last data block (plain/cipher text) in bytes, without padding
uint32_t lastinit :1; ///< Defines whether this is the last call to init
uint32_t :2; ///< RFU
uint32_t extkey :1; ///< Defines whether an external key shall be used
uint32_t :18; ///< RFU
} bits; ///< Access #mcuxClEls_AeadOption_t bit-wise
} mcuxClEls_AeadOption_t;
/**
* @}
*/
/**********************************************
* FUNCTIONS
**********************************************/
/**
* @defgroup mcuxClEls_Aead_Functions mcuxClEls_Aead_Functions
* @brief Defines all functions of @ref mcuxClEls_Aead
* @ingroup mcuxClEls_Aead
* @{
*/
/**
* @brief AES-GCM initialization
*
* This is the first stage of AEAD encryption/decryption. This generates the initial context out of the IV @p pIV and the key (@p pKey or @p keyIdx).
*
* @if ELS_AES_WITH_SIDE_CHANNEL_PROTECTION
* Before execution, ELS will wait until #mcuxClEls_HwState_t.drbgentlvl == #MCUXCLELS_STATUS_DRBGENTLVL_LOW. This can lead to a delay if the DRBG is in a state with less security strength at the time of the call.
* @endif
*
* Call #mcuxClEls_WaitForOperation to complete the operation.
*
* @param[in] options The AEAD command options. For more information, see #mcuxClEls_AeadOption_t.
* @param[in] keyIdx Index of the key inside the ELS keystore
* @param[in] pKey Pointer to the key
* @param[in] keyLength Size of @p pKey in bytes
* @param[in] pIV Pointer to memory area that contains the IV
* @param[in] ivLength Size of @p pIV in bytes, with padding
* @param [out] pAeadCtx Pointer to the memory area that receives the AEAD context structure. Must be at least #MCUXCLELS_AEAD_CONTEXT_SIZE bytes long.
*
* The properties of some parameters change with respect to selected options.
*
* <dl>
* <dt>Parameter properties</dt>
*
* <dd><dl>
* <dt>@p options.extkey == #MCUXCLELS_AEAD_EXTERN_KEY</dt>
* <dd>@p keyIdx is ignored.
*
* @p pKey must be a valid AES key and @p keyLength a valid AES key size (see @ref MCUXCLELS_CIPHER_KEY_SIZE_AES_).</dd>
*
* <dt>@p options.extkey == #MCUXCLELS_AEAD_INTERN_KEY</dt>
* <dd>@p keyIdx must be a valid key index with the correct usage rights.
*
* @p pKey and @p keyLength are ignored.</dd>
* </dl></dd>
* </dl>
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @else
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @endif
* @retval #MCUXCLELS_STATUS_SW_INVALID_PARAM if invalid parameters were specified
* @retval #MCUXCLELS_STATUS_SW_CANNOT_INTERRUPT if a running operation prevented the request
* @retval #MCUXCLELS_STATUS_OK_WAIT on successful request
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_Aead_Init_Async)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_Aead_Init_Async(
mcuxClEls_AeadOption_t options,
mcuxClEls_KeyIndex_t keyIdx,
uint8_t const * pKey,
size_t keyLength,
uint8_t const * pIV,
size_t ivLength,
uint8_t * pAeadCtx
);
/**
* @brief AES-GCM partial initialization
*
* This is the first stage of AEAD encryption/decryption. This generates the initial context out of the IV @p pIV and the key (@p pKey or @p keyIdx).
*
* @if ELS_AES_WITH_SIDE_CHANNEL_PROTECTION
* Before execution, ELS will wait until #mcuxClEls_HwState_t.drbgentlvl == #MCUXCLELS_STATUS_DRBGENTLVL_LOW. This can lead to a delay if the DRBG is in a state with less security strength at the time of the call.
* @endif
*
* Call #mcuxClEls_WaitForOperation to complete the operation.
*
* @param[in] options The AEAD command options. For more information, see #mcuxClEls_AeadOption_t.
* @param[in] keyIdx Index of the key inside the ELS keystore
* @param[in] pKey Pointer to the key
* @param[in] keyLength Size of @p pKey in bytes
* @param[in] pIV Pointer to memory area that contains the IV
* @param[in] ivLength Size of @p pIV in bytes, with padding
* @param [out] pAeadCtx Pointer to the memory area that receives the AEAD context structure. Must be at least #MCUXCLELS_AEAD_CONTEXT_SIZE bytes long.
*
* The properties of some parameters change with respect to selected options.
*
* <dl>
* <dt>Parameter properties</dt>
*
* <dd><dl>
* <dt>@p options.extkey == #MCUXCLELS_AEAD_EXTERN_KEY</dt>
* <dd>@p keyIdx is ignored.
*
* @p pKey must be a valid AES key and @p keyLength a valid AES key size (see @ref MCUXCLELS_CIPHER_KEY_SIZE_AES_).</dd>
*
* <dt>@p options.extkey == #MCUXCLELS_AEAD_INTERN_KEY</dt>
* <dd>@p keyIdx must be a valid key index with the correct usage rights.
*
* @p pKey and @p keyLength are ignored.</dd>
*
* <dt>@p options.msgendw</dt>
* <dd>This field is ignored</dd>
* </dl></dd>
* </dl>
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @else
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @endif
* @retval #MCUXCLELS_STATUS_SW_INVALID_PARAM if invalid parameters were specified
* @retval #MCUXCLELS_STATUS_SW_CANNOT_INTERRUPT if a running operation prevented the request
* @retval #MCUXCLELS_STATUS_OK_WAIT on successful request
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_Aead_PartialInit_Async)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_Aead_PartialInit_Async(
mcuxClEls_AeadOption_t options,
mcuxClEls_KeyIndex_t keyIdx,
uint8_t const * pKey,
size_t keyLength,
uint8_t const * pIV,
size_t ivLength,
uint8_t * pAeadCtx
);
/**
* @brief AES-GCM update of the Additional Authenticated Data (AAD)
*
* This is the second stage of AEAD encryption/decryption. This updates the internal authentication tag with the AAD.
*
* #mcuxClEls_Aead_Init_Async must have been called before calling this function.
*
* @if ELS_AES_WITH_SIDE_CHANNEL_PROTECTION
* Before execution, ELS will wait until #mcuxClEls_HwState_t.drbgentlvl == #MCUXCLELS_STATUS_DRBGENTLVL_LOW. This can lead to a delay if the DRBG is in a state with less security strength at the time of the call.
* @endif
*
* Call #mcuxClEls_WaitForOperation to complete the operation.
*
* @param[in] options The AEAD command options. For more information, see #mcuxClEls_AeadOption_t.
* @param[in] keyIdx Index of the key inside the ELS keystore
* @param[in] pKey Pointer to the key
* @param[in] keyLength Size of @p pKey in bytes
* @param[in] pAad Memory area that contains the AAD
* @param[in] aadLength Length of the @p pAad in bytes with padding
* @param[in, out] pAeadCtx Pointer to the AEAD context structure. Must be at least #MCUXCLELS_AEAD_CONTEXT_SIZE bytes long.
*
* The properties of some parameters change with respect to selected options.
*
* <dl>
* <dt>Parameter properties</dt>
*
* <dd><dl>
* <dt>@p options.extkey == #MCUXCLELS_AEAD_EXTERN_KEY</dt>
* <dd>@p keyIdx is ignored.
*
* @p pKey must be a valid AES key and @p keyLength a valid AES key size (see @ref MCUXCLELS_CIPHER_KEY_SIZE_AES_).</dd>
*
* <dt>@p options.extkey == #MCUXCLELS_AEAD_INTERN_KEY</dt>
* <dd>@p keyIdx must be a valid key index with the correct usage rights.
*
* @p pKey and @p keyLength are ignored.</dd>
*
* <dt>@p options.msgendw</dt>
* <dd>This field is ignored</dd>
* </dl></dd>
* </dl>
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @else
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @endif
* @retval #MCUXCLELS_STATUS_SW_INVALID_PARAM if invalid parameters were specified
* @retval #MCUXCLELS_STATUS_SW_CANNOT_INTERRUPT if a running operation prevented the request
* @retval #MCUXCLELS_STATUS_OK_WAIT on successful request
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_Aead_UpdateAad_Async)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_Aead_UpdateAad_Async(
mcuxClEls_AeadOption_t options,
mcuxClEls_KeyIndex_t keyIdx,
uint8_t const * pKey,
size_t keyLength,
uint8_t const * pAad,
size_t aadLength,
uint8_t * pAeadCtx
);
/**
* @brief AES-GCM update of the encrypted data
*
* This is the third stage of AEAD encryption/decryption. This processes the given plaintext (in case of encryption)
* or ciphertext (in case of decryption) and outputs the ciphertext (in case of encryption) or plaintext (in case of decryption).
*
* #mcuxClEls_Aead_Init_Async, #mcuxClEls_Aead_UpdateAad_Async must have been called before calling this function.
*
* @if ELS_AES_WITH_SIDE_CHANNEL_PROTECTION
* Before execution, ELS will wait until #mcuxClEls_HwState_t.drbgentlvl == #MCUXCLELS_STATUS_DRBGENTLVL_LOW. This can lead to a delay if the DRBG is in a state with less security strength at the time of the call.
* @endif
*
* Call #mcuxClEls_WaitForOperation to complete the operation.
*
* @param[in] options The AEAD command options. For more information, see #mcuxClEls_AeadOption_t.
* @param[in] keyIdx Index of the key inside the ELS keystore
* @param[in] pKey Pointer to the key
* @param[in] keyLength Size of @p pKey in bytes
* @param[in] pInput Pointer to the memory location of the data to be processed
* @param[in] inputLength Size of @p pInput in bytes with padding
* @param [out] pOutput Pointer to the processed data memory location
* @param[in, out] pAeadCtx Pointer to the AEAD context structure. Must be at least #MCUXCLELS_AEAD_CONTEXT_SIZE bytes long.
*
* The properties of some parameters change with respect to selected options.
*
* <dl>
* <dt>Parameter properties</dt>
*
* <dd><dl>
* <dt>@p options.extkey == #MCUXCLELS_AEAD_EXTERN_KEY</dt>
* <dd>@p keyIdx is ignored.
*
* @p pKey must be a valid AES key and @p keyLength a valid AES key size (see @ref MCUXCLELS_CIPHER_KEY_SIZE_AES_).</dd>
*
* <dt>@p options.extkey == #MCUXCLELS_AEAD_INTERN_KEY</dt>
* <dd>@p keyIdx must be a valid key index with the correct usage rights.
*
* @p pKey and @p keyLength are ignored.</dd>
*
* <dt>@p options.msgendw</dt>
* <dd>This field has to be set to the size of the last data block (plain/cipher text) in bytes, without padding.
* In case the last block is a full block, this field has to be set to 0.</dd>
* </dl></dd>
* </dl>
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @else
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @endif
* @retval #MCUXCLELS_STATUS_SW_INVALID_PARAM if invalid parameters were specified
* @retval #MCUXCLELS_STATUS_SW_CANNOT_INTERRUPT if a running operation prevented the request
* @retval #MCUXCLELS_STATUS_OK_WAIT on successful request
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_Aead_UpdateData_Async)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_Aead_UpdateData_Async(
mcuxClEls_AeadOption_t options,
mcuxClEls_KeyIndex_t keyIdx,
uint8_t const * pKey,
size_t keyLength,
uint8_t const * pInput,
size_t inputLength,
uint8_t * pOutput,
uint8_t * pAeadCtx
);
/**
* @brief AES-GCM final encryption/decryption
*
* This is the fourth stage of AEAD encryption/decryption. This updates the authentication tag with the final data
* length block and outputs the tag at the desired location.
*
* #mcuxClEls_Aead_Init_Async, #mcuxClEls_Aead_UpdateAad_Async and #mcuxClEls_Aead_UpdateData_Async must have been called
* before calling this function.
*
* @if ELS_AES_WITH_SIDE_CHANNEL_PROTECTION
* Before execution, ELS will wait until #mcuxClEls_HwState_t.drbgentlvl == #MCUXCLELS_STATUS_DRBGENTLVL_LOW. This can lead to a delay if the DRBG is in a state with less security strength at the time of the call.
* @endif
*
* Call #mcuxClEls_WaitForOperation to complete the operation.
*
* @param[in] options The AEAD command options. For more information, see #mcuxClEls_AeadOption_t.
* @param[in] keyIdx Index of the key inside the ELS keystore
* @param[in] pKey Pointer to the key
* @param[in] keyLength Size of @p pKey in bytes
* @param[in] aadLength Length of the complete Additional Authenticated Data (AAD) in bytes, without padding.
* @param[in] dataLength Length of the complete plaintext/ciphertext in bytes, without padding.
* @param [out] pTag Pointer where the resulting tag will be stored
* @param[in] pAeadCtx Pointer to the AEAD context structure. Must be at least #MCUXCLELS_AEAD_CONTEXT_SIZE bytes long.
*
* The properties of some parameters change with respect to selected options.
*
* <dl>
* <dt>Parameter properties</dt>
*
* <dd><dl>
* <dt>@p options.extkey == #MCUXCLELS_AEAD_EXTERN_KEY</dt>
* <dd>@p keyIdx is ignored.
*
* @p pKey must be a valid AES key and @p keyLength a valid AES key size (see @ref MCUXCLELS_CIPHER_KEY_SIZE_AES_).</dd>
*
* <dt>@p options.extkey == #MCUXCLELS_AEAD_INTERN_KEY</dt>
* <dd>@p keyIdx must be a valid key index with the correct usage rights.
*
* @p pKey and @p keyLength are ignored.</dd>
*
* <dt>@p options.msgendw</dt>
* <dd>This field is ignored</dd>
* </dl></dd>
* </dl>
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @else
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @endif
* @retval #MCUXCLELS_STATUS_SW_INVALID_PARAM if invalid parameters were specified
* @retval #MCUXCLELS_STATUS_SW_CANNOT_INTERRUPT if a running operation prevented the request
* @retval #MCUXCLELS_STATUS_OK_WAIT on successful request
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_Aead_Finalize_Async)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_Aead_Finalize_Async(
mcuxClEls_AeadOption_t options,
mcuxClEls_KeyIndex_t keyIdx,
uint8_t const * pKey,
size_t keyLength,
size_t aadLength,
size_t dataLength,
uint8_t * pTag,
uint8_t * pAeadCtx
);
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* MCUXCLELS_AEAD_H_ */
/**
* @}
*
* @}
*/
@@ -0,0 +1,239 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2020-2023 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/**
* @file mcuxClEls_Cipher.h
* @brief ELS header for symmetric ciphers.
*
* This header exposes functions that enable using the ELS for symmetric encryption/decryption.
* The cipher algorithm supported by ELS is AES in the following modes:
* - Electronic Code Book (ECB) mode,
* - Cipher Block Chaining (CBC) mode, and
* - Counter (CTR) mode.
* Supported key sizes are 128, 192, and 256 bits.
*/
/**
* @defgroup mcuxClEls_Cipher mcuxClEls_Cipher
* @brief This part of the @ref mcuxClEls driver supports functionality for symmetric ciphers
* @ingroup mcuxClEls
* @{
*/
#ifndef MCUXCLELS_CIPHER_H_
#define MCUXCLELS_CIPHER_H_
#include <mcuxClConfig.h> // Exported features flags header
#include <mcuxClEls_Common.h> // Common functionality
#ifdef __cplusplus
extern "C" {
#endif
/**********************************************
* CONSTANTS
**********************************************/
/**
* @defgroup mcuxClEls_Cipher_Macros mcuxClEls_Cipher_Macros
* @brief Defines all macros of @ref mcuxClEls_Cipher
* @ingroup mcuxClEls_Cipher
* @{
*/
/**
* @defgroup MCUXCLELS_CIPHER_ MCUXCLELS_CIPHER_
* @brief Defines valid options to be used by #mcuxClEls_CipherOption_t
* @ingroup mcuxClEls_Cipher_Macros
*
* Valid AES key sizes in bytes
* @{
*/
#define MCUXCLELS_CIPHER_ENCRYPT 0U ///< Set this option at #mcuxClEls_CipherOption_t.dcrpt to perform an encryption
#define MCUXCLELS_CIPHER_DECRYPT 1U ///< Set this option at #mcuxClEls_CipherOption_t.dcrpt to perform a decryption
#define MCUXCLELS_CIPHER_STATE_OUT_ENABLE 1U ///< Set this option at #mcuxClEls_CipherOption_t.cphsoe to export the internal ELS state to @p pIV
#define MCUXCLELS_CIPHER_STATE_OUT_DISABLE 0U ///< Set this option at #mcuxClEls_CipherOption_t.cphsoe to not export the internal ELS state
#ifndef MCUXCL_FEATURE_ELS_NO_INTERNAL_STATE_FLAGS
#define MCUXCLELS_CIPHER_STATE_IN_ENABLE 1U ///< Set this option at #mcuxClEls_CipherOption_t.cphsie to import an external ELS state from @p pIV
#define MCUXCLELS_CIPHER_STATE_IN_DISABLE 0U ///< Set this option at #mcuxClEls_CipherOption_t.cphsie to not import an external ELS state
#endif /* MCUXCL_FEATURE_ELS_NO_INTERNAL_STATE_FLAGS */
#define MCUXCLELS_CIPHER_EXTERNAL_KEY 1U ///< Set this option at #mcuxClEls_CipherOption_t.extkey to use a key located in CPU memory provided by @p pKey
#define MCUXCLELS_CIPHER_INTERNAL_KEY 0U ///< Set this option at #mcuxClEls_CipherOption_t.extkey to use a key located in ELS keystore privded by @p keyIdx
#define MCUXCLELS_CIPHERPARAM_ALGORITHM_AES_ECB 0x00U ///< Set this option at #mcuxClEls_CipherOption_t.cphmde to use AES engine in Electornic Code Book (ECB) mode
#define MCUXCLELS_CIPHERPARAM_ALGORITHM_AES_CBC 0x01U ///< Set this option at #mcuxClEls_CipherOption_t.cphmde to use AES engine in Cipher Block Chaining (CBC) mode
#define MCUXCLELS_CIPHERPARAM_ALGORITHM_AES_CTR 0x02U ///< Set this option at #mcuxClEls_CipherOption_t.cphmde to use AES engine in Counter (CTR) mode
/**
* @}
*/
/**
* @ingroup mcuxClEls_Cipher_Macros
*/
#define MCUXCLELS_CIPHER_BLOCK_SIZE_AES ((size_t) 16U) ///< Size of an AES input block: 128 bit (16 bytes)
/**
* @defgroup MCUXCLELS_CIPHER_KEY_SIZE_AES_ MCUXCLELS_CIPHER_KEY_SIZE_AES_
* @brief Defines valid AES key sizes in bytes
* @ingroup mcuxClEls_Cipher_Macros
* @{
*/
#define MCUXCLELS_CIPHER_KEY_SIZE_AES_128 ((size_t) 16U) ///< Size of an AES128 key: 128 bit (16 bytes)
#define MCUXCLELS_CIPHER_KEY_SIZE_AES_192 ((size_t) 24U) ///< Size of an AES192 key: 192 bit (24 bytes)
#define MCUXCLELS_CIPHER_KEY_SIZE_AES_256 ((size_t) 32U) ///< Size of an AES192 key: 256 bit (32 bytes)
/**
* @}
*
* @}
*/
/**********************************************
* TYPEDEFS
**********************************************/
/**
* @defgroup mcuxClEls_Cipher_Types mcuxClEls_Cipher_Types
* @brief Defines all types of @ref mcuxClEls_Cipher
* @ingroup mcuxClEls_Cipher
* @{
*/
/**
* @brief Command option bit field for #mcuxClEls_Cipher_Async
*
* Bit field to configure #mcuxClEls_Cipher_Async. See @ref MCUXCLELS_CIPHER_ for possible options.
*/
typedef union
{
struct
{
uint32_t value; ///< Accesses the bit field as a full word
} word; ///< Access #mcuxClEls_CipherOption_t word-wise
struct
{
uint32_t :1; ///< RFU
uint32_t dcrpt :1; ///< Define operation mode
uint32_t cphmde :2; ///< Define cipher mode
uint32_t cphsoe :1; ///< Define whether the ELS internal cipher state should be extracted to external memory or kept internally
#ifndef MCUXCL_FEATURE_ELS_NO_INTERNAL_STATE_FLAGS
uint32_t cphsie :1; ///< Define whether an external provided cipher state should be imported from external memory
uint32_t :7; ///< RFU
#else
uint32_t :8; ///< RFU
#endif /* MCUXCL_FEATURE_ELS_NO_INTERNAL_STATE_FLAGS */
uint32_t extkey :1; ///< Define whether an external key from memory or ELS internal key should be used
uint32_t :18; ///< RFU
} bits; ///< Access #mcuxClEls_CipherOption_t bit-wise
} mcuxClEls_CipherOption_t;
/**
* @}
*/
/**********************************************
* FUNCTIONS
**********************************************/
/**
* @defgroup mcuxClEls_Cipher_Functions mcuxClEls_Cipher_Functions
* @brief Defines all functions of @ref mcuxClEls_Cipher
* @ingroup mcuxClEls_Cipher
* @{
*/
/**
* @brief Performs AES encryption/decryption.
*
* @if ELS_AES_WITH_SIDE_CHANNEL_PROTECTION
* Before execution, ELS will wait until #mcuxClEls_HwState_t.drbgentlvl == #MCUXCLELS_STATUS_DRBGENTLVL_LOW. This can lead to a delay if the DRBG is in a state with less security strength at the time of the call.
* @endif
*
* Performs an AES encryption/decryption. Call #mcuxClEls_WaitForOperation to complete the operation.
* @param[in] options Encryption/decryption command options. For detailed information, see #mcuxClEls_CipherOption_t.
* @param[in] keyIdx Index of the key inside the ELS keystore. See parameter properties section in function description.
* @param[in] pKey Memory area that contains the key. See parameter properties section in function description.
* @param[in] keyLength Size of @p pKey in bytes. Must be a valid key size of @ref MCUXCLELS_CIPHER_KEY_SIZE_AES_. See parameter properties section in function description.
* @param[in] pInput Pointer to the input data to be encrypted/decrypted. Padding must be already applied.
* @param[in] inputLength Size of @p pInput in bytes, must be a multiple of the block size.
* @param[in, out] pIV A pointer to the memory location which contains/receives the IV/state of cipher. See parameter properties section in function description.
* @param[out] pOutput Pointer to the output buffer to store encrypted/decrypted data.
*
* The properties of some parameters change with respect to selected options.
*
* <dl>
* <dt>Parameter properties</dt>
*
* <dd><dl>
* <dt>@p options.cphmde == #MCUXCLELS_CIPHERPARAM_ALGORITHM_AES_ECB</dt>
* <dd>@p pIV is ignored.
*
* <dt>@p options.cphmde == #MCUXCLELS_CIPHERPARAM_ALGORITHM_AES_CBC</dt>
* <dd>@p pIV must be set to the IV (when encrypting the first block) or to the last block of the ciphertext of the previous operation.
* ELS will always read and write to this location.
*
* @ifnot ELS_NO_INTERNAL_STATE_FLAGS
* @p options.cphsie is ignored.
* @endif
*
* @p options.cphsoe is ignored.</dd>
*
* <dt>@p options.cphmde == #MCUXCLELS_CIPHERPARAM_ALGORITHM_AES_CTR</dt>
* <dd>@p pIV must be set to the IV (when encrypting the first block) or to the state output of the previous
* encryption/decryption operation. ELS will write to this location if @p options.cphsoe == #MCUXCLELS_CIPHER_STATE_OUT_ENABLE.</dd>
*
* <dt>@p options.extkey == #MCUXCLELS_CIPHER_EXTERNAL_KEY</dt>
* <dd>@p keyIdx is ignored.</dd>
*
* <dt>@p options.extkey == #MCUXCLELS_CIPHER_INTERNAL_KEY</dt>
* <dd>@p pKey is ignored.
*
* @p keyLength is ignored.</dd>
*
* </dl></dd>
* </dl>
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @else
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @endif
* @retval #MCUXCLELS_STATUS_SW_CANNOT_INTERRUPT if a running operation prevented the request
* @retval #MCUXCLELS_STATUS_OK_WAIT on successful request
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_Cipher_Async)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_Cipher_Async(
mcuxClEls_CipherOption_t options,
mcuxClEls_KeyIndex_t keyIdx,
uint8_t const * pKey,
size_t keyLength,
uint8_t const * pInput,
size_t inputLength,
uint8_t * pIV,
uint8_t * pOutput
);
/**
* @}
*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* MCUXCLELS_CIPHER_H_ */
/**
* @}
*/
@@ -0,0 +1,191 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2020-2023 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/**
* @file mcuxClEls_Cmac.h
* @brief ELS header for CMAC support.
* This header exposes functions that enable using the ELS for the generation of cipher-based message authentication
* codes (CMAC).
* The supported cipher algorithm is AES-128 and AES-256.
*/
/**
* @defgroup mcuxClEls_Cmac mcuxClEls_Cmac
* @brief This part of the @ref mcuxClEls driver supports functionality for cipher-based message authentication codes (CMAC).
* @ingroup mcuxClEls
* @{
*/
#ifndef MCUXCLELS_CMAC_H_
#define MCUXCLELS_CMAC_H_
#include <mcuxClConfig.h> // Exported features flags header
#include <mcuxClEls_Common.h> // Common functionality
#ifdef __cplusplus
extern "C" {
#endif
/**********************************************
* MACROS
**********************************************/
/**
* @defgroup mcuxClEls_Cmac_Macros mcuxClEls_Cmac_Macros
* @brief Defines all macros of @ref mcuxClEls_Cmac
* @ingroup mcuxClEls_Cmac
* @{
*/
/**
* @defgroup MCUXCLELS_CMAC_KEY_SIZE_ MCUXCLELS_CMAC_KEY_SIZE_
* @brief Valid CMAC key sizes in bytes
* @ingroup mcuxClEls_Cmac_Macros
* @{ */
#define MCUXCLELS_CMAC_KEY_SIZE_128 ((size_t) 16U) ///< Size of 128 bit CMAC key (16 bytes)
#define MCUXCLELS_CMAC_KEY_SIZE_256 ((size_t) 32U) ///< Size of 256 bit CMAC key (32 bytes)
/** @} */
/**
* @defgroup MCUXCLELS_CMAC_ MCUXCLELS_CMAC_
* @brief Option values for #mcuxClEls_CmacOption_t
* @ingroup mcuxClEls_Cmac_Macros
* @{ */
#define MCUXCLELS_CMAC_EXTERNAL_KEY_ENABLE 1U ///< Set #mcuxClEls_CmacOption_t.extkey to this value to use an external key
#define MCUXCLELS_CMAC_EXTERNAL_KEY_DISABLE 0U ///< Set #mcuxClEls_CmacOption_t.extkey to this value to use a key from the ELS keystore
#define MCUXCLELS_CMAC_INITIALIZE_DISABLE 0U ///< Set #mcuxClEls_CmacOption_t.initialize to this value if the message chunk does not include the first block of the message
#define MCUXCLELS_CMAC_INITIALIZE_ENABLE 1U ///< Set #mcuxClEls_CmacOption_t.initialize to this value if the message chunk includes the first block of the message
#define MCUXCLELS_CMAC_FINALIZE_DISABLE 0U ///< Set #mcuxClEls_CmacOption_t.finalize to this value if the message chunk does not include the last block of the message
#define MCUXCLELS_CMAC_FINALIZE_ENABLE 1U ///< Set #mcuxClEls_CmacOption_t.finalize to this value if the message chunk includes the last block of the message
/**
* @}
*/
#define MCUXCLELS_CMAC_OUT_SIZE ((size_t) 16U) ///< Size of CMAC output: 128 bit (16 bytes)
/**
* @}
*/
/**********************************************
* TYPEDEFS
**********************************************/
/**
* @defgroup mcuxClEls_Cmac_Types mcuxClEls_Cmac_Types
* @brief Defines all types of @ref mcuxClEls_Cmac
* @ingroup mcuxClEls_Cmac
* @{
*/
/**
* @brief Command option bit field for #mcuxClEls_Cmac_Async.
*/
typedef union
{
struct
{
uint32_t value; ///< Accesses the bit field as a full word
} word; ///< Access #mcuxClEls_CmacOption_t word-wise
struct
{
uint32_t initialize : 1; ///< Request initial processing for the first block of the message
uint32_t finalize : 1; ///< Request final processing for the last block of the message
uint32_t soe : 1; ///< This field is managed internally
uint32_t sie : 1; ///< This field is managed internally
uint32_t :9; ///< RFU
uint32_t extkey :1; ///< An external key should be used
uint32_t :18; ///< RFU
} bits; ///< Access #mcuxClEls_CmacOption_t bit-wise
} mcuxClEls_CmacOption_t;
/**
* @}
*/
/**********************************************
* FUNCTIONS
**********************************************/
/**
* @defgroup mcuxClEls_Cmac_Functions mcuxClEls_Cmac_Functions
* @brief Defines all functions of @ref mcuxClEls_Cmac
* @ingroup mcuxClEls_Cmac
* @{
*/
/**
* @brief Performs CMAC with AES-128 or AES-256
*
* @if ELS_AES_WITH_SIDE_CHANNEL_PROTECTION
* Before execution, ELS will wait until #mcuxClEls_HwState_t.drbgentlvl == #MCUXCLELS_STATUS_DRBGENTLVL_LOW. This can lead to a delay if the DRBG is in a state with less security strength at the time of the call.
* @endif
*
* Call #mcuxClEls_WaitForOperation to complete the operation.
*
* @param[in] options The command options. For more information, see #mcuxClEls_CmacOption_t.
* @param[in] keyIdx The CMAC key index
* @param[in] pKey Pointer to the padded CMAC key
* @param[in] keyLength Size of @p pKey in bytes. Must be a @ref MCUXCLELS_CMAC_KEY_SIZE_ "valid CMAC key size". See the parameter properties section in the function description.
* @param[in] pInput Pointer to a memory location which contains the data, padded via SP 800-38b standard, to be authenticated
* @param[in] inputLength Size of @p pInput in bytes before padding
* @param[in, out] pMac Pointer to the CMAC command state input/output. See the parameter properties section in the function description.
*
* The properties of some parameters change with respect to selected options.
*
* <dl>
* <dt>Parameter properties</dt>
*
* <dd><dl>
* <dt>@p options.extkey == #MCUXCLELS_CMAC_EXTERNAL_KEY_ENABLE</dt>
* <dd>@p keyIdx is ignored.</dd>
*
* <dt>@p options.extkey == #MCUXCLELS_CMAC_EXTERNAL_KEY_DISABLE</dt>
* <dd>@p pKey is ignored.
*
* @p keyLength is ignored.</dd>
*
* <dt>(@p options.finalize == #MCUXCLELS_CMAC_FINALIZE_DISABLE)</dt>
* <dd>The intermediate state is written to @p pMac. </dd>
*
* <dt>@p options.finalize == #MCUXCLELS_CMAC_FINALIZE_ENABLE</dt>
* <dd>The resulting MAC is written to @p pMac.
*
* @p options.soe is ignored.</dd>
* </dl></dd>
* </dl>
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @else
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @endif
* @retval #MCUXCLELS_STATUS_SW_INVALID_PARAM if an invalid parameter was specified
* @retval #MCUXCLELS_STATUS_SW_CANNOT_INTERRUPT if a running operation prevented the request
* @retval #MCUXCLELS_STATUS_OK_WAIT on successful request */
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_Cmac_Async)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_Cmac_Async(
mcuxClEls_CmacOption_t options,
mcuxClEls_KeyIndex_t keyIdx,
uint8_t const * pKey,
size_t keyLength,
uint8_t const * pInput,
size_t inputLength,
uint8_t * pMac
);
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* MCUXCLELS_CMAC_H_ */
/**
* @}
*
* @}
*/
@@ -0,0 +1,848 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2020-2023 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/**
* @file mcuxClEls_Common.h
* @brief ELS header for common functionality.
*
* This header exposes functions that support hardware state management for other ELS commands.
*/
/**
* @defgroup mcuxClEls_Common mcuxClEls_Common
* @brief This part of the @ref mcuxClEls driver supports common functionality
* @ingroup mcuxClEls
* @{
*/
#ifndef MCUXCLELS_COMMON_H_
#define MCUXCLELS_COMMON_H_
#include <mcuxClConfig.h> // Exported features flags header
#include <mcuxClEls_Types.h> // Common types
#include <mcuxCsslFlowProtection.h>
#include <mcuxClCore_FunctionIdentifiers.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @defgroup mcuxClEls_Common_Macros mcuxClEls_Common_Macros
* @brief Defines all macros of @ref mcuxClEls_Common
* @ingroup mcuxClEls_Common
* @{
*/
#define MCUXCLELS_API ///< Marks a function as a public API function of the mcuxClEls component
/**********************************************
* CONSTANTS
**********************************************/
#ifdef MCUXCL_FEATURE_ELS_DMA_FINAL_ADDRESS_READBACK
#define MCUXCLELS_DMA_READBACK_PROTECTION_TOKEN MCUX_CSSL_FP_FUNCTION_CALLED(mcuxClEls_CompareDmaFinalOutputAddress)
#else
#define MCUXCLELS_DMA_READBACK_PROTECTION_TOKEN (0u)
#endif
/**
* @defgroup mcuxClEls_InterruptOptionEn_t_Macros mcuxClEls_InterruptOptionEn_t
* @brief Defines interrupt enable option values
* @ingroup mcuxClEls_Common_Macros
* @{
*/
#define MCUXCLELS_ELS_INTERRUPT_ENABLE (0x01U) ///< Set this option at #mcuxClEls_InterruptOptionEn_t.elsint to allow ELS to trigger an interrupt
#define MCUXCLELS_ELS_INTERRUPT_DISABLE (0x00U) ///< Set this option at #mcuxClEls_InterruptOptionEn_t.elsint to prevent ELS from triggering an interrupt
#ifdef MCUXCL_FEATURE_ELS_GLITCHDETECTOR
#define MCUXCLELS_GLITCH_DETECTOR_INTERRUPT_ENABLE ((uint32_t) 1U) ///< Set this option at #mcuxClEls_InterruptOptionEn_t.gdetint to allow the Glitch Detector to trigger an interrupt
#define MCUXCLELS_GLITCH_DETECTOR_INTERRUPT_DISABLE ((uint32_t) 0U) ///< Set this option at #mcuxClEls_InterruptOptionEn_t.gdetint to prevent the Glitch Detector from triggering an interrupt
#endif /* MCUXCL_FEATURE_ELS_GLITCHDETECTOR */
/**@}*/
/**
* @defgroup mcuxClEls_InterruptOptionRst_t_Macros mcuxClEls_InterruptOptionRst_t
* @brief Defines interrupt reset option values
* @ingroup mcuxClEls_Common_Macros
* @{
*/
#define MCUXCLELS_ELS_RESET_CLEAR (0x01U) ///< Set this option at #mcuxClEls_InterruptOptionRst_t.elsint to reset the ELS interrupt flag
#define MCUXCLELS_ELS_RESET_KEEP (0x00U) ///< Set this option at #mcuxClEls_InterruptOptionRst_t.elsint to keep the ELS interrupt flag
#ifdef MCUXCL_FEATURE_ELS_GLITCHDETECTOR
#define MCUXCLELS_GLITCH_DETECTOR_RESET_CLEAR ((uint32_t) 1U) ///< Set this option at #mcuxClEls_InterruptOptionRst_t.gdetint to reset the Glitch Detector interrupt flag
#define MCUXCLELS_GLITCH_DETECTOR_RESET_KEEP ((uint32_t) 0U) ///< Set this option at #mcuxClEls_InterruptOptionRst_t.gdetint to keep the Glitch Detector interrupt flag
#endif /* MCUXCL_FEATURE_ELS_GLITCHDETECTOR */
/**@}*/
/**
* @defgroup mcuxClEls_InterruptOptionSet_t_Macros mcuxClEls_InterruptOptionSet_t
* @brief Defines interrupt set option values
* @ingroup mcuxClEls_Common_Macros
* @{
*/
#define MCUXCLELS_ELS_INTERRUPT_SET (0x01U) ///< Set this option at #mcuxClEls_InterruptOptionSet_t.elsint to set the ELS interrupt flag
#define MCUXCLELS_ELS_INTERRUPT_KEEP (0x00U) ///< Set this option at #mcuxClEls_InterruptOptionSet_t.elsint to leave the ELS interrupt flag unchanged
#ifdef MCUXCL_FEATURE_ELS_GLITCHDETECTOR
#define MCUXCLELS_GLITCH_DETECTOR_NEG_SET (0x01U) ///< Set this option at #mcuxClEls_InterruptOptionSet_t.gdetint_neg to set the negative Glitch Detector interrupt flag
#define MCUXCLELS_GLITCH_DETECTOR_NEG_KEEP (0x00U) ///< Set this option at #mcuxClEls_InterruptOptionSet_t.gdetint_neg to leave the negative Glitch Detector interrupt flag unchanged
#define MCUXCLELS_GLITCH_DETECTOR_POS_SET (0x01U) ///< Set this option at #mcuxClEls_InterruptOptionSet_t.gdetint_pos to set the positive Glitch Detector interrupt flag
#define MCUXCLELS_GLITCH_DETECTOR_POS_KEEP (0x00U) ///< Set this option at #mcuxClEls_InterruptOptionSet_t.gdetint_pos to leave the positive Glitch Detector interrupt flag unchanged
#endif /* MCUXCL_FEATURE_ELS_GLITCHDETECTOR */
/**@}*/
/**
* @defgroup MCUXCLELS_ERROR_FLAGS_ MCUXCLELS_ERROR_FLAGS_
* @brief Options for error flag clearing
* @ingroup mcuxClEls_Common_Macros
* @{
*/
#define MCUXCLELS_ERROR_FLAGS_KEEP ((mcuxClEls_ErrorHandling_t) 0x0u) ///< Set this option at #mcuxClEls_ErrorHandling_t to not clear any error flags
#define MCUXCLELS_ERROR_FLAGS_CLEAR ((mcuxClEls_ErrorHandling_t) 0x1u) ///< Set this option at #mcuxClEls_ErrorHandling_t to clear all ELS error flags
/**@}*/
/**
* @defgroup MCUXCLELS_RESET_ MCUXCLELS_RESET_
* @brief Options for reset handling
* @ingroup mcuxClEls_Common_Macros
* @{
*/
#define MCUXCLELS_RESET_DO_NOT_CANCEL ((mcuxClEls_ResetOption_t) 0x0u) ///< Set this option at #mcuxClEls_ResetOption_t to abort the requested command if another ELS operation is still running
#define MCUXCLELS_RESET_CANCEL ((mcuxClEls_ResetOption_t) 0x1u) ///< Set this option at #mcuxClEls_ResetOption_t to execute the requested command even if another ELS operation is still running
/**@}*/
/**
* @defgroup MCUXCLELS_STATUS_PPROT_ MCUXCLELS_STATUS_PPROT_
* @brief Values for the privilege/security level of ELS commands
*
* Note that some keys and memory areas may only be accessible when ELS is on a certain privilege/security level.
*
* The default value, before any command has been executed, is #MCUXCLELS_STATUS_PPROT_UNPRIVILEGED_NONSECURE.
*
* @ingroup mcuxClEls_Common_Macros
* @{
*/
#define MCUXCLELS_STATUS_PPROT_UNPRIVILEGED_SECURE ((uint32_t) 0x0u) ///< This value of #mcuxClEls_HwState_t.pprot means that the most recently started ELS operation was or is running in unprivileged secure mode
#define MCUXCLELS_STATUS_PPROT_PRIVILEGED_SECURE ((uint32_t) 0x1u) ///< This value of #mcuxClEls_HwState_t.pprot means that the most recently started ELS operation was or is running in privileged secure mode
#define MCUXCLELS_STATUS_PPROT_UNPRIVILEGED_NONSECURE ((uint32_t) 0x2u) ///< This value of #mcuxClEls_HwState_t.pprot means that the most recently started ELS operation was or is running in unprivileged non-secure mode
#define MCUXCLELS_STATUS_PPROT_PRIVILEGED_NONSECURE ((uint32_t) 0x3u) ///< This value of #mcuxClEls_HwState_t.pprot means that the most recently started ELS operation was or is running in privileged non-secure mode
/**@}*/
/**
* @defgroup MCUXCLELS_STATUS_ECDSAVFY_ MCUXCLELS_STATUS_ECDSAVFY_
* @brief ECDSA verify check values
* @ingroup mcuxClEls_Common_Macros
* @{
*/
#define MCUXCLELS_STATUS_ECDSAVFY_NORUN ((uint32_t) 0x0u) ///< This value of #mcuxClEls_HwState_t.ecdsavfy means that no ECDSA verify operation has been executed
#define MCUXCLELS_STATUS_ECDSAVFY_FAIL ((uint32_t) 0x1u) ///< This value of #mcuxClEls_HwState_t.ecdsavfy means that the most recently finished ECDSA signature verification failed
#define MCUXCLELS_STATUS_ECDSAVFY_OK ((uint32_t) 0x2u) ///< This value of #mcuxClEls_HwState_t.ecdsavfy means that the most recently finished ECDSA signature verification passed
#define MCUXCLELS_STATUS_ECDSAVFY_ERROR ((uint32_t) 0x3u) ///< This value of #mcuxClEls_HwState_t.ecdsavfy means that an error has occurred
/**@}*/
/**
* @defgroup MCUXCLELS_STATUS_DRBGENTLVL_ MCUXCLELS_STATUS_DRBGENTLVL_
* @brief Constants for Entropy quality of the current DRBG instance
* @ingroup mcuxClEls_Common_Macros
* @{ */
#define MCUXCLELS_STATUS_DRBGENTLVL_NONE ((uint32_t) 0x0u) ///< This value of #mcuxClEls_HwState_t.drbgentlvl means that the DRBG is not running
#define MCUXCLELS_STATUS_DRBGENTLVL_LOW ((uint32_t) 0x1u) ///< This value of #mcuxClEls_HwState_t.drbgentlvl means that the DRBG can generate random numbers with a low security strength (sufficient for commands with a low DRBG security strength requirement, see the function description to check which level is required)
#define MCUXCLELS_STATUS_DRBGENTLVL_HIGH ((uint32_t) 0x2u) ///< This value of #mcuxClEls_HwState_t.drbgentlvl means that the DRBG can generate random numbers with 128 bits of security strength (sufficient for commands with a high DRBG security strength requirement, see the function description to check which level is required)
/** @} */
#ifdef MCUXCL_FEATURE_ELS_LOCKING
/**
* @defgroup MCUXCLELS_LOCKING_ MCUXCLELS_LOCKING_
* @brief Constants for ELS locking feature
* @ingroup mcuxClEls_Common_Macros
* @{ */
#define MCUXCLELS_MASTER_UNLOCK_ANY ((uint32_t) 0x1Fu) ///< Any bus master ID can override ELS lock
/** @} */
#endif /* MCUXCL_FEATURE_ELS_LOCKING */
/**
* @}
*/
/**********************************************
* TYPEDEFS
**********************************************/
/**
* @defgroup mcuxClEls_Common_Types mcuxClEls_Common_Types
* @brief Defines all types of @ref mcuxClEls_Common
* @ingroup mcuxClEls_Common
* @{
*/
/**
* @brief Result type of #mcuxClEls_GetHwVersion
*
* Contains the ELS version value.
*/
typedef union
{
struct
{
uint32_t value; ///< Accesses the bit field as a full word
} word; ///< Access #mcuxClEls_HwVersion_t word-wise
struct
{
uint32_t revision :4; ///< Revision number
uint32_t minor :8; ///< Minor version
uint32_t major :4; ///< Major version
#ifndef MCUXCL_FEATURE_ELS_GET_FW_VERSION
uint32_t level :4; ///< Release level version
uint32_t :12; ///< RFU
#else /* MCUXCL_FEATURE_ELS_GET_FW_VERSION */
uint32_t fw_revision :4; ///< Firmware Revision number
uint32_t fw_minor :8; ///< Firmware Minor version
uint32_t fw_major :4; ///< Firmware Major version
#endif /* MCUXCL_FEATURE_ELS_GET_FW_VERSION */
} bits; ///< Access #mcuxClEls_HwVersion_t bit-wise
} mcuxClEls_HwVersion_t;
/**
* @brief Result type of #mcuxClEls_GetHwState
*
* Contains ELS status information.
*/
typedef union
{
struct
{
uint32_t value; ///< Accesses the bit field as a full word
} word; ///< Access #mcuxClEls_HwState_t word-wise
struct
{
uint32_t busy :1; ///< ELS is busy
uint32_t irq :1; ///< ELS interrupt activated
uint32_t err :1; ///< ELS is in error state
uint32_t prngready :1; ///< ELS PRNG is seeded and ready to use
uint32_t ecdsavfy :2; ///< ECDSA verify operation state (For possible values of this field, see @ref MCUXCLELS_STATUS_ECDSAVFY_)
uint32_t pprot :2; ///< The privilege/security level of the most recently started ELS command (For possible values of this field, see @ref MCUXCLELS_STATUS_PPROT_)
uint32_t drbgentlvl :2; ///< Entropy quality of the current DRBG instance (For possible values of this field, see @ref MCUXCLELS_STATUS_DRBGENTLVL_)
uint32_t dtrng_busy: 1; ///< Indicates the DTRNG is gathering entropy
#ifdef MCUXCL_FEATURE_ELS_GLITCHDETECTOR
uint32_t gdet_pos :1; ///< Glitch detector interrupt activated (positive)
uint32_t gdet_neg :1; ///< Glitch detector interrupt activated (negative)
#else
uint32_t :2; ///< RFU
#endif /* MCUXCL_FEATURE_ELS_GLITCHDETECTOR */
uint32_t :3; ///< RFU
#ifdef MCUXCL_FEATURE_ELS_LOCKING
uint32_t els_locked :1; ///< ELS is locked
#else
uint32_t :1; ///< RFU
#endif /* MCUXCL_FEATURE_ELS_LOCKING */
uint32_t :15; ///< RFU
} bits; ///< Access #mcuxClEls_HwState_t bit-wise
} mcuxClEls_HwState_t;
/**
* @brief Type to handle ELS error clearing options
*
* For possible values, see @ref MCUXCLELS_ERROR_FLAGS_.
*/
typedef uint32_t mcuxClEls_ErrorHandling_t;
/**
* @brief Type to handle ELS reset options
*
* For possible values, see @ref MCUXCLELS_RESET_.
*/
typedef uint32_t mcuxClEls_ResetOption_t;
/**
* @brief Command option type for #mcuxClEls_SetIntEnableFlags and #mcuxClEls_GetIntEnableFlags
*
* Used to get/set ELS interrupt enable options.
*/
typedef union
{
struct
{
uint32_t value; ///< Accesses the bit field as a full word
} word; ///< Access #mcuxClEls_InterruptOptionEn_t word-wise
struct
{
uint32_t elsint :1; ///< Whether ELS interrupt should be used. (For possible values of this field, see @ref mcuxClEls_InterruptOptionEn_t_Macros)
#ifdef MCUXCL_FEATURE_ELS_GLITCHDETECTOR
uint32_t gdetint :1; ///< Whether Glitch detector interrupt should be used. (For possible values of this field, see @ref mcuxClEls_InterruptOptionEn_t_Macros)
#else
uint32_t :1; ///< RFU
#endif /* MCUXCL_FEATURE_ELS_GLITCHDETECTOR */
uint32_t :30; ///< RFU
} bits; ///< Access #mcuxClEls_InterruptOptionEn_t bit-wise
} mcuxClEls_InterruptOptionEn_t;
/**
* @brief Type to control which ELS interrupts should be reset when calling #mcuxClEls_ResetIntFlags
*/
typedef union
{
struct
{
uint32_t value; ///< Accesses the bit field as a full word
} word; ///< Access #mcuxClEls_InterruptOptionRst_t word-wise
struct
{
uint32_t elsint :1; ///< Whether ELS interrupt should be reset. (For possible values of this field, see @ref mcuxClEls_InterruptOptionRst_t_Macros)
#ifdef MCUXCL_FEATURE_ELS_GLITCHDETECTOR
uint32_t gdetint :1; ///< Whether Glitch detector interrupt should be reset. (For possible values of this field, see @ref mcuxClEls_InterruptOptionRst_t_Macros)
#else
uint32_t :1; ///< RFU
#endif /* MCUXCL_FEATURE_ELS_GLITCHDETECTOR */
uint32_t :30; ///< RFU
} bits; ///< Access #mcuxClEls_InterruptOptionRst_t bit-wise
} mcuxClEls_InterruptOptionRst_t;
/**
* @brief Type to control which ELS interrupts should be set when calling #mcuxClEls_SetIntFlags
*/
typedef union
{
struct
{
uint32_t value; ///< Accesses the bit field as a full word
} word; ///< Access #mcuxClEls_InterruptOptionSet_t word-wise
struct
{
uint32_t elsint :1; ///< Whether ELS interrupt should be set. (For possible values of this field, see @ref mcuxClEls_InterruptOptionSet_t_Macros)
#ifdef MCUXCL_FEATURE_ELS_GLITCHDETECTOR
uint32_t gdetint_neg :1;///< Whether Glitch detector neg interrupt should be set. (For possible values of this field, see @ref mcuxClEls_InterruptOptionSet_t_Macros)
uint32_t gdetint_pos :1;///< Whether Glitch detector pos interrupt should be set. (For possible values of this field, see @ref mcuxClEls_InterruptOptionSet_t_Macros)
#else
uint32_t :2; ///< RFU
#endif /* MCUXCL_FEATURE_ELS_GLITCHDETECTOR */
uint32_t :29; ///< RFU
} bits; ///< Access #mcuxClEls_InterruptOptionSet_t bit-wise
} mcuxClEls_InterruptOptionSet_t;
/**
* @brief Result type of #mcuxClEls_GetHwConfig
*
* Contains ELS configuration values.
*/
typedef union
{
struct
{
uint32_t value; ///< Accesses the bit field as a full word
} word; ///< Access #mcuxClEls_InterruptOptionSet_t word-wise
struct
{
uint32_t ciphersup :1; ///< Indicates whether the cipher command is supported
uint32_t authciphersup :1; ///< Indicates whether the auth_cipher command is supported
uint32_t ecsignsup :1; ///< Indicates whether the ecsign command is supported
uint32_t ecvfysup :1; ///< Indicates whether the ecvfy command is supported
uint32_t eckxchsup :1; ///< Indicates whether the dhkey_xch command is supported
uint32_t keygensup :1; ///< Indicates whether the keygen command is supported
uint32_t keyinsup :1; ///< Indicates whether the keyin command is supported
uint32_t keyoutsup :1; ///< Indicates whether the keyout command is supported
uint32_t kdeletesup :1; ///< Indicates whether the kdelete command is supported
uint32_t keyprovsup :1; ///< Indicates whether the keyprov command is supported
uint32_t ckdfsup :1; ///< Indicates whether the ckdf command is supported
uint32_t hkdfsup :1; ///< Indicates whether the hkdf command is supported
uint32_t tlsinitsup :1; ///< Indicates whether the tls_init command is supported
uint32_t hashsup :1; ///< Indicates whether the hash command is supported
uint32_t hmacsup :1; ///< Indicates whether the hmac command is supported
uint32_t cmacsup :1; ///< Indicates whether the cmac command is supported
uint32_t drbgreqsup :1; ///< Indicates whether the drbg_req command is supported
uint32_t drbgtestsup :1; ///< Indicates whether the drbg_test command is supported
uint32_t dtrgncfgloadsup :1; ///< Indicates whether the dtrng_cfg_load command is is supported
uint32_t dtrngevalsup :1; ///< Indicates whether the dtrng_eval command is supported
uint32_t gdetcfgloadsup :1; ///< Indicates whether the gdet_cfg_load command is supported
uint32_t gdettrimsup :1; ///< Indicates whether the gdet_trim command is supported
uint32_t :10; ///< RFU
} bits; ///< Access #mcuxClEls_InterruptOptionSet_t bit-wise
} mcuxClEls_HwConfig_t;
#define drbgreqsub drbgreqsup ///< Deprecated name for #mcuxClEls_HwConfig_t.drbgreqsup
/**
* @}
*/
/**********************************************
* FUNCTIONS
**********************************************/
/**
* @defgroup mcuxClEls_Common_Functions mcuxClEls_Common_Functions
* @brief Defines all functions of @ref mcuxClEls_Common
* @ingroup mcuxClEls_Common
* @{
*/
/**
* @brief Determines the version of the underlying ELS hardware IP.
*
* @attention This header was delivered as part of a CLNS release which is compatible with a specific ELS hardware IP version.
*
* @param[out] result Pointer which will be filled with the ELS hardware version
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code is always #MCUXCLELS_STATUS_OK
* @else
* @return An error code that is always #MCUXCLELS_STATUS_OK
* @endif
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_GetHwVersion)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_GetHwVersion(
mcuxClEls_HwVersion_t * result
);
#ifdef MCUXCL_FEATURE_ELS_HWCONFIG
/**
* @brief Determines the hardware configuration of the underlying ELS hardware IP.
*
* @param[out] result Pointer which will be filled with the ELS hardware configuration
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code is always #MCUXCLELS_STATUS_OK
* @else
* @return An error code that is always #MCUXCLELS_STATUS_OK
* @endif
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_GetHwConfig)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_GetHwConfig(
mcuxClEls_HwConfig_t * result
);
#endif /* MCUXCL_FEATURE_ELS_HWCONFIG */
/**
* @brief Determines the current state of the ELS.
*
* @param[out] result Pointer which will be filled with the ELS status information
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code is always #MCUXCLELS_STATUS_OK
* @else
* @return An error code that is always #MCUXCLELS_STATUS_OK
* @endif
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_GetHwState)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_GetHwState(
mcuxClEls_HwState_t * result
);
/**
* @brief Enables the ELS.
*
* Call #mcuxClEls_WaitForOperation to complete the operation.
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code is always #MCUXCLELS_STATUS_OK_WAIT
* @else
* @return An error code that is always #MCUXCLELS_STATUS_OK_WAIT
* @endif
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_Enable_Async)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_Enable_Async(
void
);
/**
* @brief Perform a synchronous reset of the ELS.
*
* This means that:
* - any running ELS command will be stopped,
* - all errors will be cleared,
* - all keys will be deleted,
* - any RNG entropy will be discarded,
* - the glitch detector will be reset and
* - the run-time fingerprint will be restored to its default value.
*
* Call #mcuxClEls_WaitForOperation to complete the operation.
*
* @param[in] options A value indicating whether any running ELS operations shall be canceled
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @else
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @endif
*
* @retval #MCUXCLELS_STATUS_SW_CANNOT_INTERRUPT if a running operation prevented the reset
* @retval #MCUXCLELS_STATUS_OK_WAIT on successful request
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_Reset_Async)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_Reset_Async(
mcuxClEls_ResetOption_t options
);
/**
* @brief Disable the ELS.
*
* This is useful as a power saving mechanism.
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code is always #MCUXCLELS_STATUS_OK
* @else
* @return An error code that is always #MCUXCLELS_STATUS_OK
* @endif
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_Disable)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_Disable(
void
);
/**
* @brief Set interrupt enable flags.
*
* @param[in] options The command options, determining which interrupts should be enabled or disabled. For more information, see #mcuxClEls_InterruptOptionEn_t.
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code is always #MCUXCLELS_STATUS_OK
* @else
* @return An error code that is always #MCUXCLELS_STATUS_OK
* @endif
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_SetIntEnableFlags)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_SetIntEnableFlags(
mcuxClEls_InterruptOptionEn_t options
);
/**
* @brief Get interrupt enable flags.
*
* @param[out] result Pointer which is filled with the configuration of the interrupts enable register.
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code is always #MCUXCLELS_STATUS_OK
* @else
* @return An error code that is always #MCUXCLELS_STATUS_OK
* @endif
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_GetIntEnableFlags)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_GetIntEnableFlags(
mcuxClEls_InterruptOptionEn_t * result
);
/**
* @brief Clear the interrupt status register.
*
* @param[in] options The command options, determining which interrupt status bits should be cleared. For more information, see #mcuxClEls_InterruptOptionRst_t.
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code is always #MCUXCLELS_STATUS_OK
* @else
* @return An error code that is always #MCUXCLELS_STATUS_OK
* @endif
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_ResetIntFlags)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_ResetIntFlags(
mcuxClEls_InterruptOptionRst_t options
);
/**
* @brief Set the interrupt status register, for debug and testing purposes.
*
* @param[in] options The command options, determining which interrupt status bits should be set. For more information, see #mcuxClEls_InterruptOptionSet_t.
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code is always #MCUXCLELS_STATUS_OK
* @else
* @return An error code that is always #MCUXCLELS_STATUS_OK
* @endif
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_SetIntFlags)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_SetIntFlags(
mcuxClEls_InterruptOptionSet_t options
);
/**
* @brief Wait for an ELS operation and optionally clear the error status.
*
* If an ELS operation is active, this function waits for completion of that operation. For this, the
* busy flag of ELS is polled. Additionally, this function checks and returns any applicable error indication.
* If no operation is active, the function returns immediately.
*
* @param[in] errorHandling Define if error flags shall be cleared.
*
* @retval #MCUXCLELS_STATUS_OK if the last operation was successful, or no operation was active
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @else
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @endif
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_WaitForOperation)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_WaitForOperation(
mcuxClEls_ErrorHandling_t errorHandling
);
/**
* @brief Await the completion of an ELS operation for a limited amount of time and optionally clear the error status.
*
* If an ELS operation is active, this function waits for completion of that operation until a counter expires.
* For this, the busy flag of ELS is polled. The counting mechanism behaves like a simple for-loop from
* @p counterLimit to one. This counter does not have a well-defined relationship to real-world time.
* Additionally, this function checks and returns any applicable error indication.
* If no operation is active, the function returns immediately.
*
* @param[in] counterLimit The limit of the wait counter.
* @param[in] errorHandling Define if error flags shall be cleared.
*
* @retval #MCUXCLELS_STATUS_OK if the last operation was successful, or no operation was active
* @retval #MCUXCLELS_STATUS_SW_COUNTER_EXPIRED if the counter expired while waiting for the operation to complete
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @else
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @endif
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_LimitedWaitForOperation)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_LimitedWaitForOperation(
uint32_t counterLimit,
mcuxClEls_ErrorHandling_t errorHandling
);
/**
* @brief Resets all error flags that have been set by a previous operation.
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code is always #MCUXCLELS_STATUS_OK
* @else
* @return An error code that is always #MCUXCLELS_STATUS_OK
* @endif
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_ResetErrorFlags)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_ResetErrorFlags(
void);
/**
* @brief Get the last ELS error code and optionally clear the error status.
*
* @param[in] errorHandling Define if error flags shall be cleared.
*
* @retval #MCUXCLELS_STATUS_OK if the last operation was successful or no operation was active
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @else
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @endif
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_GetErrorCode)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_GetErrorCode(
mcuxClEls_ErrorHandling_t errorHandling
);
/**
* @brief Get the last ELS error code and level and optionally clear the error status.
*
* @param[in] errorHandling Define if error flags shall be cleared.
* @param[out] errorLevel Pointer to the location that will receive the value of the error level.
*
* @retval #MCUXCLELS_STATUS_OK if the last operation was successful or no operation was active
* @retval #MCUXCLELS_STATUS_ if the last operation resulted in an error
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @else
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @endif
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_GetErrorLevel)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_GetErrorLevel(
mcuxClEls_ErrorHandling_t errorHandling,
uint32_t *errorLevel
);
/**
* @brief Set the random start delay for AES based operations. This impacts mcuxClEls_Aead_*, mcuxClEls_Cipher_*, mcuxClEls_Cmac_*, ncpClEls_Ckdf_*, mcuxClEls_KeyImport_Async, mcuxClEls_KeyExport_Async
*
* @param[in] startDelay Define the max random start delay. Acceptable values are a power of 2 minus one, starting from 0 to 1023 (0, 1, 3, 7, ..., 1023).
*
* @retval #MCUXCLELS_STATUS_OK if the operation was successful
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @else
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @endif
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_SetRandomStartDelay)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_SetRandomStartDelay(
uint32_t startDelay
);
/**
* @brief Get the random start delay for AES based operations.
*
* @param[out] startDelay Pointer to store random start delay configuration.
*
* @retval #MCUXCLELS_STATUS_OK if the operation was successful
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @else
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @endif
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_GetRandomStartDelay)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_GetRandomStartDelay(
uint32_t * startDelay
);
#ifdef MCUXCL_FEATURE_ELS_LOCKING
/**
* @brief Lock ELS to a session
*
* This operation locks the ELS, when the lock is obtained a nonzero value will be stored in @p sessionId, and the PPROT and bus Master ID
* of the locking command will be recorded. Subsequent unlocking can only be done by one of the following:
* 1. ELS reset
* 2. Normal unlock: calling #mcuxClEls_ReleaseLock with the correct @p sessionId, from the same bus Master ID and using the same PPROT settings.
* 3. Privileged unlock: calling #mcuxClEls_ReleaseLock with any value of @p sessionId, from the bus Master ID set with the #mcuxClEls_SetMasterUnlock
* command and PPROT settings 'secure privileged'.
* While ELS is locked read access is only permitted to ELS_STATUS and ELS_SESSION_ID and writes are only permitted to ELS_RESET, except for accesses that
* have the same bus Master ID and PPROT settings.
*
* @param[out] pSessionId The session identifier assigned to the lock, it is required to unlock the session, it will be zero when a lock could not be obtained.
*
* @retval #MCUXCLELS_STATUS_OK if the operation was successful
* @retval #MCUXCLELS_STATUS_SW_LOCKING_FAILED if the operation was not successful
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @else
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @endif
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_GetLock)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_GetLock(
uint32_t * pSessionId
);
/**
* @brief Release ELS lock for the session
*
* This operation unlocks the ELS when following conditions are met:
* 1. Normal unlock: providing the correct @p sessionId, from the same bus Master ID and using the same PPROT settings.
* 2. Privileged unlock: providing any value of @p sessionId, from the bus Master ID set with the #mcuxClEls_SetMasterUnlock command
* and PPROT settings 'secure privileged'.
* Invalid attempts to unlock ELS will result in a bus error.
*
* @param[in] sessionId The session identifier obtained while locking ELS
*
* @retval #MCUXCLELS_STATUS_OK if the operation was successful
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @else
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @endif
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_ReleaseLock)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_ReleaseLock(
uint32_t sessionId
);
/**
* @brief Check if ELS is locked
*
* This operation returns the locking status of ELS.
*
* @retval #MCUXCLELS_STATUS_OK if the operation was successful and ELS is not locked
* @retval #MCUXCLELS_STATUS_SW_STATUS_LOCKED if the operation was successful and ELS is locked
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @else
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @endif
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_IsLocked)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_IsLocked(void);
/**
* @brief Set the bus master ID that can unlock ELS
*
* This operation sets the bus master ID of the master that can override ELS lock. This command can only be executed once after reset.
* Invalid attempts to set the bus master ID will result in a bus error.
*
* @param[in] masterId The bus master identifier that can override the ELS lock. Special value #MCUXCLELS_MASTER_UNLOCK_ANY allows any bus master identifier to override the ELS lock.
*
* @retval #MCUXCLELS_STATUS_OK if the operation was successful
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @else
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @endif
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_SetMasterUnlock)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_SetMasterUnlock(
uint32_t masterId
);
#endif /* MCUXCL_FEATURE_ELS_LOCKING */
#ifdef MCUXCL_FEATURE_ELS_DMA_ADDRESS_READBACK
/**
* @brief Reads back the last address processed by the ELS DMA (security feature)
*
* @param[out] pLastAddress Pointer to the last address read/written by the ELS DMA
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code is always #MCUXCLELS_STATUS_OK
* @else
* @return An error code that is always #MCUXCLELS_STATUS_OK
* @endif
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_GetLastDmaAddress)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_GetLastDmaAddress(
uint32_t* pLastAddress
);
#endif /* MCUXCL_FEATURE_ELS_DMA_ADDRESS_READBACK */
#ifdef MCUXCL_FEATURE_ELS_DMA_FINAL_ADDRESS_READBACK
/**
* @brief Compares the last address processed by the ELS DMA with the expected final address of the output buffer given to the last ELS command (security feature).
* The given address @p outputStartAddress and expected length @p expectedLength determine the expected final address.
* This function can be used to verify that the final DMA transfer of an ELS command has completed as expected.
*
* @param[in] outputStartAddress Pointer to the output buffer of the last ELS operation
* @param[in] expectedLength Expected length of the output buffer of the last ELS operation
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @else
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @endif
*
* @retval #MCUXCLELS_STATUS_SW_COMPARISON_FAILED if the comparison between the expected final address and the actual final address processed by ELS fails
* @retval #MCUXCLELS_STATUS_OK_WAIT if the comparison was successful
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_CompareDmaFinalOutputAddress)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_CompareDmaFinalOutputAddress(
uint8_t *outputStartAddress,
size_t expectedLength
);
#endif /* MCUXCL_FEATURE_ELS_DMA_FINAL_ADDRESS_READBACK */
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* MCUXCLELS_COMMON_H_ */
/**
* @}
*
* @}
*/
@@ -0,0 +1,637 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2021-2023 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/**
* @file mcuxClEls_Crc.h
* @brief ELS header for Command CRC functionality.
*
* This header exposes functions that support the usage of the Command CRC feature for ELS.
*/
/**
* @defgroup mcuxClEls_Crc mcuxClEls_Crc
* @brief This part of the @ref mcuxClEls driver defines the Command CRC functionality
* @ingroup mcuxClEls
* @{
*/
#ifndef MCUXCLELS_CRC_H_
#define MCUXCLELS_CRC_H_
#include <mcuxClConfig.h> // Exported features flags header
#include <mcuxClEls_Types.h> // Common types
#include <mcuxCsslFlowProtection.h>
#include <mcuxClCore_FunctionIdentifiers.h>
#ifdef __cplusplus
extern "C" {
#endif
/**********************************************
* CONSTANTS
**********************************************/
/**
* @defgroup mcuxClEls_Crc_Macros mcuxClEls_Crc_Macros
* @brief Defines all macros of @ref mcuxClEls_Crc
* @ingroup mcuxClEls_Crc
* @{
*/
/**
* @defgroup MCUXCLELS_CMD_CRC_ MCUXCLELS_CMD_CRC_
* @brief Constants for ELS Command CRC
* @ingroup mcuxClEls_Crc_Macros
* @{ */
#define MCUXCLELS_CMD_CRC_VALUE_RESET ((uint32_t) 0x1u) ///< Reset the Command CRC to initial value
#define MCUXCLELS_CMD_CRC_VALUE_ENABLE ((uint32_t) 0x2u) ///< Enable update of Command CRC value by executing commands
#define MCUXCLELS_CMD_CRC_VALUE_DISABLE ((uint32_t) 0x0u) ///< Disable update of Command CRC value by executing commands
#define MCUXCLELS_CMD_CRC_RESET ((uint32_t) 0x1u) ///< Reset the Command CRC to initial value
#define MCUXCLELS_CMD_CRC_ENABLE ((uint32_t) 0x1u) ///< Enable update of Command CRC value by executing commands
#define MCUXCLELS_CMD_CRC_DISABLE ((uint32_t) 0x0u) ///< Disable update of Command CRC value by executing commands
#define MCUXCLELS_CMD_CRC_POLYNOMIAL ((uint32_t) 0x04C11DB7u) ///< CRC polynomial for the Command CRC
#define MCUXCLELS_CMD_CRC_INITIAL_VALUE ((uint32_t) 0xA5A5A5A5u) ///< Initial value for the Command CRC
/** @} */
/**
* @defgroup MCUXCLELS_CMD_CRC_REFERENCE_ MCUXCLELS_CMD_CRC_REFERENCE_
* @brief Macros for reference ELS Command CRC
* @ingroup mcuxClEls_Crc_Macros
* @{
*/
/**
* @brief Initializes a reference CRC variable with the command CRC initial value.
* The new variable has the given name.
*/
#define MCUXCLELS_CMD_CRC_REFERENCE_INIT(crc) \
uint32_t (crc) = MCUXCLELS_CMD_CRC_INITIAL_VALUE
/**
* @brief Resets the given reference CRC variable to the command CRC initial value.
*/
#define MCUXCLELS_CMD_CRC_REFERENCE_RESET(crc) \
(crc) = MCUXCLELS_CMD_CRC_INITIAL_VALUE
/**
* @brief Updates given reference command CRC with command @ref mcuxClEls_Aead_Init_Async.
*/
#ifndef MCUXCL_FEATURE_ELS_NO_INTERNAL_STATE_FLAGS
#define MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_AEAD_INIT(crc, options) \
({ \
(options).bits.acpmod = MCUXCLELS_AEAD_ACPMOD_INIT; \
(options).bits.lastinit = MCUXCLELS_AEAD_LASTINIT_TRUE; \
(options).bits.acpsie = MCUXCLELS_AEAD_STATE_IN_DISABLE; \
(options).bits.acpsoe = MCUXCLELS_AEAD_STATE_OUT_ENABLE; \
mcuxClEls_Status_t retVal = mcuxClEls_UpdateRefCRC(MCUXCLELS_CMD_CRC_CMD_ID_AUTH_CIPHER, (options).word.value, &(crc)); \
(retVal); \
})
#else
#define MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_AEAD_INIT(crc, options) \
({ \
(options).bits.acpmod = MCUXCLELS_AEAD_ACPMOD_INIT; \
(options).bits.lastinit = MCUXCLELS_AEAD_LASTINIT_TRUE; \
(options).bits.acpsie = MCUXCLELS_AEAD_STATE_IN_DISABLE; \
mcuxClEls_Status_t retVal = mcuxClEls_UpdateRefCRC(MCUXCLELS_CMD_CRC_CMD_ID_AUTH_CIPHER, (options).word.value, &(crc)); \
(retVal); \
})
#endif /* MCUXCL_FEATURE_ELS_NO_INTERNAL_STATE_FLAGS */
/**
* @brief Updates given reference command CRC with command @ref mcuxClEls_Aead_PartialInit_Async.
*/
#ifndef MCUXCL_FEATURE_ELS_NO_INTERNAL_STATE_FLAGS
#define MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_AEAD_PARTIALINIT(crc, options) \
({ \
(options).bits.acpmod = MCUXCLELS_AEAD_ACPMOD_INIT; \
(options).bits.acpsoe = MCUXCLELS_AEAD_STATE_OUT_ENABLE; \
mcuxClEls_Status_t retVal = mcuxClEls_UpdateRefCRC(MCUXCLELS_CMD_CRC_CMD_ID_AUTH_CIPHER, (options).word.value, &(crc)); \
(retVal); \
})
#else
#define MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_AEAD_PARTIALINIT(crc, options) \
({ \
(options).bits.acpmod = MCUXCLELS_AEAD_ACPMOD_INIT; \
mcuxClEls_Status_t retVal = mcuxClEls_UpdateRefCRC(MCUXCLELS_CMD_CRC_CMD_ID_AUTH_CIPHER, (options).word.value, &(crc)); \
(retVal); \
})
#endif /* MCUXCL_FEATURE_ELS_NO_INTERNAL_STATE_FLAGS */
/**
* @brief Updates given reference command CRC with command @ref mcuxClEls_Aead_UpdateAad_Async.
*/
#ifndef MCUXCL_FEATURE_ELS_NO_INTERNAL_STATE_FLAGS
#define MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_AEAD_UPDATEAAD(crc, options) \
({ \
(options).bits.acpmod = MCUXCLELS_AEAD_ACPMOD_AADPROC \
(options).bits.acpsie = MCUXCLELS_AEAD_STATE_IN_ENABLE; \
(options).bits.acpsoe = MCUXCLELS_AEAD_STATE_OUT_ENABLE; \
mcuxClEls_Status_t retVal = mcuxClEls_UpdateRefCRC(MCUXCLELS_CMD_CRC_CMD_ID_AUTH_CIPHER, (options).word.value, &(crc)); \
(retVal); \
})
#else
#define MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_AEAD_UPDATEAAD(crc, options) \
({ \
(options).bits.acpmod = MCUXCLELS_AEAD_ACPMOD_AADPROC; \
mcuxClEls_Status_t retVal = mcuxClEls_UpdateRefCRC(MCUXCLELS_CMD_CRC_CMD_ID_AUTH_CIPHER, (options).word.value, &(crc)); \
(retVal); \
})
#endif /* MCUXCL_FEATURE_ELS_NO_INTERNAL_STATE_FLAGS */
/**
* @brief Updates given reference command CRC with command @ref mcuxClEls_Aead_UpdateData_Async.
*/
#ifndef MCUXCL_FEATURE_ELS_NO_INTERNAL_STATE_FLAGS
#define MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_AEAD_UPDATEDATA(crc, options) \
({ \
(options).bits.acpmod = MCUXCLELS_AEAD_ACPMOD_MSGPROC \
(options).bits.acpsie = MCUXCLELS_AEAD_STATE_IN_ENABLE; \
(options).bits.acpsoe = MCUXCLELS_AEAD_STATE_OUT_ENABLE; \
mcuxClEls_Status_t retVal = mcuxClEls_UpdateRefCRC(MCUXCLELS_CMD_CRC_CMD_ID_AUTH_CIPHER, (options).word.value, &(crc)); \
(retVal); \
})
#else
#define MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_AEAD_UPDATEDATA(crc, options) \
({ \
(options).bits.acpmod = MCUXCLELS_AEAD_ACPMOD_MSGPROC; \
mcuxClEls_Status_t retVal = mcuxClEls_UpdateRefCRC(MCUXCLELS_CMD_CRC_CMD_ID_AUTH_CIPHER, (options).word.value, &(crc)); \
(retVal); \
})
#endif /* MCUXCL_FEATURE_ELS_NO_INTERNAL_STATE_FLAGS */
/**
* @brief Updates given reference command CRC with command @ref mcuxClEls_Aead_Finalize_Async.
*/
#ifndef MCUXCL_FEATURE_ELS_NO_INTERNAL_STATE_FLAGS
#define MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_AEAD_FINALIZE(crc, options) \
({ \
(options).bits.acpmod = MCUXCLELS_AEAD_ACPMOD_FINAL \
(options).bits.acpsie = MCUXCLELS_AEAD_STATE_IN_ENABLE; \
mcuxClEls_Status_t retVal = mcuxClEls_UpdateRefCRC(MCUXCLELS_CMD_CRC_CMD_ID_AUTH_CIPHER, (options).word.value, &(crc)); \
(retVal); \
})
#else
#define MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_AEAD_FINALIZE(crc, options) \
({ \
(options).bits.acpmod = MCUXCLELS_AEAD_ACPMOD_FINAL; \
mcuxClEls_Status_t retVal = mcuxClEls_UpdateRefCRC(MCUXCLELS_CMD_CRC_CMD_ID_AUTH_CIPHER, (options).word.value, &(crc)); \
(retVal); \
})
#endif /* MCUXCL_FEATURE_ELS_NO_INTERNAL_STATE_FLAGS */
/**
* @brief Updates given reference command CRC with command @ref mcuxClEls_Cipher_Async.
*/
#define MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_CIPHER(crc, options) \
mcuxClEls_UpdateRefCRC(MCUXCLELS_CMD_CRC_CMD_ID_CIPHER, (options).word.value, &(crc))
/**
* @brief Updates given reference command CRC with command @ref mcuxClEls_Cmac_Async.
*/
#define MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_CMAC(crc, options) \
mcuxClEls_UpdateRefCRC(MCUXCLELS_CMD_CRC_CMD_ID_CMAC, (options).word.value, &(crc))
/**
* @brief Updates given reference command CRC with command @ref mcuxClEls_EccKeyGen_Async.
*/
#define MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_ECCKEYGEN(crc, options) \
({ \
(options).bits.revf = MCUXCLELS_ECC_REVERSEFETCH_ENABLE; \
mcuxClEls_Status_t retVal = mcuxClEls_UpdateRefCRC(MCUXCLELS_CMD_CRC_CMD_ID_KEYGEN, (options).word.value, &(crc)); \
(retVal); \
})
/**
* @brief Updates given reference command CRC with command @ref mcuxClEls_EccKeyExchange_Async.
*/
#ifdef MCUXCL_FEATURE_ELS_PUK_INTERNAL_BIT
#define MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_ECCKEYEXCHANGE(crc) \
({ \
mcuxClEls_EccKeyExchOption_t options = {0u}; \
options.bits.revf = MCUXCLELS_ECC_REVERSEFETCH_ENABLE; \
options.bits.extkey = MCUXCLELS_ECC_EXTKEY_EXTERNAL; \
mcuxClEls_Status_t retVal = mcuxClEls_UpdateRefCRC(MCUXCLELS_CMD_CRC_CMD_ID_ECKXH, options.word.value, &(crc)); \
(retVal); \
})
#else
#define MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_ECCKEYEXCHANGE(crc) \
({ \
mcuxClEls_EccKeyExchOption_t options = {0u}; \
options.bits.revf = MCUXCLELS_ECC_REVERSEFETCH_ENABLE; \
mcuxClEls_Status_t retVal = mcuxClEls_UpdateRefCRC(MCUXCLELS_CMD_CRC_CMD_ID_ECKXH, options.word.value, &(crc)); \
(retVal); \
})
#endif /* MCUXCL_FEATURE_ELS_PUK_INTERNAL_BIT */
#ifdef MCUXCL_FEATURE_ELS_PUK_INTERNAL
/**
* @brief Updates given reference command CRC with command @ref mcuxClEls_EccKeyExchangeInt_Async.
*/
#define MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_ECCKEYEXCHANGEINT(crc) \
({ \
mcuxClEls_EccKeyExchOption_t options = {0u}; \
options.bits.revf = MCUXCLELS_ECC_REVERSEFETCH_ENABLE; \
options.bits.extkey = MCUXCLELS_ECC_EXTKEY_INTERNAL; \
mcuxClEls_Status_t retVal = mcuxClEls_UpdateRefCRC(MCUXCLELS_CMD_CRC_CMD_ID_ECKXH, options.word.value, &(crc)); \
(retVal); \
})
#endif /* MCUXCL_FEATURE_ELS_PUK_INTERNAL */
/**
* @brief Updates given reference command CRC with command @ref mcuxClEls_EccSign_Async.
*/
#define MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_ECCSIGN(crc, options) \
({ \
(options).bits.revf = MCUXCLELS_ECC_REVERSEFETCH_ENABLE; \
mcuxClEls_Status_t retVal = mcuxClEls_UpdateRefCRC(MCUXCLELS_CMD_CRC_CMD_ID_ECSIGN, (options).word.value, &(crc)); \
(retVal); \
})
/**
* @brief Updates given reference command CRC with command @ref mcuxClEls_EccVerify_Async.
*/
#ifdef MCUXCL_FEATURE_ELS_PUK_INTERNAL_BIT
#define MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_ECCVERFIFY(crc, options) \
({ \
(options).bits.revf = MCUXCLELS_ECC_REVERSEFETCH_ENABLE; \
(options).bits.extkey = MCUXCLELS_ECC_EXTKEY_EXTERNAL; \
mcuxClEls_Status_t retVal = mcuxClEls_UpdateRefCRC(MCUXCLELS_CMD_CRC_CMD_ID_ECVFY, (options).word.value, &(crc)); \
(retVal); \
})
#else
#define MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_ECCVERFIFY(crc, options) \
({ \
(options).bits.revf = MCUXCLELS_ECC_REVERSEFETCH_ENABLE; \
mcuxClEls_Status_t retVal = mcuxClEls_UpdateRefCRC(MCUXCLELS_CMD_CRC_CMD_ID_ECVFY, (options).word.value, &(crc)); \
(retVal); \
})
#endif /* MCUXCL_FEATURE_ELS_PUK_INTERNAL_BIT */
#ifdef MCUXCL_FEATURE_ELS_PUK_INTERNAL
/**
* @brief Updates given reference command CRC with command @ref mcuxClEls_EccVerifyInt_Async.
*/
#define MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_ECCVERFIFYINT(crc, options) \
({ \
(options).bits.revf = MCUXCLELS_ECC_REVERSEFETCH_ENABLE; \
(options).bits.extkey = MCUXCLELS_ECC_EXTKEY_INTERNAL; \
mcuxClEls_Status_t retVal = mcuxClEls_UpdateRefCRC(MCUXCLELS_CMD_CRC_CMD_ID_ECVFY, (options).word.value, &(crc)); \
(retVal); \
})
#endif /* MCUXCL_FEATURE_ELS_PUK_INTERNAL */
/**
* @brief Updates given reference command CRC with command @ref mcuxClEls_GlitchDetector_LoadConfig_Async.
*/
#define MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_GLITCHDETECTOR_LOADCONFIG(crc) \
mcuxClEls_UpdateRefCRC(MCUXCLELS_CMD_CRC_CMD_ID_GDET_CFG_LOAD, 0u, &(crc))
/**
* @brief Updates given reference command CRC with command @ref mcuxClEls_GlitchDetector_Trim_Async.
*/
#define MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_GLITCHDETECTOR_TRIM(crc) \
mcuxClEls_UpdateRefCRC(MCUXCLELS_CMD_CRC_CMD_ID_GDET_TRIM, 0u, &(crc))
/**
* @brief Updates given reference command CRC with command @ref mcuxClEls_Hash_Async.
*/
#define MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_HASH(crc, options) \
mcuxClEls_UpdateRefCRC(MCUXCLELS_CMD_CRC_CMD_ID_HASH, (options).word.value, &(crc))
/**
* @brief Updates given reference command CRC with command @ref mcuxClEls_Hmac_Async.
*/
#define MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_HMAC(crc, options) \
mcuxClEls_UpdateRefCRC(MCUXCLELS_CMD_CRC_CMD_ID_HMAC, (options).word.value, &(crc))
/**
* @brief Updates given reference command CRC with command @ref mcuxClEls_Ckdf_Sp800108_Async.
*/
#define MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_CKDF_SP800108(crc) \
({ \
mcuxClEls_CkdfOption_t options = {0u}; \
options.bits.ckdf_algo = MCUXCLELS_CKDF_ALGO_SP800108; \
mcuxClEls_Status_t retVal = mcuxClEls_UpdateRefCRC(MCUXCLELS_CMD_CRC_CMD_ID_CKDF, options.word.value, &(crc)); \
(retVal); \
})
/**
* @brief Updates given reference command CRC with command @ref mcuxClEls_Hkdf_Rfc5869_Async.
*/
#define MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_HKDF_RFC5869(crc, options) \
({ \
(options).bits.hkdf_algo = MCUXCLELS_HKDF_ALGO_RFC5869; \
mcuxClEls_Status_t retVal = mcuxClEls_UpdateRefCRC(MCUXCLELS_CMD_CRC_CMD_ID_HKDF, (options).word.value, &(crc)); \
(retVal); \
})
/**
* @brief Updates given reference command CRC with command @ref mcuxClEls_Hkdf_Sp80056c_Async.
*/
#define MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_HKDF_SP80056C(crc) \
({ \
mcuxClEls_HkdfOption_t options = {0u}; \
options.bits.hkdf_algo = MCUXCLELS_HKDF_ALGO_SP80056C; \
mcuxClEls_Status_t retVal = mcuxClEls_UpdateRefCRC(MCUXCLELS_CMD_CRC_CMD_ID_HKDF, options.word.value, &(crc)); \
(retVal); \
})
/**
* @brief Updates given reference command CRC with command @ref mcuxClEls_TlsGenerateMasterKeyFromPreMasterKey_Async.
*/
#define MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_TLSGENERATEMASTERKEYFROMPREMASTERKEY(crc) \
({ \
mcuxClEls_TlsOption_t options = {0u}; \
options.bits.mode = MCUXCLELS_TLS_INIT; \
mcuxClEls_Status_t retVal = mcuxClEls_UpdateRefCRC(MCUXCLELS_CMD_CRC_CMD_ID_TLS, options.word.value, &(crc)); \
(retVal); \
})
/**
* @brief Updates given reference command CRC with command @ref mcuxClEls_TlsGenerateSessionKeysFromMasterKey_Async.
*/
#define MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_TLSGENERATESESSIONKEYSFROMMASTERKEY(crc) \
({ \
mcuxClEls_TlsOption_t options = {0u}; \
options.bits.mode = MCUXCLELS_TLS_FINALIZE; \
mcuxClEls_Status_t retVal = mcuxClEls_UpdateRefCRC(MCUXCLELS_CMD_CRC_CMD_ID_TLS, options.word.value, &(crc)); \
(retVal); \
})
/**
* @brief Updates given reference command CRC with command @ref mcuxClEls_KeyDelete_Async.
*/
#define MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_KEYDELETE(crc) \
mcuxClEls_UpdateRefCRC(MCUXCLELS_CMD_CRC_CMD_ID_KDELETE, 0u, &(crc))
/**
* @brief Updates given reference command CRC with command @ref mcuxClEls_KeyImport_Async.
*/
#define MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_KEYIMPORT(crc, options) \
mcuxClEls_UpdateRefCRC(MCUXCLELS_CMD_CRC_CMD_ID_KEYIN, (options).word.value, &(crc))
#ifdef MCUXCL_FEATURE_ELS_PUK_INTERNAL
/**
* @brief Updates given reference command CRC with command @ref mcuxClEls_KeyImportPuk_Async.
*/
#define MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_KEYIMPORTPUK(crc) \
({ \
mcuxClEls_KeyImportOption_t options = {0u}; \
options.bits.revf = MCUXCLELS_KEYIMPORT_REVERSEFETCH_ENABLE; \
options.bits.kfmt = MCUXCLELS_KEYIMPORT_KFMT_PBK; \
mcuxClEls_Status_t retVal = mcuxClEls_UpdateRefCRC(MCUXCLELS_CMD_CRC_CMD_ID_KEYIN, options.word.value, &(crc)); \
(retVal); \
})
#endif /* MCUXCL_FEATURE_ELS_PUK_INTERNAL */
/**
* @brief Updates given reference command CRC with command @ref mcuxClEls_KeyExport_Async.
*/
#define MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_KEYEXPORT(crc) \
({ \
mcuxClEls_Status_t retVal = mcuxClEls_UpdateRefCRC(MCUXCLELS_CMD_CRC_CMD_ID_KEYOUT, 0u, &(crc)); \
mcuxClEls_KeyImportOption_t import_options = {0u}; \
import_options.bits.kfmt = MCUXCLELS_KEYIMPORT_KFMT_RFC3394; \
retVal = MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_KEYDELETE(crc); \
retVal = MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_KEYIMPORT(crc, import_options); \
(retVal); \
})
/**
* @brief Updates given reference command CRC with command @ref mcuxClEls_Rng_DrbgRequest_Async.
*/
#define MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_RNG_DRBGREQUEST(crc) \
mcuxClEls_UpdateRefCRC(MCUXCLELS_CMD_CRC_CMD_ID_RND_REQ, 0u, &(crc))
#ifdef MCUXCL_FEATURE_ELS_RND_RAW
/**
* @brief Updates given reference command CRC with command @ref mcuxClEls_Rng_DrbgRequestRaw_Async.
*/
#define MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_RNG_DRBGREQUESTRAW(crc) \
mcuxClEls_UpdateRefCRC(MCUXCLELS_CMD_CRC_CMD_ID_RND_REQ, MCUXCLELS_RNG_RND_REQ_RND_RAW, &(crc))
#endif /* MCUXCL_FEATURE_ELS_RND_RAW */
/**
* @brief Updates given reference command CRC with command @ref mcuxClEls_Rng_DrbgTestInstantiate_Async.
*/
#define MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_RNG_DRBGTESTINSTANTIATE(crc) \
mcuxClEls_UpdateRefCRC(MCUXCLELS_CMD_CRC_CMD_ID_DRBG_TEST, MCUXCLELS_RNG_DRBG_TEST_MODE_INSTANTIATE, &(crc))
/**
* @brief Updates given reference command CRC with command @ref mcuxClEls_Rng_DrbgTestExtract_Async.
*/
#define MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_RNG_DRBGTESTEXTRACT(crc) \
mcuxClEls_UpdateRefCRC(MCUXCLELS_CMD_CRC_CMD_ID_DRBG_TEST, MCUXCLELS_RNG_DRBG_TEST_MODE_EXTRACT, &(crc))
/**
* @brief Updates given reference command CRC with command @ref mcuxClEls_Rng_DrbgTestAesEcb_Async.
*/
#define MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_RNG_DRBGTESTAESECB(crc) \
mcuxClEls_UpdateRefCRC(MCUXCLELS_CMD_CRC_CMD_ID_DRBG_TEST, MCUXCLELS_RNG_DRBG_TEST_MODE_AES_ECB, &(crc))
/**
* @brief Updates given reference command CRC with command @ref mcuxClEls_Rng_DrbgTestAesCtr_Async.
*/
#define MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_RNG_DRBGTESTAESCTR(crc) \
mcuxClEls_UpdateRefCRC(MCUXCLELS_CMD_CRC_CMD_ID_DRBG_TEST, MCUXCLELS_RNG_DRBG_TEST_MODE_AES_CTR, &(crc))
/**
* @brief Updates given reference command CRC with command @ref mcuxClEls_Rng_Dtrng_ConfigLoad_Async.
*/
#define MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_RNG_DTRNG_CONFIGLOAD(crc) \
mcuxClEls_UpdateRefCRC(MCUXCLELS_CMD_CRC_CMD_ID_DTRNG_CFG_LOAD, 0u, &(crc))
/**
* @brief Updates given reference command CRC with command @ref mcuxClEls_Rng_Dtrng_ConfigEvaluate_Async.
*/
#define MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_RNG_DTRNG_CONFIGEVALUATE(crc) \
mcuxClEls_UpdateRefCRC(MCUXCLELS_CMD_CRC_CMD_ID_DTRNG_EVAL, 0u, &(crc))
#ifdef MCUXCL_FEATURE_ELS_PRND_INIT
/**
* @brief Updates given reference command CRC with command @ref mcuxClEls_Prng_Init_Async.
*/
#define MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_PRNG_INIT(crc) \
mcuxClEls_UpdateRefCRC(MCUXCLELS_CMD_CRC_CMD_ID_RND_REQ, MCUXCLELS_RNG_RND_REQ_PRND_INIT, &(crc))
#endif /* MCUXCL_FEATURE_ELS_PRND_INIT */
/**
* @}
*/
/**
* @defgroup MCUXCLELS_CMD_CRC_CMD_ID_ MCUXCLELS_CMD_CRC_CMD_ID_
* @brief Constants for ELS Command IDs
* @ingroup mcuxClEls_Crc_Macros
* @{
*/
#define MCUXCLELS_CMD_CRC_CMD_ID_CIPHER 0 ///< ELS Command ID for CIPHER command
#define MCUXCLELS_CMD_CRC_CMD_ID_AUTH_CIPHER 1 ///< ELS Command ID for AUTH_CIPHER command
#define MCUXCLELS_CMD_CRC_CMD_ID_CHAL_RESP_GEN 3 ///< ELS Command ID for CHAL_RESP_GEN command
#define MCUXCLELS_CMD_CRC_CMD_ID_ECSIGN 4 ///< ELS Command ID for ECSIGN command
#define MCUXCLELS_CMD_CRC_CMD_ID_ECVFY 5 ///< ELS Command ID for ECVFY command
#define MCUXCLELS_CMD_CRC_CMD_ID_ECKXH 6 ///< ELS Command ID for ECKXH command
#define MCUXCLELS_CMD_CRC_CMD_ID_KEYGEN 8 ///< ELS Command ID for KEYGEN command
#define MCUXCLELS_CMD_CRC_CMD_ID_KEYIN 9 ///< ELS Command ID for KEYIN command
#define MCUXCLELS_CMD_CRC_CMD_ID_KEYOUT 10 ///< ELS Command ID for KEYOUT command
#define MCUXCLELS_CMD_CRC_CMD_ID_KDELETE 11 ///< ELS Command ID for KDELETE command
#define MCUXCLELS_CMD_CRC_CMD_ID_KEYPROV 12 ///< ELS Command ID for KEYPROV command
#define MCUXCLELS_CMD_CRC_CMD_ID_CKDF 16 ///< ELS Command ID for CKDF command
#define MCUXCLELS_CMD_CRC_CMD_ID_HKDF 17 ///< ELS Command ID for HKDF command
#define MCUXCLELS_CMD_CRC_CMD_ID_TLS 18 ///< ELS Command ID for TLS command
#define MCUXCLELS_CMD_CRC_CMD_ID_HASH 20 ///< ELS Command ID for HASH command
#define MCUXCLELS_CMD_CRC_CMD_ID_HMAC 21 ///< ELS Command ID for HMAC command
#define MCUXCLELS_CMD_CRC_CMD_ID_CMAC 22 ///< ELS Command ID for CMAC command
#define MCUXCLELS_CMD_CRC_CMD_ID_RND_REQ 24 ///< ELS Command ID for RND_REQ command
#define MCUXCLELS_CMD_CRC_CMD_ID_DRBG_TEST 25 ///< ELS Command ID for DRBG_TEST command
#define MCUXCLELS_CMD_CRC_CMD_ID_DTRNG_CFG_LOAD 28 ///< ELS Command ID for DTRNG_CFG_LOAD command
#define MCUXCLELS_CMD_CRC_CMD_ID_DTRNG_EVAL 29 ///< ELS Command ID for DTRNG_EVAL command
#define MCUXCLELS_CMD_CRC_CMD_ID_GDET_CFG_LOAD 30 ///< ELS Command ID for GDET_CFG_LOAD command
#define MCUXCLELS_CMD_CRC_CMD_ID_GDET_TRIM 31 ///< ELS Command ID for GDET_TRIM command
/**
* @}
*
* @}
*/
/**********************************************
* TYPEDEFS
**********************************************/
/**
* @defgroup mcuxClEls_Crc_Types mcuxClEls_Crc_Types
* @brief Defines all types of @ref mcuxClEls_Crc
* @ingroup mcuxClEls_Crc
* @{
*/
/**
* @brief Type to control ELS Command CRC
*/
typedef union
{
struct
{
uint32_t value; ///< Accesses the bit field as a full word
} word;
struct
{
uint32_t reset :1; ///< Reset the Command CRC to initial value, set by #MCUXCLELS_CMD_CRC_RESET
uint32_t enable :1; ///< Enable/Disable update of Command CRC value by executing commands, set with #MCUXCLELS_CMD_CRC_ENABLE / #MCUXCLELS_CMD_CRC_DISABLE
uint32_t : 30; ///< RFU
} bits; ///< Access #mcuxClEls_CommandCrcConfig_t bit-wise
} mcuxClEls_CommandCrcConfig_t;
/**
* @}
*/
/**********************************************
* FUNCTIONS
**********************************************/
/**
* @defgroup mcuxClEls_Crc_Functions mcuxClEls_Crc_Functions
* @brief Defines all functions of @ref mcuxClEls_Crc
* @ingroup mcuxClEls_Crc
* @{
*/
/**
* @brief Set command CRC flags.
*
* @param[in] options The command CRC options. For more information, see #mcuxClEls_CommandCrcConfig_t.
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code is always #MCUXCLELS_STATUS_OK
* @else
* @return An error code that is always #MCUXCLELS_STATUS_OK
* @endif
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_ConfigureCommandCRC)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_ConfigureCommandCRC(
mcuxClEls_CommandCrcConfig_t options
);
/**
* @brief Get the current command CRC value.
*
* @param[out] commandCrc The command CRC value.
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection).
* @retval MCUXCLELS_STATUS_OK Operation successful
* @retval MCUXCLELS_STATUS_SW_INVALID_PARAM Parameter commandCRC points to NULL
* @else
* @return An error code
* @retval MCUXCLELS_STATUS_OK Operation successful
* @retval MCUXCLELS_STATUS_SW_INVALID_PARAM Parameter commandCRC points to NULL
* @endif
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_GetCommandCRC)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_GetCommandCRC(
uint32_t* commandCrc
);
/**
* @brief Verifies a reference CRC against the computed ELS command CRC.
*
* @param[in] refCrc The reference CRC value.
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @else
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @endif
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_VerifyVsRefCRC)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_VerifyVsRefCRC(
uint32_t refCrc
);
/**
* @brief Updates a reference CRC with the parameters of an ELS command.
* This can be used to verify against the ELS command CRC.
*
* @param[in] command The ELS command ID.
* @param[in] options The command options for the given ELS command.
* @param[in,out] refCrc The current reference CRC value to update.
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection).
* @retval MCUXCLELS_STATUS_OK Operation successful
* @retval MCUXCLELS_STATUS_SW_INVALID_PARAM Parameter crc points to NULL
* @else
* @return An error code
* @retval MCUXCLELS_STATUS_OK Operation successful
* @retval MCUXCLELS_STATUS_SW_INVALID_PARAM Parameter crc points to NULL
* @endif
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_UpdateRefCRC)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_UpdateRefCRC(
uint8_t command,
uint32_t options,
uint32_t* refCrc
);
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* MCUXCLELS_CRC_H_ */
/**
* @}
*
* @}
*/
@@ -0,0 +1,593 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2020-2023 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/**
* @file mcuxClEls_Ecc.h
* @brief ELS header for elliptic curve cryptography
* This header exposes functions that enable using the ELS for elliptic curve cryptography.
* All functions operate on the NIST P-256 curve.
* The ECC operations supported are:
* - ECC key generation
* - ECC Diffie-Hellman key exchange
* - ECDSA signature generation/verification
*/
#ifndef MCUXCLELS_ECC_H_
#define MCUXCLELS_ECC_H_
#include <mcuxClConfig.h> // Exported features flags header
#include <mcuxClEls_Common.h> // Common types & functionality
#ifdef __cplusplus
extern "C" {
#endif
/**
* @defgroup mcuxClEls_Ecc mcuxClEls_Ecc
* @brief This part of the @ref mcuxClEls driver supports functionality for elliptic curve cryptography
* @ingroup mcuxClEls
* @{
*/
/**********************************************
* CONSTANTS
**********************************************/
/**
* @defgroup mcuxClEls_Ecc_Macros mcuxClEls_Ecc_Macros
* @brief Defines all macros of @ref mcuxClEls_Ecc
* @ingroup mcuxClEls_Ecc
* @{
*/
/**
* @defgroup MCUXCLELS_ECC_VALUE_ MCUXCLELS_ECC (Sign and Verify) option word values
* @brief Constants for #mcuxClEls_EccSignOption_t and #mcuxClEls_EccVerifyOption_t
* @ingroup mcuxClEls_Ecc_Macros
* @{
*/
#define MCUXCLELS_ECC_VALUE_HASHED ((uint32_t) 0u<< 0u) ///< Set this option at #mcuxClEls_EccSignOption_t.value or #mcuxClEls_EccVerifyOption_t.value to specify input is the hash of the message
#define MCUXCLELS_ECC_VALUE_NOT_HASHED ((uint32_t) 1u<< 0u) ///< Set this option at #mcuxClEls_EccSignOption_t.value or #mcuxClEls_EccVerifyOption_t.value to specify input is the plain message
#define MCUXCLELS_ECC_VALUE_RTF ((uint32_t) 1u<< 1u) ///< Set this option at #mcuxClEls_EccSignOption_t.value to include the RTF in the signature, only for #mcuxClEls_EccSignOption_t
#define MCUXCLELS_ECC_VALUE_NO_RTF ((uint32_t) 0u<< 1u) ///< Set this option at #mcuxClEls_EccSignOption_t.value to not include the RTF in the signature, only for #mcuxClEls_EccSignOption_t
/**
* @}
*/
/**
* @defgroup MCUXCLELS_KEYGEN_VALUE_ MCUXCLELS_KEYGEN option word values
* @brief Constants for #mcuxClEls_EccKeyGenOption_t
* @ingroup mcuxClEls_Ecc_Macros
* @{
*/
#define MCUXCLELS_KEYGEN_VALUE_SIGN_PUBLICKEY ((uint32_t) 1u<< 0u) ///< Set this option at #mcuxClEls_EccKeyGenOption_t.value to sign the public key
#define MCUXCLELS_KEYGEN_VALUE_TYPE_SIGN ((uint32_t) 0u<< 1u) ///< Set this option at #mcuxClEls_EccKeyGenOption_t.value to specify output key will be a signing key usable by #mcuxClEls_EccSign_Async
#define MCUXCLELS_KEYGEN_VALUE_TYPE_KEYEXCHANGE ((uint32_t) 1u<< 1u) ///< Set this option at #mcuxClEls_EccKeyGenOption_t.value to specify output key will be a Diffie Helman key usable by #mcuxClEls_EccKeyExchange_Async
#define MCUXCLELS_KEYGEN_VALUE_DETERMINISTIC ((uint32_t) 0u<< 2u) ///< Set this option at #mcuxClEls_EccKeyGenOption_t.value to specify output key is deterministic
#define MCUXCLELS_KEYGEN_VALUE_RANDOM ((uint32_t) 1u<< 2u) ///< Set this option at #mcuxClEls_EccKeyGenOption_t.value to specify output key is random
#define MCUXCLELS_KEYGEN_VALUE_GEN_PUB_KEY ((uint32_t) 0u<< 3u) ///< Set this option at #mcuxClEls_EccKeyGenOption_t.value to generate a public key
#define MCUXCLELS_KEYGEN_VALUE_NO_PUB_KEY ((uint32_t) 1u<< 3u) ///< Set this option at #mcuxClEls_EccKeyGenOption_t.value to not generate a public key
#define MCUXCLELS_KEYGEN_VALUE_NO_RANDOM_DATA ((uint32_t) 0u<< 5u) ///< Set this option at #mcuxClEls_EccKeyGenOption_t.value to not use random data for signing the public key
#define MCUXCLELS_KEYGEN_VALUE_USE_RANDOM_DATA ((uint32_t) 1u<< 5u) ///< Set this option at #mcuxClEls_EccKeyGenOption_t.value to use random data for signing the public key
/**
* @}
*/
/**
* @defgroup MCUXCLELS_ECC_VALUE_BITS MCUXCLELS_ECC (Sign and Verify) option bit field values
* @brief Bit field constants for #mcuxClEls_EccSignOption_t and #mcuxClEls_EccVerifyOption_t
* @ingroup mcuxClEls_Ecc_Macros
* @{
*/
#define MCUXCLELS_ECC_HASHED ((uint32_t) 0U) ///< Set this option at #mcuxClEls_EccSignOption_t.echashchl or #mcuxClEls_EccVerifyOption_t.echashchl to specify input is the hash of the message
#define MCUXCLELS_ECC_NOT_HASHED ((uint32_t) 1U) ///< Set this option at #mcuxClEls_EccSignOption_t.echashchl or #mcuxClEls_EccVerifyOption_t.echashchl to specify input is the plain message
#define MCUXCLELS_ECC_RTF ((uint32_t) 1U) ///< Set this option at #mcuxClEls_EccSignOption_t.signrtf to include the RTF in the signature
#define MCUXCLELS_ECC_NO_RTF ((uint32_t) 0U) ///< Set this option at #mcuxClEls_EccSignOption_t.signrtf to not include the RTF in the signature
/**
* @}
*/
/**
* @defgroup MCUXCLELS_KEYGEN_VALUE_BITS MCUXCLELS_KEYGEN option bit field values
* @brief Bit field constants for #mcuxClEls_EccKeyGenOption_t
* @ingroup mcuxClEls_Ecc_Macros
* @{
*/
#define MCUXCLELS_ECC_PUBLICKEY_SIGN_ENABLE (1U) ///< Set this option at #mcuxClEls_EccKeyGenOption_t.kgsign to sign the public key (signature will be concatenated to the output public key)
#define MCUXCLELS_ECC_PUBLICKEY_SIGN_DISABLE (0U) ///< Set this option at #mcuxClEls_EccKeyGenOption_t.kgsign to not sign the public key
#define MCUXCLELS_ECC_OUTPUTKEY_SIGN (0U) ///< Set this option at #mcuxClEls_EccKeyGenOption_t.kgtypedh to specify output key will be a signing key usable by #mcuxClEls_EccSign_Async
#define MCUXCLELS_ECC_OUTPUTKEY_KEYEXCHANGE (1U) ///< Set this option at #mcuxClEls_EccKeyGenOption_t.kgtypedh to specify output key will be a Diffie Helman key usable by #mcuxClEls_EccKeyExchange_Async
#define MCUXCLELS_ECC_OUTPUTKEY_DETERMINISTIC (0U) ///< Set this option at #mcuxClEls_EccKeyGenOption_t.kgsrc to specify output key is deterministic
#define MCUXCLELS_ECC_OUTPUTKEY_RANDOM (1U) ///< Set this option at #mcuxClEls_EccKeyGenOption_t.kgsrc to specify output key is random
#define MCUXCLELS_ECC_GEN_PUBLIC_KEY (0U) ///< Set this option at #mcuxClEls_EccKeyGenOption_t.skip_pbk to generate a public key
#define MCUXCLELS_ECC_SKIP_PUBLIC_KEY (1U) ///< Set this option at #mcuxClEls_EccKeyGenOption_t.skip_pbk to not generate a public key.
///< If #MCUXCLELS_ECC_OUTPUTKEY_KEYEXCHANGE set, this option will be ignored and a public key will be generated.
#define MCUXCLELS_ECC_NO_RANDOM_DATA (0U) ///< Set this option at #mcuxClEls_EccKeyGenOption_t.kgsign_rnd to not include user provided random data for the signature
#define MCUXCLELS_ECC_INCLUDE_RANDOM_DATA (1U) ///< Set this option at #mcuxClEls_EccKeyGenOption_t.kgsign_rnd to include user provided random data for the signature.
///< #MCUXCLELS_ECC_PUBLICKEY_SIGN_ENABLE must be set in this case.
/**
* @}
*/
/**
* @defgroup MCUXCLELS_INTERNAL_VALUE_BITS Option bit field values that are needed for internal use only
* @brief Internal bit field constants for several option types.
* @ingroup mcuxClEls_Ecc_Macros
* @{
*/
#define MCUXCLELS_ECC_REVERSEFETCH_ENABLE (0x01U) ///< Reverse Fetch enabled. For internal use
#define MCUXCLELS_ECC_REVERSEFETCH_DISABLE (0x00U) ///< Reverse Fetch disabled. For internal use
#ifdef MCUXCL_FEATURE_ELS_PUK_INTERNAL_BIT
#define MCUXCLELS_ECC_EXTKEY_EXTERNAL (0x01U) ///< Public key is taken from system memory. For internal use
#define MCUXCLELS_ECC_EXTKEY_INTERNAL (0x00U) ///< Public key is taken from internal keystore. For internal use
#endif /* MCUXCL_FEATURE_ELS_PUK_INTERNAL_BIT */
/**
* @}
*/
/**
* @defgroup MCUXCLELS_ECC_SIZE MCUXCLELS_ECC_SIZE
* @brief Defines size of public key and signature in bytes
* @ingroup mcuxClEls_Ecc_Macros
* @{
*/
#define MCUXCLELS_ECC_PUBLICKEY_SIZE ((size_t) 64U) ///< Size of the public key
#define MCUXCLELS_ECC_SIGNATURE_SIZE ((size_t) 64U) ///< Size of the signature
#define MCUXCLELS_ECC_SIGNATURE_R_SIZE ((size_t) 32U) ///< Size of the signature part r
/**
* @}
*/
/**
* @}
*/ /* mcuxClEls_Ecc_Macros */
/**********************************************
* TYPEDEFS
**********************************************/
/**
* @defgroup mcuxClEls_Ecc_Types mcuxClEls_Ecc_Types
* @brief Defines all types of @ref mcuxClEls_Ecc
* @ingroup mcuxClEls_Ecc
* @{
*/
/**
* @brief Data type for ECC parameters in ELS format
* @deprecated All ELS ECC functions now operate on uint8_t. This type will be removed soon.
*/
typedef uint8_t mcuxClEls_EccByte_t;
/**
* @brief Command option bit field for #mcuxClEls_EccSign_Async
* Bit field to configure #mcuxClEls_EccSign_Async. See @ref MCUXCLELS_ECC_VALUE_BITS for possible options.
*/
typedef union
{
struct
{
uint32_t value; ///< Access the bit field as a full word; initialize with a combination of constants from @ref MCUXCLELS_ECC_VALUE_
} word; ///< Access #mcuxClEls_EccSignOption_t word-wise
struct
{
uint32_t echashchl :1; ///< Define type of input, plain message or hash of message
uint32_t signrtf :1; ///< Define if signing the Run-Time Fingerprint
uint32_t :2; ///< RFU
uint32_t revf :1; ///< This field is managed internally
uint32_t :27; ///< RFU
} bits; ///< Access #mcuxClEls_EccSignOption_t bit-wise
} mcuxClEls_EccSignOption_t;
/**
* @brief Command option bit field for #mcuxClEls_EccVerify_Async
* Bit field to configure #mcuxClEls_EccVerifyOption_t. See @ref MCUXCLELS_ECC_VALUE_BITS for possible options.
*/
typedef union
{
struct
{
uint32_t value; ///< Access the bit field as a full word; initialize with a combination of constants from @ref MCUXCLELS_ECC_VALUE_
} word; ///< Access #mcuxClEls_EccVerifyOption_t word-wise
struct
{
uint32_t echashchl :1; ///< Define type of input, plain message or hash of message
uint32_t :3; ///< RFU
uint32_t revf :1; ///< This field is managed internally
#ifdef MCUXCL_FEATURE_ELS_PUK_INTERNAL_BIT
uint32_t :8; ///< RFU
uint32_t extkey :1; ///< This field is managed internally
uint32_t :18; ///< RFU
#else
uint32_t :27; ///< RFU
#endif /* MCUXCL_FEATURE_ELS_PUK_INTERNAL_BIT */
} bits; ///< Access #mcuxClEls_EccVerifyOption_t bit-wise
} mcuxClEls_EccVerifyOption_t;
/**
* @brief Command option bit field for #mcuxClEls_EccKeyGen_Async
* Bit field to configure #mcuxClEls_EccKeyGenOption_t. See @ref MCUXCLELS_KEYGEN_VALUE_BITS for possible options.
*/
typedef union
{
struct
{
uint32_t value; ///< Accesses the bit field as a full word; initialize with a combination of constants from @ref MCUXCLELS_KEYGEN_VALUE_
} word; ///< Access #mcuxClEls_EccKeyGenOption_t word-wise
struct
{
uint32_t kgsign :1; ///< Define if signing the output public key
uint32_t kgtypedh :1; ///< Define the usage of the output key
uint32_t kgsrc :1; ///< Define if the output key is deterministic or random
uint32_t skip_pbk :1; ///< Define if generating a public key
uint32_t revf :1; ///< This field is managed internally
uint32_t kgsign_rnd :1; ///< Define if using user provided random data for the signature.
uint32_t :26; ///< RFU
} bits; ///< Access #mcuxClEls_EccKeyGenOption_t bit-wise
} mcuxClEls_EccKeyGenOption_t;
/**
* @brief Command option bit field for #mcuxClEls_EccKeyExchange_Async, for internal use only.
* Bit field to configure #mcuxClEls_EccKeyExchOption_t.
*/
typedef union
{
struct
{
uint32_t value; ///< Accesses the bit field as a full word
} word; ///< Access #mcuxClEls_EccKeyExchOption_t word-wise
struct
{
uint32_t :4; ///< RFU
uint32_t revf :1; ///< This field is managed internally
uint32_t :8; ///< RFU
uint32_t extkey :1; ///< This field is managed internally
uint32_t :18; ///< RFU
} bits; ///< Access #mcuxClEls_EccKeyExchOption_t bit-wise
} mcuxClEls_EccKeyExchOption_t;
/**
* @}
*/ /* mcuxClEls_Ecc_Types */
/**********************************************
* FUNCTIONS
**********************************************/
/**
* @defgroup mcuxClEls_Ecc_Functions mcuxClEls_Ecc_Functions
* @brief Defines all functions of @ref mcuxClEls_Ecc
* @ingroup mcuxClEls_Ecc
* @{
*/
/**
* @brief Generates an ECC key pair on the NIST P-256 curve.
*
* Before execution, ELS will wait until #mcuxClEls_HwState_t.drbgentlvl == #MCUXCLELS_STATUS_DRBGENTLVL_HIGH. This can lead to a delay if the DRBG is in a state with less security strength at the time of the call.
*
* Call #mcuxClEls_WaitForOperation to complete the operation.
* The public key will be stored in the standard ANSI X9.62 byte order (big-endian).
*
* @param[in] options The command options. For more information, see #mcuxClEls_EccKeyGenOption_t.
* @param[in] signingKeyIdx The index of the key to sign the generated public key.
* @param[in] privateKeyIdx Output key index.
* @param[in] generatedKeyProperties The desired key properties of the generated key.
* @param[in] pRandomData Random data provided by the user.
* @param[out] pPublicKey Pointer to the memory area which receives the public key and optionally the key signature.
*
* <dl>
* <dt>Parameter properties</dt>
* <dd><dl>
* <dt>@p options.kgsign == #MCUXCLELS_ECC_PUBLICKEY_SIGN_DISABLE</dt>
* <dd>@p signingKeyIdx is ignored.</dd>
* <dt>@p options.kgsrc == #MCUXCLELS_ECC_OUTPUTKEY_DETERMINISTIC</dt>
* <dd>@p privateKeyIdx also defines the key index of the source key material.
* The source key material will be overwritten by the output public key.</dd>
* <dt>@p options.kgsign_rnd == #MCUXCLELS_ECC_NO_RANDOM_DATA</dt>
* <dd>@p pRandomData is ignored.</dd>
* <dt>@p pPublicKey must be aligned on a 4-byte boundary.</dt>
* </dl></dd>
* </dl>
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @else
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @endif
* @retval #MCUXCLELS_STATUS_SW_INVALID_PARAM if invalid parameters were specified
* @retval #MCUXCLELS_STATUS_SW_CANNOT_INTERRUPT if a running operation prevented the request
* @retval #MCUXCLELS_STATUS_OK_WAIT on successful request
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_EccKeyGen_Async)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_EccKeyGen_Async(
mcuxClEls_EccKeyGenOption_t options,
mcuxClEls_KeyIndex_t signingKeyIdx,
mcuxClEls_KeyIndex_t privateKeyIdx,
mcuxClEls_KeyProp_t generatedKeyProperties,
uint8_t const * pRandomData,
uint8_t * pPublicKey
);
/**
* @brief Performs a Diffie-Hellman key exchange with an internal ECC private key and an external ECC public key.
*
* Before execution, ELS will wait until #mcuxClEls_HwState_t.drbgentlvl == #MCUXCLELS_STATUS_DRBGENTLVL_LOW. This can lead to a delay if the DRBG is in a state with less security strength at the time of the call.
*
* Call #mcuxClEls_WaitForOperation to complete the operation.
* The public key must be stored in the standard ANSI X9.62 byte order (big-endian).
*
* @param[in] privateKeyIdx The private key index.
* @param[in] pPublicKey Pointer to the public key of a third party.
* @param[in] sharedSecretIdx The index in the ELS keystore that receives the shared secret that is generated by the ECDH operation.
* @param[in] sharedSecretProperties The desired key properties of the shared secret.
*
* <dl>
* <dt>Parameter properties</dt>
* <dd><dl>
* <dt>@p pPublicKey </dt>
* <dd>The public key consists of the 256-bit X coordinate and the 256-bit Y coordinate.
* The point must lie on the NIST P-256 curve, be encoded in X9.62 format and aligned on a 4-byte boundary.</dd>
* </dl></dd>
* </dl>
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @else
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @endif
* @retval #MCUXCLELS_STATUS_SW_INVALID_PARAM if invalid parameters were specified
* @retval #MCUXCLELS_STATUS_SW_CANNOT_INTERRUPT if a running operation prevented the request
* @retval #MCUXCLELS_STATUS_OK_WAIT on successful request
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_EccKeyExchange_Async)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_EccKeyExchange_Async(
mcuxClEls_KeyIndex_t privateKeyIdx,
uint8_t const * pPublicKey,
mcuxClEls_KeyIndex_t sharedSecretIdx,
mcuxClEls_KeyProp_t sharedSecretProperties
);
#ifdef MCUXCL_FEATURE_ELS_PUK_INTERNAL
/**
* @brief Performs a Diffie-Hellman key exchange with an internal ECC private key and an internal ECC public key.
*
* Before execution, ELS will wait until #mcuxClEls_HwState_t.drbgentlvl == #MCUXCLELS_STATUS_DRBGENTLVL_LOW. This can lead to a delay if the DRBG is in a state with less security strength at the time of the call.
*
* Call #mcuxClEls_WaitForOperation to complete the operation.
*
* @param[in] privateKeyIdx The private key index.
* @param[in] publicKeyIdx The public key index.
* @param[in] sharedSecretIdx The index in the ELS keystore that receives the shared secret that is generated by the ECDH operation.
* @param[in] sharedSecretProperties The desired key properties of the shared secret.
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @else
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @endif
* @retval #MCUXCLELS_STATUS_SW_INVALID_PARAM if invalid parameters were specified
* @retval #MCUXCLELS_STATUS_SW_CANNOT_INTERRUPT if a running operation prevented the request
* @retval #MCUXCLELS_STATUS_OK_WAIT on successful request
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_EccKeyExchangeInt_Async)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_EccKeyExchangeInt_Async(
mcuxClEls_KeyIndex_t privateKeyIdx,
mcuxClEls_KeyIndex_t publicKeyIdx,
mcuxClEls_KeyIndex_t sharedSecretIdx,
mcuxClEls_KeyProp_t sharedSecretProperties
);
#endif /* MCUXCL_FEATURE_ELS_PUK_INTERNAL */
/**
* @brief Generates an ECDSA signature of a given message.
*
* The curve is NIST P-256.
* The message hash, must be stored in the standard ANSI X9.62 format.
* If the message is provided in plain, no prior conversion is necessary.
* The signature will be stored in the standard ANSI X9.62 byte order (big-endian).
* @if MCUXCL_FEATURE_ELS_SHA_DIRECT
* No matter the value of @p options.echashchl, it must be ensured that SHA-Direct mode is disabled when calling this function (see #mcuxClEls_ShaDirect_Disable).
* @endif
*
* Before execution, ELS will wait until #mcuxClEls_HwState_t.drbgentlvl == #MCUXCLELS_STATUS_DRBGENTLVL_HIGH. This can lead to a delay if the DRBG is in a state with less security strength at the time of the call.
*
* Call #mcuxClEls_WaitForOperation to complete the operation.
*
* @param[in] options The command options. For more information, see #mcuxClEls_EccSignOption_t.
* @param[in] keyIdx The private key index.
* @param[in] pInputHash The hash of the message to sign in X9.62 format.
* @param[in] pInputMessage The message to sign.
* @param[in] inputMessageLength Size of @p pInputMessage in bytes.
* @param[out] pOutput Pointer to the memory area which receives the generated signature in X9.62 format. (64 bytes)
*
* <dl>
* <dt>Parameter properties</dt>
* <dd><dl>
* <dt>@p options.echashchl == #MCUXCLELS_ECC_HASHED</dt>
* <dd>@p pInputHash is used, and it must be aligned on a 4-byte boundary.
* @p pInputMessage is ignored.</dd>
* <dt>@p options.echashchl == #MCUXCLELS_ECC_NOT_HASHED</dt>
* <dd>@p pInputHash is ignored.
* @p pInputMessage and @p inputMessageLength are used.</dd>
* <dt>@p pOptput must be aligned on a 4-byte boundary.</dt>
* </dl></dd>
* </dl>
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @else
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @endif
* @retval #MCUXCLELS_STATUS_SW_INVALID_PARAM if invalid parameters were specified
* @retval #MCUXCLELS_STATUS_SW_CANNOT_INTERRUPT if a running operation prevented the request
* @retval #MCUXCLELS_STATUS_OK_WAIT on successful request
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_EccSign_Async)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_EccSign_Async(
mcuxClEls_EccSignOption_t options,
mcuxClEls_KeyIndex_t keyIdx,
uint8_t const * pInputHash,
uint8_t const * pInputMessage,
size_t inputMessageLength,
uint8_t * pOutput
);
/**
* @brief Verifies an ECDSA signature of a given message.
*
* The curve is NIST P-256.
* The message hash, must be stored in the standard ANSI X9.62 format.
* If the message is provided in plain, no prior conversion is necessary.
* The signature and public key must be stored in the standard ANSI X9.62 byte order (big-endian).
* @if MCUXCL_FEATURE_ELS_SHA_DIRECT
* No matter the value of @p options.echashchl, it must be ensured that SHA-Direct mode is disabled when calling this function (see #mcuxClEls_ShaDirect_Disable).
* @endif
*
* Before execution, ELS will wait until #mcuxClEls_HwState_t.drbgentlvl == #MCUXCLELS_STATUS_DRBGENTLVL_LOW. This can lead to a delay if the DRBG is in a state with less security strength at the time of the call.
*
* Call #mcuxClEls_WaitForOperation to complete the operation.
*
* @param[in] options The command options. For more information, see #mcuxClEls_EccVerifyOption_t.
* @param[in] pInputHash The hash of the signed message in X9.62 format.
* @param[in] pInputMessage The message to sign.
* @param[in] inputMessageLength Size of @p pInputMessage in bytes.
* @param[in] pSignatureAndPubKey Pointer to the memory area which contains the concatenation of the signature and the public key.
* @param[out] pOutput Pointer to the memory area which will receive the recalculated value of the R component in case of a successful
* signature verification.
*
* <dl>
* <dt>Parameter properties</dt>
* <dd><dl>
* <dt>@p options.echashchl == #MCUXCLELS_ECC_HASHED</dt>
* <dd>@p pInputHash is used, and it must be aligned on a 4-byte boundary.
* @p pInputMessage is ignored.</dd>
* <dt>@p options.echashchl == #MCUXCLELS_ECC_NOT_HASHED</dt>
* <dd>@p pInputHash is ignored.
* @p pInputMessage and @p inputMessageLength are used.</dd>
* <dt>@p pSignatureAndPubKey </dt>
* <dd>It must be aligned on a 4-byte boundary.
* The signature to be verified consists of the 256-bit R component and the 256-bit S component.
* The public key is the one for verification. (Uncompressed, X and Y components)
* The signature and the public key are in X9.62 format.</dd>
* <dt>@p pOutput </dt>
* <dd>It must be aligned on a 4-byte boundary.
* The output shall be compared to the first 32 bytes stored at @p pSignatureAndPublicKey.</dd>
* </dl></dd>
* </dl>
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @else
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @endif
* @retval #MCUXCLELS_STATUS_SW_INVALID_PARAM if invalid parameters were specified
* @retval #MCUXCLELS_STATUS_SW_CANNOT_INTERRUPT if a running operation prevented the request
* @retval #MCUXCLELS_STATUS_OK_WAIT on successful request
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_EccVerify_Async)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_EccVerify_Async(
mcuxClEls_EccVerifyOption_t options,
uint8_t const * pInputHash,
uint8_t const * pInputMessage,
size_t inputMessageLength,
uint8_t const * pSignatureAndPubKey,
uint8_t * pOutput
);
#ifdef MCUXCL_FEATURE_ELS_PUK_INTERNAL
/**
* @brief Verifies an ECDSA signature of a given message.
*
* The curve is NIST P-256.
* The message hash, must be stored in the standard ANSI X9.62 format.
* If the message is provided in plain, no prior conversion is necessary.
* The signature must be stored in the standard ANSI X9.62 byte order (big-endian).
* @if MCUXCL_FEATURE_ELS_SHA_DIRECT
* No matter the value of @p options.echashchl, it must be ensured that SHA-Direct mode is disabled when calling this function (see #mcuxClEls_ShaDirect_Disable).
* @endif
*
* Before execution, ELS will wait until #mcuxClEls_HwState_t.drbgentlvl == #MCUXCLELS_STATUS_DRBGENTLVL_LOW. This can lead to a delay if the DRBG is in a state with less security strength at the time of the call.
*
* Call #mcuxClEls_WaitForOperation to complete the operation.
*
* @param[in] options The command options. For more information, see #mcuxClEls_EccVerifyOption_t.
* @param[in] publicKeyIdx The public key index.
* @param[in] pInputHash The hash of the signed message in X9.62 format.
* @param[in] pInputMessage The message to sign.
* @param[in] inputMessageLength Size of @p pInputMessage in bytes.
* @param[in] pSignature Pointer to the memory area which contains the concatenation of the signature and the public key.
* @param[out] pOutput Pointer to the memory area which will receive the recalculated value of the R component in case of a successful
* signature verification.
*
* <dl>
* <dt>Parameter properties</dt>
* <dd><dl>
* <dt>@p options.echashchl == #MCUXCLELS_ECC_HASHED</dt>
* <dd>@p pInputHash is used, and it must be aligned on a 4-byte boundary.
* @p pInputMessage is ignored.</dd>
* <dt>@p options.echashchl == #MCUXCLELS_ECC_NOT_HASHED</dt>
* <dd>@p pInputHash is ignored.
* @p pInputMessage and @p inputMessageLength are used.</dd>
* <dt>@p pSignature</dt>
* <dd>It must be aligned on a 4-byte boundary.
* The signature to be verified consists of the 256-bit R component and the 256-bit S component.
* The signature is in X9.62 format.</dd>
* <dt>@p pOutput </dt>
* <dd>It must be aligned on a 4-byte boundary.
* The output shall be compared to the first 32 bytes stored at @p pSignatureAndPublicKey.</dd>
* </dl></dd>
* </dl>
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @else
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @endif
* @retval #MCUXCLELS_STATUS_SW_INVALID_PARAM if invalid parameters were specified
* @retval #MCUXCLELS_STATUS_SW_CANNOT_INTERRUPT if a running operation prevented the request
* @retval #MCUXCLELS_STATUS_OK_WAIT on successful request
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_EccVerifyInt_Async)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_EccVerifyInt_Async(
mcuxClEls_EccVerifyOption_t options,
mcuxClEls_KeyIndex_t publicKeyIdx,
uint8_t const * pInputHash,
uint8_t const * pInputMessage,
size_t inputMessageLength,
uint8_t const * pSignature,
uint8_t * pOutput
);
#endif /* MCUXCL_FEATURE_ELS_PUK_INTERNAL */
/**
* @}
*/ /* mcuxClEls_Ecc_Functions */
/**
* @}
*/ /* mcuxClEls_Ecc */
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* MCUXCLELS_ECC_H_ */
@@ -0,0 +1,157 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2020-2022 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/** @file mcuxClEls_GlitchDetector.h
* @brief ELS header for controlling the glitch detector.
*
* This header exposes functions that configure the ELS glitch detector.
*/
#ifndef MCUXCLELS_GLITCHDETECTOR_H_
#define MCUXCLELS_GLITCHDETECTOR_H_
#include <mcuxClConfig.h> // Exported features flags header
#include <mcuxClEls_Common.h> // Common types & functionality
#ifdef __cplusplus
extern "C" {
#endif
/**
* @defgroup mcuxClEls_GlitchDetector mcuxClEls_GlitchDetector
* @brief This part of the @ref mcuxClEls driver supports glitch detector functionality
* @ingroup mcuxClEls
* @{
*/
/**********************************************
* CONSTANTS
**********************************************/
/**
* @defgroup mcuxClEls_GlitchDetector_Macros mcuxClEls_GlitchDetector_Macros
* @brief Defines all macros of @ref mcuxClEls_GlitchDetector
* @ingroup mcuxClEls_GlitchDetector
* @{
*/
#define MCUXCLELS_GLITCHDETECTOR_CFG_SIZE ((size_t) 0x18u) ///< Glitch detector configuration size
#define MCUXCLELS_GLITCHDETECTOR_TRIM_SIZE ((size_t) 0x04u) ///< Glitch detector trim value size
/**
* @}
*/ /* mcuxClEls_GlitchDetector_Macros */
/**********************************************
* FUNCTIONS
**********************************************/
/**
* @defgroup mcuxClEls_GlitchDetector_Functions mcuxClEls_GlitchDetector_Functions
* @brief Defines all functions of @ref mcuxClEls_GlitchDetector
* @ingroup mcuxClEls_GlitchDetector
* @{
*/
/**
* @brief Loads a glitch detector configuration.
*
* Call #mcuxClEls_WaitForOperation to complete the operation.
*
* @param[in] Pointer to the memory area which contains the glitch detector configuration. The size is fixed at #MCUXCLELS_GLITCHDETECTOR_CFG_SIZE bytes.
*
* @retval #MCUXCLELS_STATUS_SW_INVALID_PARAM if invalid parameters were specified
* @retval #MCUXCLELS_STATUS_SW_CANNOT_INTERRUPT if a running operation prevented the request
* @retval #MCUXCLELS_STATUS_OK_WAIT on successful request
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @else
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @endif
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_GlitchDetector_LoadConfig_Async)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_GlitchDetector_LoadConfig_Async(
uint8_t const * pInput
);
/**
* @brief Calculates optimal ELS glitch detector configuration and writes it to system memory.
*
* Call #mcuxClEls_WaitForOperation to complete the operation.
*
* @param[out] Pointer to the memory area which receives the glitch detector trim value. The size is fixed at #MCUXCLELS_GLITCHDETECTOR_TRIM_SIZE bytes.
*
* @retval #MCUXCLELS_STATUS_SW_INVALID_PARAM if invalid parameters were specified
* @retval #MCUXCLELS_STATUS_SW_CANNOT_INTERRUPT if a running operation prevented the request
* @retval #MCUXCLELS_STATUS_OK_WAIT on successful request
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @else
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @endif
*
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_GlitchDetector_Trim_Async)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_GlitchDetector_Trim_Async(
uint8_t * pOutput
);
/**
* @brief Reads the glitch detector's event counter
*
* This function converts the event counter from Gray code to an unsigned number.
*
* @param[in] Pointer to the word where the counter value will be stored.
*
* @retval #MCUXCLELS_STATUS_OK on successful request
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @else
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @endif
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_GlitchDetector_GetEventCounter)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_GlitchDetector_GetEventCounter(
uint8_t * pCount
);
/**
* @brief Resets the glitch detector's event counter
*
* @retval #MCUXCLELS_STATUS_OK on successful request
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @else
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @endif
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_GlitchDetector_ResetEventCounter)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_GlitchDetector_ResetEventCounter( void
);
/**
* @}
*/ /* mcuxClEls_GlitchDetector_Functions */
/**
* @}
*/ /* mcuxClEls_GlitchDetector */
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* MCUXCLELS_GLITCHDETECTOR_H_ */
@@ -0,0 +1,351 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2020-2023 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/**
* @file mcuxClEls_Hash.h
* @brief ELS header for hashing.
*
* This header exposes functions that enable using the ELS for hashing.
* There are two modes to hash a message: The asynchronous way as an ELS command, and the SHA-Direct mode which feeds
* data to the internal registers of the ELS and is synchronous (blocking).
* The SHA-Direct mode is meant to be used when another command should be executed in parallel on the ELS while the
* hash operation is still ongoing. For this, use the DMA callback option in #mcuxClEls_Hash_ShaDirect.
*/
/**
* @defgroup mcuxClEls_Hash mcuxClEls_Hash
* @brief This part of the @ref mcuxClEls driver supports hashing
* @ingroup mcuxClEls
* @{
*/
#ifndef MCUXCLELS_HASH_H_
#define MCUXCLELS_HASH_H_
#include <mcuxClConfig.h> // Exported features flags header
#include <mcuxClEls_Common.h> // Common functionality
#ifdef __cplusplus
extern "C" {
#endif
/**********************************************
* CONSTANTS
**********************************************/
/**
* @defgroup mcuxClEls_Hash_Macros mcuxClEls_Hash_Macros
* @brief Defines all macros of @ref mcuxClEls_Hash
* @ingroup mcuxClEls_Hash
* @{
*/
/**
* @defgroup MCUXCLELS_HASH_ MCUXCLELS_HASH_
* @brief Defines valid options to be used by #mcuxClEls_HashOption_t
* @ingroup mcuxClEls_Hash_Macros
* @{
*/
#define MCUXCLELS_HASH_INIT_ENABLE 1U ///< Set this option at #mcuxClEls_HashOption_t.hashini to initialize the hash
#define MCUXCLELS_HASH_INIT_DISABLE 0U ///< Set this option at #mcuxClEls_HashOption_t.hashini to continue the hash
#define MCUXCLELS_HASH_LOAD_ENABLE 1U ///< Set this option at #mcuxClEls_HashOption_t.hashld to load the hash state from @p pDigest
#define MCUXCLELS_HASH_LOAD_DISABLE 0U ///< Set this option at #mcuxClEls_HashOption_t.hashld to not load the hash state
#define MCUXCLELS_HASH_OUTPUT_ENABLE 1U ///< Set this option at #mcuxClEls_HashOption_t.hashoe to output the hash to @p pDigest
#define MCUXCLELS_HASH_OUTPUT_DISABLE 0U ///< Set this option at #mcuxClEls_HashOption_t.hashoe to not output the hash
#define MCUXCLELS_HASH_RTF_UPDATE_ENABLE 1U ///< Set this option at #mcuxClEls_HashOption_t.rtfupd to update the run-time fingerprint (only supported by #mcuxClEls_Hash_Async)
#define MCUXCLELS_HASH_RTF_UPDATE_DISABLE 0U ///< Set this option at #mcuxClEls_HashOption_t.rtfupd to not update the run-time fingerprint
#define MCUXCLELS_HASH_RTF_OUTPUT_ENABLE 1U ///< Set this option at #mcuxClEls_HashOption_t.rtfoe to output the run-time fingerprint (only supported by #mcuxClEls_Hash_Async)
#define MCUXCLELS_HASH_RTF_OUTPUT_DISABLE 0U ///< Set this option at #mcuxClEls_HashOption_t.rtfoe to not output the run-time fingerprint
#define MCUXCLELS_HASH_MODE_SHA_224 1U ///< Set this option at #mcuxClEls_HashOption_t.hashmd to use the hash algorithm SHA-224
#define MCUXCLELS_HASH_MODE_SHA_256 0U ///< Set this option at #mcuxClEls_HashOption_t.hashmd to use the hash algorithm SHA-256
#define MCUXCLELS_HASH_MODE_SHA_384 2U ///< Set this option at #mcuxClEls_HashOption_t.hashmd to use the hash algorithm SHA-384
#define MCUXCLELS_HASH_MODE_SHA_512 3U ///< Set this option at #mcuxClEls_HashOption_t.hashmd to use the hash algorithm SHA-512
#define MCUXCLELS_HASH_VALUE_MODE_SHA_224 ((uint32_t) MCUXCLELS_HASH_MODE_SHA_224 << 4) ///< Set this option at #mcuxClEls_HashOption_t.word.value to use the hash algorithm SHA-224
#define MCUXCLELS_HASH_VALUE_MODE_SHA_256 ((uint32_t) MCUXCLELS_HASH_MODE_SHA_256 << 4) ///< Set this option at #mcuxClEls_HashOption_t.word.value to use the hash algorithm SHA-256
#define MCUXCLELS_HASH_VALUE_MODE_SHA_384 ((uint32_t) MCUXCLELS_HASH_MODE_SHA_384 << 4) ///< Set this option at #mcuxClEls_HashOption_t.word.value to use the hash algorithm SHA-384
#define MCUXCLELS_HASH_VALUE_MODE_SHA_512 ((uint32_t) MCUXCLELS_HASH_MODE_SHA_512 << 4) ///< Set this option at #mcuxClEls_HashOption_t.word.value to use the hash algorithm SHA-512
/**
* @}
*/
/**
* @defgroup MCUXCLELS_HASH_BLOCK_SIZE_ MCUXCLELS_HASH_BLOCK_SIZE_
* @brief Defines block sizes used by the supported hash algorithms
* @ingroup mcuxClEls_Hash_Macros
* @{
*/
#define MCUXCLELS_HASH_BLOCK_SIZE_SHA_224 64U ///< SHA-224 output size: 512 bit (64 bytes)
#define MCUXCLELS_HASH_BLOCK_SIZE_SHA_256 64U ///< SHA-256 output size: 512 bit (64 bytes)
#define MCUXCLELS_HASH_BLOCK_SIZE_SHA_384 128U ///< SHA-384 output size: 1024 bit (128 bytes)
#define MCUXCLELS_HASH_BLOCK_SIZE_SHA_512 128U ///< SHA-512 output size: 1024 bit (128 bytes)
/**
* @}
*/
/**
* @defgroup MCUXCLELS_HASH_STATE_SIZE_ MCUXCLELS_HASH_STATE_SIZE_
* @brief Defines the intermediate state sizes of the supported hash algorithms
* @ingroup mcuxClEls_Hash_Macros
* @{
*/
#define MCUXCLELS_HASH_STATE_SIZE_SHA_224 32U ///< SHA-224 state size: 256 bit (32 bytes)
#define MCUXCLELS_HASH_STATE_SIZE_SHA_256 32U ///< SHA-256 state size: 256 bit (32 bytes)
#define MCUXCLELS_HASH_STATE_SIZE_SHA_384 64U ///< SHA-384 state size: 512 bit (64 bytes)
#define MCUXCLELS_HASH_STATE_SIZE_SHA_512 64U ///< SHA-512 state size: 512 bit (64 bytes)
/**
* @}
*/
/**
* @defgroup MCUXCLELS_HASH_OUTPUT_SIZE_ MCUXCLELS_HASH_OUTPUT_SIZE_
* @brief Defines the output sizes of the supported hash algorithms (do not use for allocation)
* @ingroup mcuxClEls_Hash_Macros
* @{
*/
#define MCUXCLELS_HASH_OUTPUT_SIZE_SHA_224 28U ///< SHA-224 output size: 224 bit (28 bytes)
#define MCUXCLELS_HASH_OUTPUT_SIZE_SHA_256 32U ///< SHA-256 output size: 256 bit (32 bytes)
#define MCUXCLELS_HASH_OUTPUT_SIZE_SHA_384 48U ///< SHA-384 output size: 384 bit (48 bytes)
#define MCUXCLELS_HASH_OUTPUT_SIZE_SHA_512 64U ///< SHA-512 output size: 512 bit (64 bytes)
/**
* @}
*/
/**
* @ingroup mcuxClEls_Hash_Macros
* @{
*/
#define MCUXCLELS_HASH_RTF_OUTPUT_SIZE ((size_t)32U) ///< Size of run-time fingerprint appended to the hash in @p pDigest in bytes, if #MCUXCLELS_HASH_RTF_OUTPUT_ENABLE was specified
/**
* @}
*
* @}
*/
/**********************************************
* TYPEDEFS
**********************************************/
/**
* @defgroup mcuxClEls_Hash_Types mcuxClEls_Hash_Types
* @brief Defines all types of @ref mcuxClEls_Hash
* @ingroup mcuxClEls_Hash
* @{
*/
/**
* @brief Command option bit field for #mcuxClEls_Hash_Async and #mcuxClEls_Hash_ShaDirect.
*
* Bit field to configure #mcuxClEls_Hash_Async and #mcuxClEls_Hash_ShaDirect. See @ref MCUXCLELS_HASH_ for possible options.
*/
typedef union
{
struct
{
uint32_t value; ///< Accesses the bit field as a full word
} word; ///< Access #mcuxClEls_HashOption_t word-wise
struct
{
uint32_t :2; ///< RFU
uint32_t hashini :1; ///< Defines if the hash engine shall be initialized
uint32_t hashld :1; ///< Defines if the hash engine shall be initialized with an externally provided digest
uint32_t hashmd :2; ///< Defines which hash algorithm shall be used
uint32_t hashoe :1; ///< Defines if the hash digest shall be moved to the output buffer
uint32_t rtfupd :1; ///< RTF (Runtime Fingerprint) Update
uint32_t rtfoe :1; ///< RTF (Runtime Fingerprint) Output Enabled
uint32_t :23; ///< RFU
} bits; ///< Access #mcuxClEls_HashOption_t bit-wise
} mcuxClEls_HashOption_t;
/**
* @}
*/
/**********************************************
* FUNCTIONS
**********************************************/
/**
* @defgroup mcuxClEls_Hash_Functions mcuxClEls_Hash_Functions
* @brief Defines all functions of @ref mcuxClEls_Hash
* @ingroup mcuxClEls_Hash
* @{
*/
/**
* @brief Computes the hash of a message.
*
* Call #mcuxClEls_WaitForOperation to complete the operation.
* @if MCUXCL_FEATURE_ELS_SHA_DIRECT
* It must be ensured that SHA-Direct mode is disabled when calling this function (see #mcuxClEls_ShaDirect_Disable).
* @endif
*
* @param[in] options The command options. For more information, see #mcuxClEls_HashOption_t.
* @param[in] pInput Padded input data to be hashed
* @param[in] inputLength Size of @p pInput in bytes. Since the input is padded, the length must be a multiple of the block size, see @ref MCUXCLELS_HASH_BLOCK_SIZE_.
* @param[in, out] pDigest Pointer to the memory area that contains/receives the (intermediate) hash digest, allocated by the caller, see @ref MCUXCLELS_HASH_STATE_SIZE_.
*
* The properties of some parameters change with respect to selected options.
*
* <dl>
* <dt>Parameter properties</dt>
*
* <dd><dl>
* <dt>@p options.hashini == #MCUXCLELS_HASH_INIT_ENABLE</dt>
* <dd>@p options.hashld has no effect and shall be #MCUXCLELS_HASH_LOAD_DISABLE. No data is read from @p pDigest.</dd>
*
* <dt>@p options.hashld == #MCUXCLELS_HASH_LOAD_DISABLE</dt>
* <dd>@p pDigest is not expected to contain an initial state. No data is read from @p pDigest.</dd>
*
* <dt>@p options.rtfoe == #MCUXCLELS_HASH_RTF_UPDATE_ENABLE</dt>
* <dd>When this option is used the current runtime fingerprint (RTF) value will be appended to the output @p pDigest; an additional #MCUXCLELS_HASH_RTF_OUTPUT_SIZE bytes has to be allocated for @p pDigest.</dd>
*
* <dt>@p options.hashoe == #MCUXCLELS_HASH_OUTPUT_ENABLE</dt>
* <dd>The hash state is written to @p pDigest. The size varies depending on the choice of @p options.hashmd, for more information see @ref MCUXCLELS_HASH_STATE_SIZE_ . In cases where the state size and output size differ - see @ref MCUXCLELS_HASH_OUTPUT_SIZE_ -, the state must be truncated by the caller to obtain the final hash value.</dd>
*
* </dl></dd>
* </dl>
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @else
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @endif
* @retval #MCUXCLELS_STATUS_SW_INVALID_PARAM if invalid parameters were specified
* @retval #MCUXCLELS_STATUS_SW_CANNOT_INTERRUPT if a running operation prevented the request
* @retval #MCUXCLELS_STATUS_OK_WAIT on successful request
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_Hash_Async)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_Hash_Async(
mcuxClEls_HashOption_t options,
uint8_t const * pInput,
size_t inputLength,
uint8_t * pDigest
);
#ifdef MCUXCL_FEATURE_ELS_SHA_DIRECT
/**
* @brief Enables SHA-direct mode.
*
* If this mode is enabled, it allows the application processor to access the ELS hash
* engine, but at the same time it stops ELS operations from using the hash engine.
*
* Therefore, in SHA-direct mode, hashing can only be done with #mcuxClEls_Hash_ShaDirect.
* When SHA-direct mode is active, ELS operations which internally use the ELS hash engine
* will result in an operational error (see #MCUXCLELS_STATUS_HW_OPERATIONAL). To use those
* operations, disable SHA-direct mode. Please consult function descriptions to check
* whether and under which circumstances they internally use the ELS hash engine.
*
* ELS operations which do not internally use the ELS hash engine can be performed in
* parallel with a SHA-direct hash operation.
*
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection)
* @retval #MCUXCLELS_STATUS_SW_CANNOT_INTERRUPT if a running operation prevented the request
* @retval #MCUXCLELS_STATUS_OK on success
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_ShaDirect_Enable)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_ShaDirect_Enable(
void);
/**
* @brief Disables SHA-direct mode.
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @else
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @endif
* @retval #MCUXCLELS_STATUS_SW_CANNOT_INTERRUPT if a running operation prevented the request
* @retval #MCUXCLELS_STATUS_OK on success
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_ShaDirect_Disable)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_ShaDirect_Disable(
void);
/**
* @brief Calculates the hash of a message using SHA-Direct mode.
*
* SHA-Direct mode must be enabled before calling this function. For more information, see #mcuxClEls_ShaDirect_Enable.
*
* In order to perform a hash calculation in SHA-Direct mode, the CPU must feed the input data to a register in ELS's SHA core, or configure a DMA to copy the input data to that register. A DMA can be used because feeding input data to the SHA core while the SHA core is busy results in an AHB bus stall, and there is no need to check any further flags before copying further data.
* If a DMA shall be used to perform this copy, a callback function must be provided by the caller that will configure and start the DMA.
* If no callback function is specified, this function will resort to using the CPU.
*
* @param[in] options The command options. For more information, see #mcuxClEls_HashOption_t.
* @param[in] pInput Padded input data to be hashed.
* @param[in] inputLength Size of @p pInput in bytes. Since the input is padded, the length must be a multiple of the block size, see @ref MCUXCLELS_HASH_BLOCK_SIZE_.
* @param[in, out] pDigest Pointer to the memory area that contains/receives the (intermediate) hash digest, allocated by the caller, see @ref MCUXCLELS_HASH_STATE_SIZE_.
* @param[in] pCallback Callback function to load data into Sha core.
* @param[in, out] pCallerData Pointer forwarded by the operation to the callback function.
*
* The properties of some parameters change with respect to selected options.
*
* <dl>
* <dt>Parameter properties</dt>
*
* <dd><dl>
* <dt>@p options.hashini == #MCUXCLELS_HASH_INIT_ENABLE</dt>
* <dd>@p options.hashld has no effect and shall be #MCUXCLELS_HASH_LOAD_DISABLE. No data is read from @p pDigest. </dd>
*
* <dt>@p options.hashld == #MCUXCLELS_HASH_LOAD_DISABLE</dt>
* <dd>@p pDigest is not expected to contain an initial state. No data is read from @p pDigest. </dd>
*
* <dt>@p options.hashoe == #MCUXCLELS_HASH_OUTPUT_ENABLE</dt>
* <dd>The hash state is written to @p pDigest. The size varies depending on the choice of @p options.hashmd, for more information see @ref MCUXCLELS_HASH_STATE_SIZE_ . In cases where the state size and output size differ - see @ref MCUXCLELS_HASH_OUTPUT_SIZE_ -, the state must be truncated by the caller to obtain the final hash value.</dd>
*
* <dt>@p pCallback != @c NULL </dt>
* <dd>The callback function referenced by @p pCallback is called. Otherwise, the function uses a default implementation for the copy.</dd>
* </dl></dd>
* </dl>
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @else
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @endif
* @retval #MCUXCLELS_STATUS_SW_INVALID_PARAM if invalid parameters were specified
* @retval #MCUXCLELS_STATUS_SW_CANNOT_INTERRUPT if a running operation prevented the request
* @retval #MCUXCLELS_STATUS_SW_FAULT if the callback returned an error
* @retval #MCUXCLELS_STATUS_OK on success
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_Hash_ShaDirect)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_Hash_ShaDirect(
mcuxClEls_HashOption_t options,
uint8_t const * pInput,
size_t inputLength,
uint8_t * pDigest,
mcuxClEls_TransferToRegisterFunction_t pCallback,
void * pCallerData
);
#endif /* MCUXCL_FEATURE_ELS_SHA_DIRECT */
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* MCUXCLELS_HASH_H_ */
/**
* @}
*
* @}
*/
@@ -0,0 +1,170 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2020-2023 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/**
* @file mcuxClEls_Hmac.h
* @brief ELS header for HMAC support.
*
* This header exposes functions that enable using the ELS for the generation of hashed-key message authentication
* codes (HMAC).
* The supported hash algorithm is SHA2-256.
*/
/**
* @defgroup mcuxClEls_Hmac mcuxClEls_Hmac
* @brief This part of the @ref mcuxClEls driver supports functionality for hashed-key message authentication codes.
* @ingroup mcuxClEls
* @{
*/
#ifndef MCUXCLELS_HMAC_H_
#define MCUXCLELS_HMAC_H_
#include <mcuxClConfig.h> // Exported features flags header
#include <mcuxClEls_Common.h> // Common functionality
#ifdef __cplusplus
extern "C" {
#endif
/**********************************************
* MACROS
**********************************************/
/**
* @defgroup mcuxClEls_Hmac_Macros mcuxClEls_Hmac_Macros
* @brief Defines all macros of @ref mcuxClEls_Hmac
* @ingroup mcuxClEls_Hmac
* @{
*/
/**
* @defgroup MCUXCLELS_HMAC_EXTERNAL_KEY_ MCUXCLELS_HMAC_EXTERNAL_KEY_
* @brief Defines valid options to be used by #mcuxClEls_HmacOption_t
* @ingroup mcuxClEls_Hmac_Macros
* @{
*/
#define MCUXCLELS_HMAC_EXTERNAL_KEY_ENABLE 1U ///< Set #mcuxClEls_HmacOption_t.extkey to this value to use an external key
#define MCUXCLELS_HMAC_EXTERNAL_KEY_DISABLE 0U ///< Set #mcuxClEls_HmacOption_t.extkey to this value to use a key from the ELS keystore
/**
* @}
*/
#define MCUXCLELS_HMAC_PADDED_KEY_SIZE ((size_t) 64U) ///< HMAC Key size: 64 bytes
#define MCUXCLELS_HMAC_OUTPUT_SIZE ((size_t) 32U) ///< HMAC Output size: 32 bytes
/**
* @}
*/
/**********************************************
* TYPEDEFS
**********************************************/
/**
* @defgroup mcuxClEls_Hmac_Types mcuxClEls_Hmac_Types
* @brief Defines all types of @ref mcuxClEls_Hmac
* @ingroup mcuxClEls_Hmac
* @{
*/
/**
* @brief Command option bit field for #mcuxClEls_Hmac_Async.
*
* Valid option values can be found under @ref MCUXCLELS_HMAC_EXTERNAL_KEY_.
*/
typedef union
{
struct
{
uint32_t value; ///< Accesses the bit field as a full word
} word; ///< Access #mcuxClEls_CipherOption_t word-wise
struct
{
uint32_t :13; ///< RFU
uint32_t extkey :1; ///< Whether an external key should be used
uint32_t :18; ///< RFU
} bits; ///< Access #mcuxClEls_CipherOption_t word-wise
} mcuxClEls_HmacOption_t;
/**
* @}
*/
/**********************************************
* FUNCTIONS
**********************************************/
/**
* @defgroup mcuxClEls_Hmac_Functions mcuxClEls_Hmac_Functions
* @brief Defines all functions of @ref mcuxClEls_Hmac
* @ingroup mcuxClEls_Hmac
* @{
*/
/**
* @brief Performs HMAC with SHA-256.
*
* @if MCUXCL_FEATURE_ELS_SHA_DIRECT
* It must be ensured that SHA-Direct mode is disabled when calling this function (see #mcuxClEls_ShaDirect_Disable).
* @endif
*
* Call #mcuxClEls_WaitForOperation to complete the operation.
*
* @param[in] options The command options. For more information, see #mcuxClEls_HmacOption_t.
* @param[in] keyIdx The HMAC key index, if an internal key shall be used
* @param[in] pPaddedKey Pointer to a memory location containing the padded HMAC key
* @param[in] pInput Pointer to a memory location which contains the data to be authenticated
* @param[in] inputLength Size of @p pInput in bytes
* @param [out] pOutput The output message authentication code
*
* The properties of some parameters change with respect to selected options.
*
* <dl>
* <dt>Parameter properties</dt>
*
* <dd><dl>
* <dt>@p options.extkey == #MCUXCLELS_HMAC_EXTERNAL_KEY_ENABLE</dt>
* <dd>@p keyIdx is ignored.
*
* @p pPaddedKey must contain the padded HMAC key, which can mean one of two things depending on the length of the original HMAC key, L<sub>kHMAC</sub>:
* <ul><li>If L<sub>kHMAC</sub> &le; #MCUXCLELS_HMAC_PADDED_KEY_SIZE, @p pPaddedKey must be the HMAC key padded with zero-bytes to fill the required length of #MCUXCLELS_HMAC_PADDED_KEY_SIZE bytes.</li>
*
* <li>If L<sub>kHMAC</sub> &gt; #MCUXCLELS_HMAC_PADDED_KEY_SIZE, @p pPaddedKey must contain the SHA-256 hash of the HMAC key, padded with zero-bytes to fill the required length of #MCUXCLELS_HMAC_PADDED_KEY_SIZE bytes.</li></ul></dd>
*
* <dt>@p options.extkey == #MCUXCLELS_HMAC_EXTERNAL_KEY_DISABLE</dt>
* <dd>@p keyIdx must be a valid key index with the correct usage rights for HMAC.
*
* @p pPaddedKey is ignored.</dd>
*
* </dl></dd>
* </dl>
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @else
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @endif
* @retval #MCUXCLELS_STATUS_SW_CANNOT_INTERRUPT if a running operation prevented the request
* @retval #MCUXCLELS_STATUS_OK_WAIT on successful request */
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_Hmac_Async)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_Hmac_Async(
mcuxClEls_HmacOption_t options,
mcuxClEls_KeyIndex_t keyIdx,
uint8_t const * pPaddedKey,
uint8_t const * pInput,
size_t inputLength,
uint8_t * pOutput
);
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* MCUXCLELS_HMAC_H_ */
/**
* @}
*
* @}
*/
@@ -0,0 +1,338 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2020-2023 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/**
* @file mcuxClEls_Kdf.h
* @brief ELS header for key derivation.
*
* This header exposes functions that enable using the ELS for various key derivation commands.
* The supported key derivation algorithms are CKDF, HKDF, TLS
*/
/**
* @defgroup mcuxClEls_Kdf mcuxClEls_Kdf
* @brief This part of the @ref mcuxClEls driver supports functionality for key derivation
* @ingroup mcuxClEls
* @{
*/
/**
* @defgroup mcuxClEls_Kdf_Macros mcuxClEls_Kdf_Macros
* @brief Defines all macros of @ref mcuxClEls_Kdf
* @ingroup mcuxClEls_Kdf
* @{
*/
#ifndef MCUXCLELS_KDF_H_
#define MCUXCLELS_KDF_H_
#include <mcuxClConfig.h> // Exported features flags header
#include <mcuxClEls_Common.h> // Common functionality
#ifdef __cplusplus
extern "C" {
#endif
/**********************************************
* CONSTANTS
**********************************************/
/**
* @defgroup mcuxClEls_Kdf_Define mcuxClEls_Kdf_Define
* @brief constants
* @ingroup mcuxClEls_Kdf_Macros
* @{
*/
#define MCUXCLELS_CKDF_DERIVATIONDATA_SIZE 12u ///< Size of CKDF SP800-108 derivation data
#define MCUXCLELS_CKDF_ALGO_SP800108 0x0u ///< Use SP800-108 algorithm
#define MCUXCLELS_HKDF_RFC5869_DERIVATIONDATA_SIZE 32u ///< Size of HKDF derivation data
#define MCUXCLELS_HKDF_SP80056C_TARGETKEY_SIZE 32u ///< Size of HKDF SP800-56C derived key
#define MCUXCLELS_HKDF_VALUE_RTF_DERIV ((uint32_t) 1u<< 0u) ///< Use RTF as derivation input
#define MCUXCLELS_HKDF_VALUE_MEMORY_DERIV ((uint32_t) 0u<< 0u) ///< Use derivation input from system memory
#define MCUXCLELS_HKDF_ALGO_RFC5869 0x0u ///< Use RFC5869 algorithm
#define MCUXCLELS_HKDF_ALGO_SP80056C 0x1u ///< Use SP800-56C algorithm
#define MCUXCLELS_HKDF_RTF_DERIV 1U ///< Use RTF as derivation input
#define MCUXCLELS_HKDF_SYSTEM_MEMORY_DERIV 0U ///< Use derivation input from system memory
#define MCUXCLELS_TLS_DERIVATIONDATA_SIZE ((size_t) 80u) ///< Size of TLS derivation data
#define MCUXCLELS_TLS_RANDOM_SIZE ((size_t) 32u) ///< Size of random bytes for TLS
#define MCUXCLELS_TLS_INIT 0u ///< Perform master key generation
#define MCUXCLELS_TLS_FINALIZE 1u ///< Perform session key generation
/**
* @}
*/ /* mcuxClEls_Kdf_Define */
/**********************************************
* TYPEDEFS
**********************************************/
/**
* @defgroup mcuxClEls_Kdf_Types mcuxClEls_Kdf_Types
* @brief Defines all types of @ref mcuxClEls_Kdf
* @ingroup mcuxClEls_Kdf
* @{
*/
/** Internal command option bit field for CKDF functions. */
typedef union
{
struct
{
uint32_t value; ///< Accesses the bit field as a full word; initialize with a combination of constants from @ref MCUXCLELS_HKDF_VALUE_
} word;
struct
{
uint32_t :12;
uint32_t ckdf_algo :2; ///< Defines which algorithm and mode shall be used. This option is set internally and will be ignored:
///< #MCUXCLELS_CKDF_ALGO_SP800108 = Use SP800-108 algorithm
uint32_t :18;
} bits;
} mcuxClEls_CkdfOption_t;
/** Command option bit field for #mcuxClEls_Hkdf_Rfc5869_Async. */
typedef union
{
struct
{
uint32_t value; ///< Accesses the bit field as a full word; initialize with a combination of constants from @ref MCUXCLELS_HKDF_VALUE_
} word;
struct
{
uint32_t rtfdrvdat :1; ///< #MCUXCLELS_HKDF_SYSTEM_MEMORY_DERIV=use derivation input from system memory, #MCUXCLELS_HKDF_RTF_DERIV=use RTF (runtime fingerprint) as derivation input
uint32_t hkdf_algo :1; ///< Defines which algorithm shall be used. This option is set internally and will be ignored:
///< #MCUXCLELS_HKDF_ALGO_RFC5869 = Use RFC5869 algorithm
///< #MCUXCLELS_HKDF_ALGO_SP80056C = Use SP800-56C algorithm
uint32_t :30;
} bits;
} mcuxClEls_HkdfOption_t;
/** Internal command option bit field for #mcuxClEls_TlsGenerateMasterKeyFromPreMasterKey_Async, and #mcuxClEls_TlsGenerateMasterKeyFromPreMasterKey_Async. */
typedef union
{
struct
{
uint32_t value; ///< Accesses the bit field as a full word; initialize with a combination of constants from @ref MCUXCLELS_HKDF_VALUE_
} word;
struct
{
uint32_t :10;
uint32_t mode :1; ///< Defines which phase of the key generation is performed. This option is set internally and will be ignored:
///< #MCUXCLELS_TLS_INIT = Calculate master key from premaster key
///< #MCUXCLELS_TLS_FINALIZE = Calculate session keys from master key
uint32_t :21;
} bits;
} mcuxClEls_TlsOption_t;
/**
* @}
*/ /* mcuxClEls_Kdf_Types */
/**
* @}
*/ /* mcuxClEls_Kdf_Macros */
/**********************************************
* FUNCTIONS
**********************************************/
/**
* @defgroup mcuxClEls_Kdf_Functions mcuxClEls_Kdf_Functions
* @brief Defines all functions of @ref mcuxClEls_Kdf
* @ingroup mcuxClEls_Kdf
* @{
*/
/**
* @brief Derives a key using the HKDF (HMAC-based key derivation function) according to RFC5869.
* @if MCUXCL_FEATURE_ELS_SHA_DIRECT
* It must be ensured that SHA-Direct mode is disabled when calling this function (see #mcuxClEls_ShaDirect_Disable).
* @endif
* Call #mcuxClEls_WaitForOperation to complete the operation.
* @param[in] options The command options. For more information, see #mcuxClEls_HkdfOption_t.
* @param[in] derivationKeyIdx Key index used for derivation. Must be a 256-bit key with HKDF property bit set to 1.
* @param[in] targetKeyIdx Key bank number of the derived key. Will be a 256-bit key, the user must ensure there is enough space in the keystore to hold the derived key.
* @param[in] targetKeyProperties Requested properties for the derived key. The ksize field will be ignored.
* @param[in] pDerivationData The algorithm-specific derivation data, the length is #MCUXCLELS_HKDF_RFC5869_DERIVATIONDATA_SIZE bytes
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @else
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @endif
*
*
* @retval #MCUXCLELS_STATUS_SW_INVALID_PARAM if invalid parameters were specified
* @retval #MCUXCLELS_STATUS_SW_CANNOT_INTERRUPT if a running operation prevented the request
* @retval #MCUXCLELS_STATUS_OK_WAIT on successful request */
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_Hkdf_Rfc5869_Async)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_Hkdf_Rfc5869_Async(
mcuxClEls_HkdfOption_t options,
mcuxClEls_KeyIndex_t derivationKeyIdx,
mcuxClEls_KeyIndex_t targetKeyIdx,
mcuxClEls_KeyProp_t targetKeyProperties,
uint8_t const * pDerivationData
);
/** Derives a key using the HKDF (HMAC-based key derivation function) according to SP800-56C one-step approach with Sha2-256.
* @if MCUXCL_FEATURE_ELS_SHA_DIRECT
* It must be ensured that SHA-Direct mode is disabled when calling this function (see #mcuxClEls_ShaDirect_Disable).
* @endif
* Call #mcuxClEls_WaitForOperation to complete the operation.
*
* @param[in] derivationKeyIdx Key index used for derivation. Must be a 256-bit key with HKDF property bit set to 1.
* @param[out] pTagetKey Memory area to store the derived key. Will be a 256-bit key, the user must ensure there is enough space in the keystore to hold the derived key.
* @param[in] pDerivationData The algorithm-specific derivation data
* @param[in] derivationDataLength Length of the derivation data
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
*
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @else
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @endif
* @retval #MCUXCLELS_STATUS_SW_INVALID_PARAM if invalid parameters were specified
* @retval #MCUXCLELS_STATUS_SW_CANNOT_INTERRUPT if a running operation prevented the request
* @retval #MCUXCLELS_STATUS_OK_WAIT on successful request */
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_Hkdf_Sp80056c_Async)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_Hkdf_Sp80056c_Async(
mcuxClEls_KeyIndex_t derivationKeyIdx,
uint8_t * pTagetKey,
uint8_t const * pDerivationData,
size_t derivationDataLength
);
/** Derives a key using the NIST SP 800-108 CMAC-based Extract-and-Expand Key Derivation Function.
*
* @if ELS_AES_WITH_SIDE_CHANNEL_PROTECTION
* Before execution, ELS will wait until #mcuxClEls_HwState_t.drbgentlvl == #MCUXCLELS_STATUS_DRBGENTLVL_LOW. This can lead to a delay if the DRBG is in a state with less security strength at the time of the call.
* @endif
*
* Call #mcuxClEls_WaitForOperation to complete the operation.
*
* @param[in] derivationKeyIdx Key index used for derivation
* @param[in] targetKeyIdx Key bank number of the derived key
* @param[in] targetKeyProperties Requested properties for the derived key. Only set usage bits.
* @param[in] pDerivationData The algorithm-specific derivation data, the length is #MCUXCLELS_CKDF_DERIVATIONDATA_SIZE bytes
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @else
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @endif
* @retval #MCUXCLELS_STATUS_SW_INVALID_PARAM if invalid parameters were specified
* @retval #MCUXCLELS_STATUS_SW_CANNOT_INTERRUPT if a running operation prevented the request
* @retval #MCUXCLELS_STATUS_OK_WAIT on successful request */
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_Ckdf_Sp800108_Async)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_Ckdf_Sp800108_Async(
mcuxClEls_KeyIndex_t derivationKeyIdx,
mcuxClEls_KeyIndex_t targetKeyIdx,
mcuxClEls_KeyProp_t targetKeyProperties,
uint8_t const * pDerivationData
);
/** Generates a TLS master key based on a pre-master key and derivation data, according to the TLS 1.2 specification.
* The pre-master key is overwritten in this operation.
* @if MCUXCL_FEATURE_ELS_SHA_DIRECT
* It must be ensured that SHA-Direct mode is disabled when calling this function (see #mcuxClEls_ShaDirect_Disable).
* @endif
* Call #mcuxClEls_WaitForOperation to complete the operation.
*
* @param[in] pDerivationData The TLS derivation data, consisting of Label, Client Random and Server Random from the TLS 1.2 specification.
* Note: The order is different from #mcuxClEls_TlsGenerateSessionKeysFromMasterKey_Async.
* @param[in] keyProperties Desired key properties. Only #mcuxClEls_KeyProp_t::upprot_priv and #mcuxClEls_KeyProp_t::upprot_sec are used, the rest are ignored.
* @param[in] keyIdx The index of the TLS pre-master key, which is overwritten with the master key
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @else
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @endif
* @retval #MCUXCLELS_STATUS_SW_INVALID_PARAM if invalid parameters were specified
* @retval #MCUXCLELS_STATUS_SW_CANNOT_INTERRUPT if a running operation prevented the request
* @retval #MCUXCLELS_STATUS_OK_WAIT on successful request */
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_TlsGenerateMasterKeyFromPreMasterKey_Async)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_TlsGenerateMasterKeyFromPreMasterKey_Async(
uint8_t const * pDerivationData,
mcuxClEls_KeyProp_t keyProperties,
mcuxClEls_KeyIndex_t keyIdx
);
/** Generates TLS session keys based on a master key and derivation data, according to the TLS 1.2 specification.
* The master key and the following five key indices are overwritten in this operation.
* The keys are written in the following order:
* <ol>
* <li> Client Encryption Key
* <li> Client Message Authentication Key
* <li> Server Encryption Key
* <li> Server Message Authentication Key
* </ol>
* @if MCUXCL_FEATURE_ELS_SHA_DIRECT
* It must be ensured that SHA-Direct mode is disabled when calling this function (see #mcuxClEls_ShaDirect_Disable).
* @endif
* Call #mcuxClEls_WaitForOperation to complete the operation.
*
* @param[in] pDerivationData The TLS derivation data, consisting of Label, Server Random and Client Random from the TLS 1.2 specification.
* Note: The order is different from #mcuxClEls_TlsGenerateMasterKeyFromPreMasterKey_Async.
* @param[in] keyProperties Desired key properties. Only #mcuxClEls_KeyProp_t::upprot_priv and #mcuxClEls_KeyProp_t::upprot_sec are used, the rest are ignored.
* @param[in] keyIdx The index of the TLS master key, which is overwritten with one of the session keys.
* There must be three further consecutive unoccupied key indices following this index.
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @else
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @endif
* @retval #MCUXCLELS_STATUS_SW_INVALID_PARAM if invalid parameters were specified
* @retval #MCUXCLELS_STATUS_SW_CANNOT_INTERRUPT if a running operation prevented the request
* @retval #MCUXCLELS_STATUS_OK_WAIT on successful request */
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_TlsGenerateSessionKeysFromMasterKey_Async)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_TlsGenerateSessionKeysFromMasterKey_Async(
uint8_t const * pDerivationData,
mcuxClEls_KeyProp_t keyProperties,
mcuxClEls_KeyIndex_t keyIdx
);
/**
* @}
*/ /* mcuxClEls_Kdf_Functions */
/**
* @}
*/ /* mcuxClEls_Kdf */
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* MCUXCLELS_KDF_H_ */
@@ -0,0 +1,332 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2020-2023 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/**
* @file mcuxClEls_KeyManagement.h
* @brief ELS header for key management.
*
* This header exposes functions that can be used to manage the keystore of ELS.
* This includes:
* - Importing keys
* @if MCUXCL_FEATURE_ELS_KEY_MGMT_EXPORT
* - Exporting keys
* @endif
* @if MCUXCL_FEATURE_ELS_KEY_MGMT_DELETE
* - Deleting keys
* @endif
*/
/**
* @defgroup mcuxClEls_KeyManagement mcuxClEls_KeyManagement
* @brief This part of the @ref mcuxClEls driver supports functionality for keys management
* @ingroup mcuxClEls
* @{
*/
#ifndef MCUXCLELS_KEYMANAGEMENT_H_
#define MCUXCLELS_KEYMANAGEMENT_H_
#include <mcuxClConfig.h> // Exported features flags header
#include <mcuxClEls_Common.h> // Common functionality
#ifdef __cplusplus
extern "C" {
#endif
/**********************************************
* CONSTANTS
**********************************************/
/**
* @defgroup mcuxClEls_KeyManagement_Macros mcuxClEls_KeyManagement_Macros
* @brief Defines all macros of @ref mcuxClEls_KeyManagement
* @ingroup mcuxClEls_KeyManagement
* @{
*/
/**
* @defgroup MCUXCLELS_KEYIMPORT_VALUE_KFMT_ MCUXCLELS_KEYIMPORT_VALUE_KFMT_
* @brief Defines valid options (word value) to be used by #mcuxClEls_KeyImport_Async
* @ingroup mcuxClEls_KeyManagement_Macros
*
* @{
*/
#define MCUXCLELS_KEYIMPORT_VALUE_KFMT_UDF ((uint32_t) 0u<< 6u) ///< Key format UDF with shares in RTL or memory
#define MCUXCLELS_KEYIMPORT_VALUE_KFMT_RFC3394 ((uint32_t) 1u<< 6u) ///< Key format RFC3394 with shares in memory
#define MCUXCLELS_KEYIMPORT_VALUE_KFMT_PUF ((uint32_t) 2u<< 6u) ///< Key from PUF
#ifdef MCUXCL_FEATURE_ELS_PUK_INTERNAL
#define MCUXCLELS_KEYIMPORT_VALUE_KFMT_PBK ((uint32_t) 3u<< 6u) ///< Key from Public Key Certificate
#endif /* MCUXCL_FEATURE_ELS_PUK_INTERNAL */
/**
* @}
*/
/**
* @defgroup MCUXCLELS_KEYIMPORT_KFMT_ MCUXCLELS_KEYIMPORT_KFMT_
* @brief Defines valid options (bit values) to be used by #mcuxClEls_KeyImport_Async
* @ingroup mcuxClEls_KeyManagement_Macros
*
* @{
*/
#define MCUXCLELS_KEYIMPORT_KFMT_UDF (0x00u) ///< Key format UDF with shares in RTL or memory
#define MCUXCLELS_KEYIMPORT_KFMT_RFC3394 (0x01u) ///< Key format RFC3394 with shares in memory
#define MCUXCLELS_KEYIMPORT_KFMT_PUF (0x02u) ///< Key from PUF
#ifdef MCUXCL_FEATURE_ELS_PUK_INTERNAL
#define MCUXCLELS_KEYIMPORT_KFMT_PBK (0x03u) ///< Key from Public Key Certificate
#endif /* MCUXCL_FEATURE_ELS_PUK_INTERNAL */
#ifdef MCUXCL_FEATURE_ELS_PUK_INTERNAL
#define MCUXCLELS_KEYIMPORT_REVERSEFETCH_ENABLE (0x01U) ///< Reverse fetch enabled. For internal use
#define MCUXCLELS_KEYIMPORT_REVERSEFETCH_DISABLE (0x00U) ///< Reverse fetch disabled. For internal use
#endif /* MCUXCL_FEATURE_ELS_PUK_INTERNAL */
#define MCUXCLELS_RFC3394_OVERHEAD ((size_t) 16u) ///< Overhead between RFC3394 blob and key size
/**
* @}
*/
/**
* @defgroup MCUXCLELS_RFC3394_ MCUXCLELS_RFC3394_
* @brief Defines specifying the length of RFC3394 containers
* @ingroup mcuxClEls_KeyManagement_Macros
*
* @{
*/
#define MCUXCLELS_RFC3394_CONTAINER_SIZE_128 ((size_t) 256u/8u) ///< Size of RFC3394 container for 128 bit key
#define MCUXCLELS_RFC3394_CONTAINER_SIZE_256 ((size_t) 384u/8u) ///< Size of RFC3394 container for 256 bit key
#ifdef MCUXCL_FEATURE_ELS_PUK_INTERNAL
#define MCUXCLELS_RFC3394_CONTAINER_SIZE_P256 ((size_t) 640u/8u) ///< Size of RFC3394 container for P256 bit public key
#endif /* MCUXCL_FEATURE_ELS_PUK_INTERNAL */
/**
* @}
*/
/**
* @}
*/
/**********************************************
* TYPEDEFS
**********************************************/
/**
* @defgroup mcuxClEls_KeyManagement_Types mcuxClEls_KeyManagement_Types
* @brief Defines all types of @ref mcuxClEls_KeyManagement
* @ingroup mcuxClEls_KeyManagement
* @{
*/
/**
* @brief Command option bit field for #mcuxClEls_KeyImport_Async
*
* Bit field to configure #mcuxClEls_KeyImport_Async.
* See @ref MCUXCLELS_KEYIMPORT_KFMT_ for possible options in case the struct is accessed bit-wise.
* See @ref MCUXCLELS_KEYIMPORT_VALUE_KFMT_ for possible options in case the struct is accessed word-wise.
*/
typedef union
{
struct
{
uint32_t value; ///< Accesses the bit field as a full word; initialize with a combination of constants from @ref MCUXCLELS_KEYIMPORT_VALUE_KFMT_
} word; ///< Access #mcuxClEls_KeyImportOption_t word-wise
struct
{
uint32_t :4; ///< RFU
uint32_t revf :1; ///< This field is managed internally
uint32_t :1; ///< RFU
uint32_t kfmt :2; ///< Defines the key import format, one of @ref MCUXCLELS_KEYIMPORT_KFMT_
uint32_t :24; ///< RFU
} bits; ///< Access #mcuxClEls_KeyImportOption_t bit-wise
} mcuxClEls_KeyImportOption_t;
/**
* @}
*/
/**********************************************
* FUNCTIONS
**********************************************/
/**
* @defgroup mcuxClEls_KeyManagement_Functions mcuxClEls_KeyManagement_Functions
* @brief Defines all functions of @ref mcuxClEls_KeyManagement
* @ingroup mcuxClEls_KeyManagement
* @{
*/
/**
* @brief Deletes a key from keystore at the given index.
*
* Before execution, ELS will wait until #mcuxClEls_HwState_t.drbgentlvl == #MCUXCLELS_STATUS_DRBGENTLVL_LOW. This can lead to a delay if the DRBG is in a state with less security strength at the time of the call.
*
* Call #mcuxClEls_WaitForOperation to complete the operation.
*
* @param[in] keyIdx The index of the key to be deleted
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @else
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @endif
* @retval #MCUXCLELS_STATUS_SW_INVALID_PARAM if invalid parameters were specified
* @retval #MCUXCLELS_STATUS_SW_CANNOT_INTERRUPT if a running operation prevented the request
* @retval #MCUXCLELS_STATUS_SW_FAULT if a failure occurred
* @retval #MCUXCLELS_STATUS_OK_WAIT on successful request */
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_KeyDelete_Async)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_KeyDelete_Async(
mcuxClEls_KeyIndex_t keyIdx
);
/** @brief Imports a key from external storage to an internal key register.
*
* @if ELS_AES_WITH_SIDE_CHANNEL_PROTECTION
* Before execution, ELS will wait until #mcuxClEls_HwState_t.drbgentlvl == #MCUXCLELS_STATUS_DRBGENTLVL_LOW. This can lead to a delay if the DRBG is in a state with less security strength at the time of the call.
* @endif
*
* Call #mcuxClEls_WaitForOperation to complete the operation.
*
* @param[in] options One of @ref MCUXCLELS_KEYIMPORT_KFMT_
* @param[in] pImportKey Pointer to the RFC3394 container of the key to be imported
* @param[in] importKeyLength Length of the RFC3394 container of the key to be imported
* @param[in] wrappingKeyIdx Index of the key wrapping key, if importing RFC3394 format
* @param[in] targetKeyIdx The desired key index of the imported key
*
* <dl>
* <dt>Parameter properties</dt>
* <dd><dl>
* <dt>@p options.kfmt != #MCUXCLELS_KEYIMPORT_KFMT_RFC3394</dt><dd>
* <ul style="list-style: none;">
* <li>@p pImportKey is ignored.</li>
* <li>@p importKeyLength is ignored.</li>
* <li>@p wrappingKeyIdx is ignored.</li>
* <li>@p targetKeyIdx is ignored. The unpacked key is automatically stored in key slots 0, 1.</li>
* </ul></dd>
* </dt>
* </dl></dd>
* </dl>
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @else
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @endif
* @retval #MCUXCLELS_STATUS_SW_INVALID_PARAM if invalid parameters were specified
* @retval #MCUXCLELS_STATUS_SW_CANNOT_INTERRUPT if a running operation prevented the request
* @retval #MCUXCLELS_STATUS_OK_WAIT on successful request */
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_KeyImport_Async)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_KeyImport_Async(
mcuxClEls_KeyImportOption_t options,
uint8_t const * pImportKey,
size_t importKeyLength,
mcuxClEls_KeyIndex_t wrappingKeyIdx,
mcuxClEls_KeyIndex_t targetKeyIdx
);
#ifdef MCUXCL_FEATURE_ELS_PUK_INTERNAL
/** @brief Imports a public key to an internal key register if the signature verification of the provided public key against
* the provided signature is correct.
*
* Call #mcuxClEls_WaitForOperation to complete the operation.
*
* @param[in] pCertificate Pointer to the Certificate structure
* @param[in] certificateLength Length of the Certificate structure
* @param[in] publicKeyOffset Offset of the Public key to be imported within @p pCertificate
* @param[in] pSignature Signed challenge used to authenticate the imported key. Must be word aligned
* @param[in] verifyingKeyIdx The key index of the verifying public key
* @param[in] keyProperties The desired key properties of the imported key
* @param[in] targetKeyIdx The desired key index of the imported key
* @param[out] pOutput Pointer to the memory area which will receive the recalculated value of the R component in case of a successful
* certificate verification. Must be word aligned
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @else
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @endif
* @retval #MCUXCLELS_STATUS_SW_INVALID_PARAM if invalid parameters were specified
* @retval #MCUXCLELS_STATUS_SW_CANNOT_INTERRUPT if a running operation prevented the request
* @retval #MCUXCLELS_STATUS_OK_WAIT on successful request */
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_KeyImportPuk_Async)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_KeyImportPuk_Async(
uint8_t const * pCertificate,
size_t certificateLength,
size_t publicKeyOffset,
uint8_t const * pSignature,
mcuxClEls_KeyIndex_t verifyingKeyIdx,
mcuxClEls_KeyProp_t keyProperties,
mcuxClEls_KeyIndex_t targetKeyIdx,
uint8_t * pOutput
);
#endif /* MCUXCL_FEATURE_ELS_PUK_INTERNAL */
/** @brief Exports a key from an internal key register to external storage, using a wrapping key.
*
* @if ELS_AES_WITH_SIDE_CHANNEL_PROTECTION
* Before execution, ELS will wait until #mcuxClEls_HwState_t.drbgentlvl == #MCUXCLELS_STATUS_DRBGENTLVL_LOW. This can lead to a delay if the DRBG is in a state with less security strength at the time of the call.
* @endif
*
* Call #mcuxClEls_WaitForOperation to complete the operation.
*
* @param[in] wrappingKeyIdx The key used for key wrapping
* @param[in] exportKeyIdx The key to export
* @param[out] pOutput The memory address of the exported key
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @else
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @endif
* @retval #MCUXCLELS_STATUS_SW_INVALID_PARAM if invalid parameters were specified
* @retval #MCUXCLELS_STATUS_SW_CANNOT_INTERRUPT if a running operation prevented the request
* @retval #MCUXCLELS_STATUS_OK_WAIT on successful request */
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_KeyExport_Async)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_KeyExport_Async(
mcuxClEls_KeyIndex_t wrappingKeyIdx, ///< [in] The key used for key wrapping
mcuxClEls_KeyIndex_t exportKeyIdx, ///< [in] The key to export
uint8_t * pOutput ///< [out] The memory address of the exported key
);
/** @brief Exports the properties of the keys stored in the ELS internal keystore
*
* Call #mcuxClEls_WaitForOperation to complete the operation.
*
* @param[in] keyIdx Request key properties of the index defined here
* @param[out] pKeyProp Key properties of the index provided
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @else
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @endif
* @retval #MCUXCLELS_STATUS_SW_CANNOT_INTERRUPT if a running operation prevented the request
* @retval #MCUXCLELS_STATUS_OK on successful request */
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_GetKeyProperties)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_GetKeyProperties(
mcuxClEls_KeyIndex_t keyIdx,
mcuxClEls_KeyProp_t * pKeyProp
);
/**
* @}
*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* MCUXCLELS_KEYMANAGEMENT_H_ */
/**
* @}
*/
@@ -0,0 +1,435 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2020-2023 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/**
* @file mcuxClEls_Rng.h
* @brief ELS header for random number generation.
* This header exposes functions to configure the ELS RNGs (DRBG and DTRNG) and to generate random data.
*/
#ifndef MCUXCLELS_RNG_H_
#define MCUXCLELS_RNG_H_
#include <mcuxClConfig.h> // Exported features flags header
#include <mcuxClEls_Common.h> // Common functionality
#ifdef __cplusplus
extern "C" {
#endif
/**
* @defgroup mcuxClEls_Rng mcuxClEls_Rng
* @brief This part of the @ref mcuxClEls driver supports functionality for random number generation
* @ingroup mcuxClEls
* @{
*/
/**********************************************
* CONSTANTS
**********************************************/
/**
* @defgroup mcuxClEls_Rng_Macros mcuxClEls_Rng_Macros
* @brief Defines all macros of @ref mcuxClEls_Rng
* @ingroup mcuxClEls_Rng
* @{
*/
#define MCUXCLELS_RNG_DTRNG_CONFIG_SIZE ((uint8_t) 84) ///< Size of DTRNG configuration
#define MCUXCLELS_RNG_DTRNG_EVAL_CONFIG_SIZE ((uint8_t) 52) ///< Size of DTRNG characterization data
#define MCUXCLELS_RNG_DTRNG_EVAL_RESULT_SIZE ((uint8_t) 188) ///< Size of DTRNG characterization result
#define MCUXCLELS_RNG_DRBG_TEST_EXTRACT_OUTPUT_MIN_SIZE 4U ///< Minimum output size of #mcuxClEls_Rng_DrbgTestExtract_Async
#define MCUXCLELS_RNG_DRBG_TEST_EXTRACT_OUTPUT_MAX_SIZE ((uint32_t) 1U << 16U) ///< Maximum output size of #mcuxClEls_Rng_DrbgTestExtract_Async
#define MCUXCLELS_RNG_DRBG_TEST_MODE_INSTANTIATE ((uint32_t) 0U) ///< Command options value for DRBG Test Instantiate command. For internal use
#define MCUXCLELS_RNG_DRBG_TEST_MODE_EXTRACT ((uint32_t) 1U) ///< Command options value for DRBG Test Extract command. For internal use
#define MCUXCLELS_RNG_DRBG_TEST_MODE_AES_ECB ((uint32_t) 3U) ///< Command options value for DRBG Test AES-ECB command. For internal use
#define MCUXCLELS_RNG_DRBG_TEST_MODE_AES_CTR ((uint32_t) 2U) ///< Command options value for DRBG Test AES-CTR command. For internal use
#ifdef MCUXCL_FEATURE_ELS_RND_RAW
#define MCUXCLELS_RNG_RND_REQ_RND_RAW ((uint32_t) 1U << 1) ///< Command options value for RND_REQ command. For internal use
#define MCUXCLELS_RNG_RAW_ENTROPY_SIZE ((uint32_t) 32U) ///< Fixed size of raw entropy when using the DTRNG
#endif /* MCUXCL_FEATURE_ELS_RND_RAW */
#ifdef MCUXCL_FEATURE_ELS_PRND_INIT
#define MCUXCLELS_RNG_RND_REQ_PRND_INIT ((uint32_t) 1U << 0) ///< Command options value for PRND_INIT command. For internal use
#endif /* MCUXCL_FEATURE_ELS_PRND_INIT */
/**
* @}
*/
/**********************************************
* FUNCTIONS
**********************************************/
/**
* @defgroup mcuxClEls_Rng_Functions mcuxClEls_Rng_Functions
* @brief Defines all functions of @ref mcuxClEls_Rng
* @ingroup mcuxClEls_Rng
* @{
*/
/**
* @brief Writes random data from the ELS DRBG to the given buffer.
*
* This function fills a buffer with random values from the DRBG. The DRBG provides 128 bits of security strength.
*
* Before execution, ELS will wait until #mcuxClEls_HwState_t.drbgentlvl == #MCUXCLELS_STATUS_DRBGENTLVL_HIGH. This can lead to a delay if the DRBG is in a state with less security strength at the time of the call.
*
* If the random values from the DRBG are later used as a cryptographic key, the security strength of the cryptographic operation using the generated key should not exceed that of the DRBG.
*
* To name a few examples, this means (as per NIST SP 800-57 Part 1 Rev. 5):
* - AES-192 or AES-256 keys generated with this function will provide only 128 bits of security strength
* - RSA keys longer than 3072 bits will provide only 128 bits of security strength
* - ECC keys longer than 383 bits will provide only 128 bits of security strength
*
* Call #mcuxClEls_WaitForOperation to complete the operation.
*
* @param[out] pOutput Pointer to the beginning of the memory area to fill with random data
* @param[in] outputLength Number of requested random bytes
*
* <dl>
* <dt>Parameter properties</dt>
* <dd><dl>
* <dt>@p outputLength </dt>
* <dd>supported values are #MCUXCLELS_RNG_DRBG_TEST_EXTRACT_OUTPUT_MIN_SIZE bytes up to
* #MCUXCLELS_RNG_DRBG_TEST_EXTRACT_OUTPUT_MAX_SIZE bytes. The size must be a multiple of 4.</dd>
* </dl></dd>
* </dl>
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @else
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @endif
* @retval #MCUXCLELS_STATUS_SW_CANNOT_INTERRUPT if a running operation prevented the request
* @retval #MCUXCLELS_STATUS_SW_FAULT in case of an internal error
* @retval #MCUXCLELS_STATUS_OK_WAIT on successful request
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_Rng_DrbgRequest_Async)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_Rng_DrbgRequest_Async(
uint8_t * pOutput,
size_t outputLength
);
#ifdef MCUXCL_FEATURE_ELS_RND_RAW
/**
* @brief Writes 32 bytes of raw random data from the ELS TRNG to the given buffer.
*
* This function fills a buffer with raw (unprocessed) random values from the TRNG.
*
* Call #mcuxClEls_WaitForOperation to complete the operation.
*
* @param[out] pOutput Pointer to the beginning of the memory area to fill with random data
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @else
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @endif
* @retval #MCUXCLELS_STATUS_SW_CANNOT_INTERRUPT if a running operation prevented the request
* @retval #MCUXCLELS_STATUS_OK_WAIT on successful request
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_Rng_DrbgRequestRaw_Async)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_Rng_DrbgRequestRaw_Async(
uint8_t * pOutput
);
#endif /* MCUXCL_FEATURE_ELS_RND_RAW */
/**
* @brief Instantiates the DRBG in test mode.
*
* This function is a support function for FIPS CAVP testing. This function turns the ELS internal DRBG in test mode by loading known entropy from system memory.
* Call #mcuxClEls_WaitForOperation to complete the operation.
* Note that this function will alter the ELS internal entropy state which needs to be updated by the TRNG to use the DRBG in normal mode.
* The update process is majorly impacted by the time the TRNG needs to provide fresh entropy.
*
* @param[in] pEntropy Pointer to the input entropy data
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @else
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @endif
* @retval #MCUXCLELS_STATUS_SW_CANNOT_INTERRUPT if a running operation prevented the request
* @retval #MCUXCLELS_STATUS_OK_WAIT on successful request
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_Rng_DrbgTestInstantiate_Async)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_Rng_DrbgTestInstantiate_Async(
uint8_t const * pEntropy
);
/**
* @brief Performs a DRBG extraction.
*
* This function is a support function for FIPS CAVP testing. This function mimics the behavior of #mcuxClEls_Rng_DrbgRequest_Async and fills a buffer with random data when DRBG is in test mode.
* Call #mcuxClEls_WaitForOperation to complete the operation.
* Note that this function will alter the ELS internal entropy state which needs to be updated by the TRNG to use the DRBG in normal mode.
* The update process is majorly impacted by the time the TRNG needs to provide fresh entropy.
*
* @attention #mcuxClEls_Rng_DrbgTestInstantiate_Async must be called prior to this function.
*
* @param[out] pOutput Pointer to the output random number
* @param[in] outputLength Length of the random number
*
* <dl>
* <dt>Parameter properties</dt>
* <dd><dl>
* <dt>@p outputLength </dt>
* <dd>supported values are #MCUXCLELS_RNG_DRBG_TEST_EXTRACT_OUTPUT_MIN_SIZE bytes up to
* #MCUXCLELS_RNG_DRBG_TEST_EXTRACT_OUTPUT_MAX_SIZE bytes. The size must be a multiple of 4.</dd>
* </dl></dd>
* </dl>
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref MCUXCLELS_STATUS_ and @ref mcuxCsslFlowProtection)
* @else
* @return An error code (see @ref MCUXCLELS_STATUS_)
* @endif
* @retval #MCUXCLELS_STATUS_SW_CANNOT_INTERRUPT if a running operation prevented the request
* @retval #MCUXCLELS_STATUS_OK_WAIT on successful request
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_Rng_DrbgTestExtract_Async)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_Rng_DrbgTestExtract_Async(
uint8_t * pOutput,
size_t outputLength
);
/**
* @brief Encrypts data using the AES-ECB engine of the DRBG.
*
* This function is a support function for FIPS CAVP testing. This function performs an AES-ECB encryption on system data to evaluate the encryption engine of the DRBG.
* Call #mcuxClEls_WaitForOperation to complete the operation.
* Note that this function will alter the ELS internal entropy state which needs to be updated by the TRNG to use the DRBG in normal mode.
* The update process is majorly impacted by the time the TRNG needs to provide fresh entropy.
*
* @param[in] pDataKey Pointer to the data and key
* @param[out] pOutput Pointer to the encrypted output
*
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @else
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @endif
* @retval #MCUXCLELS_STATUS_SW_CANNOT_INTERRUPT if a running operation prevented the request
* @retval #MCUXCLELS_STATUS_OK_WAIT on successful request
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_Rng_DrbgTestAesEcb_Async)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_Rng_DrbgTestAesEcb_Async(
uint8_t const * pDataKey,
uint8_t * pOutput
);
/**
* @brief Encrypts data using the AES-CTR engine of the DRBG.
*
* This function is a support function for FIPS CAVP testing. This function performs an AES-CTR encryption on system data to evaluate the encryption engine of the DRBG in test mode.
* Call #mcuxClEls_WaitForOperation to complete the operation.
* Note that this function will alter the ELS internal entropy state which needs to be updated by the TRNG to use the DRBG in normal mode.
* The update process is majorly impacted by the time the TRNG needs to provide fresh entropy.
*
* @param[in] pData Pointer to the data to be encrypted
* @param[in] dataLength Length of the data to be encrypted
* @param[in] pIvKey Pointer to the IV and key
* @param[out] pOutput Pointer to the encrypted output
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @else
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @endif
* @retval #MCUXCLELS_STATUS_SW_CANNOT_INTERRUPT if a running operation prevented the request
* @retval #MCUXCLELS_STATUS_OK_WAIT on successful request
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_Rng_DrbgTestAesCtr_Async)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_Rng_DrbgTestAesCtr_Async(
uint8_t const * pData,
size_t dataLength,
uint8_t const * pIvKey,
uint8_t * pOutput
);
/**
* @brief Loads a configuration of the ELS DTRNG.
*
* This function overwrites the default DTRNG configuration in order to optimize or fine tune the DTRNG entropy gathering process.
* Call #mcuxClEls_WaitForOperation to complete the operation.
* Note that the TRNG configuration set by this function is non-persistent and any reset of the ELS (e.g. a power-cycle or calling #mcuxClEls_Reset_Async) will resets the DTRNG configuration to its default value.
*
* @if MCUXCL_FEATURE_ELS_SHA_DIRECT
* It must be ensured that SHA-Direct mode is disabled when calling this function (see #mcuxClEls_ShaDirect_Disable).
* @endif
*
* @param[in] pInput The pointer to DTRNG initialization data
*
* <dl>
* <dt>Parameter properties</dt>
* <dd><dl>
* <dt>@p pInput </dt>
* <dd>The size is #MCUXCLELS_RNG_DTRNG_CONFIG_SIZE bytes.</dd>
* </dl></dd>
* </dl>
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @else
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @endif
* @retval #MCUXCLELS_STATUS_SW_CANNOT_INTERRUPT if a running operation prevented the request
* @retval #MCUXCLELS_STATUS_OK_WAIT on successful request
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_Rng_Dtrng_ConfigLoad_Async)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_Rng_Dtrng_ConfigLoad_Async(
uint8_t const * pInput
);
/**
* @brief Performs characterization of the ELS DTRNG.
*
* This function evaluates a DTRNG configuration for device specific characterization. The configuration used for characterization has to be placed in system memory.
* Call #mcuxClEls_WaitForOperation to complete the operation.
*
* @attention If this function is called once, all other ELS commands except #mcuxClEls_Rng_Dtrng_ConfigEvaluate_Async are blocked until any reset of the ELS (e.g. a power-cycle or calling #mcuxClEls_Reset_Async) is triggered.
*
* @param[in] pInput The pointer to DTRNG initialization data
* @param[out] pOutput The pointer to the evaluation result
*
* <dl>
* <dt>Parameter properties</dt>
* <dd><dl>
* <dt>@p pInput </dt>
* <dd>The size is #MCUXCLELS_RNG_DTRNG_EVAL_CONFIG_SIZE bytes.</dd>
* <dt>@p pOutput </dt>
* <dd>The size is #MCUXCLELS_RNG_DTRNG_EVAL_RESULT_SIZE bytes.</dd>
* </dl></dd>
* </dl>
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @else
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @endif
* @retval #MCUXCLELS_STATUS_SW_CANNOT_INTERRUPT if a running operation prevented the request
* @retval #MCUXCLELS_STATUS_OK_WAIT on successful request
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_Rng_Dtrng_ConfigEvaluate_Async)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_Rng_Dtrng_ConfigEvaluate_Async(
uint8_t const * pInput,
uint8_t * pOutput
);
#ifdef MCUXCL_FEATURE_ELS_PRND_INIT
/**
* @brief Initializes the ELS PRNG.
*
* This function initializes the PRNG. After this operation #mcuxClEls_HwState_t.drbgentlvl == #MCUXCLELS_STATUS_DRBGENTLVL_LOW. This can lead to a delay if the DRBG is in a state with lower security strength at the time of the call.
*
* Call #mcuxClEls_WaitForOperation to complete the operation.
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @else
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @endif
* @retval #MCUXCLELS_STATUS_SW_CANNOT_INTERRUPT if a running operation prevented the request
* @retval #MCUXCLELS_STATUS_OK_WAIT on successful request
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_Prng_Init_Async)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_Prng_Init_Async(void);
#endif /* MCUXCL_FEATURE_ELS_PRND_INIT */
/**
* @brief Returns one random word from the ELS PRNG.
*
* This function returns one low-quality random CPU word gathered from the PRNG.
*
* @attention PRNG has to be initialized prior to the first time calling this function.
*
* @param[out] pWord The pointer to the random word
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @else
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @endif
* @retval #MCUXCLELS_STATUS_OK on successful request
* @retval #MCUXCLELS_STATUS_HW_PRNG in case of insufficient entropy
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_Prng_GetRandomWord)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_Prng_GetRandomWord(
uint32_t * pWord
);
/**
* @brief Writes random data from the ELS PRNG to the given buffer.
*
* This function fills a buffer with low-quality random values gathered from the PRNG.
*
* @attention PRNG has to be initialized prior to the first time calling this function.
*
* @param[out] pOutput Pointer to the beginning of the memory area to fill with random data from PRNG
* @param[in] outputLength Size of @p pOutput in bytes
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @else
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @endif
* @retval #MCUXCLELS_STATUS_OK on successful request
* @retval #MCUXCLELS_STATUS_HW_PRNG in case of insufficient entropy
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_Prng_GetRandom)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_Prng_GetRandom(
uint8_t * pOutput,
size_t outputLength
);
#ifdef MCUXCL_FEATURE_ELS_ITERATIVE_SEEDING
/**
* @brief This function checks if a DRBG reseeding is needed and if so reseeds the ELS DRBG.
*
* This function checks if the ELS DRBG needs to be reseeded by the DTRNG, and if so, executes the iterative seeding process.
* The function internally disables ELS interrupts before (potentially) running the iterative seeding process and restores
* the original ELS interrupt enable flags afterwards, before returning to the caller. This allows to properly use the function
* in an ELS interrupt handler to reseed the ELS DRBG when needed.
*
* @param[in] pDtrngConfig Pointer to the beginning of the memory area which contains the ELS DTRNG config
*
* @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
* @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @else
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
* @endif
* @retval #MCUXCLELS_STATUS_OK on successful request
* @retval #MCUXCLELS_STATUS_SW_FAULT in case the iterative seeding failed
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_Dtrng_IterativeReseeding_CheckAndReseed)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_Dtrng_IterativeReseeding_CheckAndReseed(const uint8_t *pDtrngConfig);
#endif /* MCUXCL_FEATURE_ELS_ITERATIVE_SEEDING */
/**
* @}
*/ /* mcuxClEls_Rng_Functions */
/**
* @}
*/ /* mcuxClEls_Rng */
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* MCUXCLELS_RNG_H_ */
@@ -0,0 +1,306 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2020-2023 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/**
* @file mcuxClEls_Types.h
* @brief ELS type header.
*
* This header defines types that are used by other mcuxClEls headers.
*/
/**
* @defgroup mcuxClEls_Types mcuxClEls_Types
* @brief This part of the @ref mcuxClEls driver defines common types
* @ingroup mcuxClEls
* @{
*/
#ifndef MCUXCLELS_TYPES_H_
#define MCUXCLELS_TYPES_H_
#include <stdint.h>
#include <stddef.h>
#include <mcuxClConfig.h> // Exported features flags header
#include <mcuxCsslFlowProtection.h>
#include <mcuxClEls_mapping.h>
#ifdef __cplusplus
extern "C" {
#endif
/**********************************************
* MACROS
**********************************************/
/**
* @defgroup mcuxClEls_Types_Macros mcuxClEls_Types_Macros
* @brief Defines all macros of @ref mcuxClEls_Types
* @ingroup mcuxClEls_Types
* @{
*/
#define MCUXCLELS_KEY_SLOTS (20U) ///< Number of key slots in the ELS key store.
/** @defgroup MCUXCLELS_KEYPROPERTY_VALUE_ MCUXCLELS_KEYPROPERTY_VALUE_
* @brief Constants for initalizing #mcuxClEls_KeyProp_t.word
* @ingroup mcuxClEls_Types_Macros
* @{
*/
#define MCUXCLELS_KEYPROPERTY_VALUE_KEY_SIZE_128 ((uint32_t) 0u<< 0u) ///< 128-bit key
#define MCUXCLELS_KEYPROPERTY_VALUE_KEY_SIZE_256 ((uint32_t) 1u<< 0u) ///< 256-bit key
#ifdef MCUXCL_FEATURE_ELS_PUK_INTERNAL
#define MCUXCLELS_KEYPROPERTY_VALUE_KEY_SIZE_512 ((uint32_t) 3u<< 0u) ///< 512-bit key
#endif /* MCUXCL_FEATURE_ELS_PUK_INTERNAL */
#define MCUXCLELS_KEYPROPERTY_VALUE_ACTIVE ((uint32_t) 1u<< 5u) ///< Key is active (loaded)
#define MCUXCLELS_KEYPROPERTY_VALUE_BASE_SLOT ((uint32_t) 1u<< 6u) ///< First part of multi-slot key
#define MCUXCLELS_KEYPROPERTY_VALUE_GENERAL_PURPOSE_SLOT ((uint32_t) 1u<< 7u) ///< General purpose key slot
#define MCUXCLELS_KEYPROPERTY_VALUE_RETENTION_SLOT ((uint32_t) 1u<< 8u) ///< Retention key slot
#define MCUXCLELS_KEYPROPERTY_VALUE_HW_OUT_SLOT ((uint32_t) 1u<< 9u) ///< Hardware output key slot
#ifdef MCUXCL_FEATURE_ELS_PUK_INTERNAL
#define MCUXCLELS_KEYPROPERTY_VALUE_PUK ((uint32_t) 1u<<11u) ///< Trusted Public Key
#define MCUXCLELS_KEYPROPERTY_VALUE_TECDH ((uint32_t) 1u<<12u) ///< Private key that can only be used in ECDH with Trusted Public Key
#endif /* MCUXCL_FEATURE_ELS_PUK_INTERNAL */
#define MCUXCLELS_KEYPROPERTY_VALUE_CMAC ((uint32_t) 1u<<13u) ///< CMAC key
#define MCUXCLELS_KEYPROPERTY_VALUE_KSK ((uint32_t) 1u<<14u) ///< Key signing key
#define MCUXCLELS_KEYPROPERTY_VALUE_RTF ((uint32_t) 1u<<15u) ///< RTF signing key
#define MCUXCLELS_KEYPROPERTY_VALUE_CKDF ((uint32_t) 1u<<16u) ///< CKDF signing key
#define MCUXCLELS_KEYPROPERTY_VALUE_HKDF ((uint32_t) 1u<<17u) ///< HKDF signing key
#define MCUXCLELS_KEYPROPERTY_VALUE_ECSGN ((uint32_t) 1u<<18u) ///< ECC signing key
#define MCUXCLELS_KEYPROPERTY_VALUE_ECDH ((uint32_t) 1u<<19u) ///< ECC Diffie Hellman private key
#define MCUXCLELS_KEYPROPERTY_VALUE_AES ((uint32_t) 1u<<20u) ///< AES key
#define MCUXCLELS_KEYPROPERTY_VALUE_HMAC ((uint32_t) 1u<<21u) ///< HMAC key
#define MCUXCLELS_KEYPROPERTY_VALUE_KWK ((uint32_t) 1u<<22u) ///< Key Wrapping Key
#define MCUXCLELS_KEYPROPERTY_VALUE_KUOK ((uint32_t) 1u<<23u) ///< Key Unwrapping Only Key
#define MCUXCLELS_KEYPROPERTY_VALUE_TLS_PREMASTER_SECRET ((uint32_t) 1u<<24u) ///< TLS Premaster Secret
#define MCUXCLELS_KEYPROPERTY_VALUE_TLS_MASTER_SECRET ((uint32_t) 1u<<25u) ///< TLS Master Secret
#define MCUXCLELS_KEYPROPERTY_VALUE_KGSRC ((uint32_t) 1u<<26u) ///< Can provide key material input for ECC key generation
#define MCUXCLELS_KEYPROPERTY_VALUE_HW_OUT ((uint32_t) 1u<<27u) ///< A key to be used in a hardware out key slot
#define MCUXCLELS_KEYPROPERTY_VALUE_WRPOK ((uint32_t) 1u<<28u) ///< The key can be wrapped
#define MCUXCLELS_KEYPROPERTY_VALUE_DUK ((uint32_t) 1u<<29u) ///< Device Unique Key
#define MCUXCLELS_KEYPROPERTY_VALUE_PRIVILEGED ((uint32_t) 1u<<30u) ///< Caller must be in privileged mode to use the key
#define MCUXCLELS_KEYPROPERTY_VALUE_NOTPRIVILEGED ((uint32_t) 0u<<30u) ///< Caller does not have to be in privileged mode to use the key
#define MCUXCLELS_KEYPROPERTY_VALUE_SECURE ((uint32_t) 0u<<31u) ///< Caller must be in secure mode to use the key
#define MCUXCLELS_KEYPROPERTY_VALUE_NOTSECURE ((uint32_t) 1u<<31u) ///< Caller does not have to be in secure mode to use the key
/**
* @}
*/
/** @defgroup MCUXCLELS_KEYPROPERTY_ MCUXCLELS_KEYPROPERTY_
* @brief Constants for initalizing #mcuxClEls_KeyProp_t.bits
* @ingroup mcuxClEls_Types_Macros
* @{
*/
#define MCUXCLELS_KEYPROPERTY_KEY_SIZE_128 (0U) ///< This value of #mcuxClEls_KeyProp_t.ksize indicates a 128 bit key
#define MCUXCLELS_KEYPROPERTY_KEY_SIZE_256 (1U) ///< This value of #mcuxClEls_KeyProp_t.ksize indicates a 256 bit key
#ifdef MCUXCL_FEATURE_ELS_PUK_INTERNAL
#define MCUXCLELS_KEYPROPERTY_KEY_SIZE_512 (3U) ///< This value of #mcuxClEls_KeyProp_t.ksize indicates a 512 bit key
#endif /* MCUXCL_FEATURE_ELS_PUK_INTERNAL */
#define MCUXCLELS_KEYPROPERTY_ACTIVE_TRUE (1U) ///< This value of #mcuxClEls_KeyProp_t.kactv indicates that the slot contains an active key
#define MCUXCLELS_KEYPROPERTY_ACTIVE_FALSE (0U) ///< This value of #mcuxClEls_KeyProp_t.kactv indicates that the slot does not contain active key
#define MCUXCLELS_KEYPROPERTY_BASE_SLOT (1U) ///< This value of #mcuxClEls_KeyProp_t.kbase indicates that the slot is the base slot of a 2-slot key
#define MCUXCLELS_KEYPROPERTY_SECOND_SLOT (0U) ///< This value of #mcuxClEls_KeyProp_t.kbase indicates that the slot is the second slot of a 2-slot key
#define MCUXCLELS_KEYPROPERTY_GENERAL_PURPOSE_SLOT_TRUE (1U) ///< This value of #mcuxClEls_KeyProp_t.fgp indicates that the slot is a retention key slot or a hardware out key slot
#define MCUXCLELS_KEYPROPERTY_GENERAL_PURPOSE_SLOT_FALSE (0U) ///< This value of #mcuxClEls_KeyProp_t.fgp indicates that the slot is a neither retention key slot nor hardware out key slot
#define MCUXCLELS_KEYPROPERTY_RETENTION_SLOT_TRUE (1U) ///< This value of #mcuxClEls_KeyProp_t.frtn indicates that the slot is a retention key slot
#define MCUXCLELS_KEYPROPERTY_RETENTION_SLOT_FALSE (0U) ///< This value of #mcuxClEls_KeyProp_t.frtn indicates that the slot is not a retention key slot
#define MCUXCLELS_KEYPROPERTY_HW_OUT_SLOT_TRUE (1U) ///< This value of #mcuxClEls_KeyProp_t.fhwo indicates that the slot is a hardware out key slot
#define MCUXCLELS_KEYPROPERTY_HW_OUT_SLOT_FALSE (0U) ///< This value of #mcuxClEls_KeyProp_t.fhwo indicates that the slot is not a hardware out key slot
#ifdef MCUXCL_FEATURE_ELS_PUK_INTERNAL
#define MCUXCLELS_KEYPROPERTY_PUK_TRUE (1U) ///< This value of #mcuxClEls_KeyProp_t.upuk indicates that the slot is a Trusted Public Key
#define MCUXCLELS_KEYPROPERTY_PUK_FALSE (0U) ///< This value of #mcuxClEls_KeyProp_t.upuk indicates that the slot is not a Trusted Public Key
#define MCUXCLELS_KEYPROPERTY_TECDH_TRUE (1U) ///< This value of #mcuxClEls_KeyProp_t.utecdh indicates that the slot is a Private key that can only be used in ECDH with Trusted Public Key
#define MCUXCLELS_KEYPROPERTY_TECDH_FALSE (0U) ///< This value of #mcuxClEls_KeyProp_t.utecdh indicates that the slot is not a Private key that can only be used in ECDH with Trusted Public Key
#endif /* MCUXCL_FEATURE_ELS_PUK_INTERNAL */
#define MCUXCLELS_KEYPROPERTY_CMAC_TRUE (1U) ///< This value of #mcuxClEls_KeyProp_t.ucmac indicates that the key can be used for CMAC
#define MCUXCLELS_KEYPROPERTY_CMAC_FALSE (0U) ///< This value of #mcuxClEls_KeyProp_t.ucmac indicates that the key cannot be used for CMAC
#define MCUXCLELS_KEYPROPERTY_KSK_TRUE (1U) ///< This value of #mcuxClEls_KeyProp_t.uksk indicates that the key can be used for key signing
#define MCUXCLELS_KEYPROPERTY_KSK_FALSE (0U) ///< This value of #mcuxClEls_KeyProp_t.uksk indicates that the key cannot be used for key signing
#define MCUXCLELS_KEYPROPERTY_RTF_TRUE (1U) ///< This value of #mcuxClEls_KeyProp_t.urtf indicates that the key can be used for RTF signing
#define MCUXCLELS_KEYPROPERTY_RTF_FALSE (0U) ///< This value of #mcuxClEls_KeyProp_t.urtf indicates that the key cannot be used for RTF signing
#define MCUXCLELS_KEYPROPERTY_CKDF_TRUE (1U) ///< This value of #mcuxClEls_KeyProp_t.uckdf indicates that the key can be used for CKDF
#define MCUXCLELS_KEYPROPERTY_CKDF_FALSE (0U) ///< This value of #mcuxClEls_KeyProp_t.uckdf indicates that the key cannot be used for CKDF
#define MCUXCLELS_KEYPROPERTY_HKDF_TRUE (1U) ///< This value of #mcuxClEls_KeyProp_t.uhkdf indicates that the key can be used for HKDF
#define MCUXCLELS_KEYPROPERTY_HKDF_FALSE (0U) ///< This value of #mcuxClEls_KeyProp_t.uhkdf indicates that the key cannot be used for HKDF
#define MCUXCLELS_KEYPROPERTY_ECC_TRUE (1U) ///< This value of #mcuxClEls_KeyProp_t.uecsg indicates that the key can be used for ECC signing
#define MCUXCLELS_KEYPROPERTY_ECC_FALSE (0U) ///< This value of #mcuxClEls_KeyProp_t.uecsg indicates that the key cannot be used for ECC signing
#define MCUXCLELS_KEYPROPERTY_ECC_DH_PRIVATE_TRUE (1U) ///< This value of #mcuxClEls_KeyProp_t.uecdh indicates that the key is a ECC Diffie Hellman private key
#define MCUXCLELS_KEYPROPERTY_ECC_DH_PRIVATE_FALSE (0U) ///< This value of #mcuxClEls_KeyProp_t.uecdh indicates that the key is not an ECC Diffie Hellman private key
#define MCUXCLELS_KEYPROPERTY_AES_TRUE (1U) ///< This value of #mcuxClEls_KeyProp_t.uaes indicates that the key is an AES key
#define MCUXCLELS_KEYPROPERTY_AES_FALSE (0U) ///< This value of #mcuxClEls_KeyProp_t.uaes indicates that the key is not an AES key
#define MCUXCLELS_KEYPROPERTY_HMAC_TRUE (1U) ///< This value of #mcuxClEls_KeyProp_t.uhmac indicates that the key is an HMAC key
#define MCUXCLELS_KEYPROPERTY_HMAC_FALSE (0U) ///< This value of #mcuxClEls_KeyProp_t.uhmac indicates that the key is not an HMAC key
#define MCUXCLELS_KEYPROPERTY_KWK_TRUE (1U) ///< This value of #mcuxClEls_KeyProp_t.ukwk indicates that the key is a Key Wrapping Key
#define MCUXCLELS_KEYPROPERTY_KWK_FALSE (0U) ///< This value of #mcuxClEls_KeyProp_t.ukwk indicates that the key is not a Key Wrapping Key
#define MCUXCLELS_KEYPROPERTY_KUOK_TRUE (1U) ///< This value of #mcuxClEls_KeyProp_t.ukuok indicates that the key is a Key Unwrapping Only Key
#define MCUXCLELS_KEYPROPERTY_KUOK_FALSE (0U) ///< This value of #mcuxClEls_KeyProp_t.ukuok indicates that the key is not a Key Unwrapping Only Key
#define MCUXCLELS_KEYPROPERTY_TLS_PREMASTER_SECRET_TRUE (1U) ///< This value of #mcuxClEls_KeyProp_t.utlspms indicates that the key is a TLS Premaster Secret
#define MCUXCLELS_KEYPROPERTY_TLS_PREMASTER_SECRET_FALSE (0U) ///< This value of #mcuxClEls_KeyProp_t.utlspms indicates that the key is not a TLS Premaster Secret
#define MCUXCLELS_KEYPROPERTY_TLS_MASTER_SECRET_TRUE (1U) ///< This value of #mcuxClEls_KeyProp_t.utlsms indicates that the key is a TLS Master Secret
#define MCUXCLELS_KEYPROPERTY_TLS_MASTER_SECRET_FALSE (0U) ///< This value of #mcuxClEls_KeyProp_t.utlsms indicates that the key is not a TLS Master Secret
#define MCUXCLELS_KEYPROPERTY_INPUT_FOR_ECC_TRUE (1U) ///< This value of #mcuxClEls_KeyProp_t.ukgsrc indicates that the key can be used as key material input for ECC key generation
#define MCUXCLELS_KEYPROPERTY_INPUT_FOR_ECC_FALSE (0U) ///< This value of #mcuxClEls_KeyProp_t.ukgsrc indicates that the key cannot be used as key material input for ECC key generation
#define MCUXCLELS_KEYPROPERTY_HW_OUT_TRUE (1U) ///< This value of #mcuxClEls_KeyProp_t.uhwo indicates that the key can be used in a hardware out key slot
#define MCUXCLELS_KEYPROPERTY_HW_OUT_FALSE (0U) ///< This value of #mcuxClEls_KeyProp_t.uhwo indicates that the key cannot be used in a hardware out key slot
#define MCUXCLELS_KEYPROPERTY_WRAP_TRUE (1U) ///< This value of #mcuxClEls_KeyProp_t.wrpok indicates that the key can be wrapped
#define MCUXCLELS_KEYPROPERTY_WRAP_FALSE (0U) ///< This value of #mcuxClEls_KeyProp_t.wrpok indicates that the key cannot be wrapped
#define MCUXCLELS_KEYPROPERTY_DEVICE_UNIQUE_TRUE (1U) ///< This value of #mcuxClEls_KeyProp_t.duk indicates that the key is a Device Unique Key
#define MCUXCLELS_KEYPROPERTY_DEVICE_UNIQUE_FALSE (0U) ///< This value of #mcuxClEls_KeyProp_t.duk indicates that the key is not a Device Unique Key
#define MCUXCLELS_KEYPROPERTY_PRIVILEGED_TRUE (1U) ///< This value of #mcuxClEls_KeyProp_t.upprot_priv indicates that the caller must be in privileged mode to use the key
#define MCUXCLELS_KEYPROPERTY_PRIVILEGED_FALSE (0U) ///< This value of #mcuxClEls_KeyProp_t.upprot_priv indicates that the caller does not need to be in privileged mode to use the key
#define MCUXCLELS_KEYPROPERTY_SECURE_TRUE (0U) ///< This value of #mcuxClEls_KeyProp_t.upprot_sec indicates that the caller must be in secure mode to use the key
#define MCUXCLELS_KEYPROPERTY_SECURE_FALSE (1U) ///< This value of #mcuxClEls_KeyProp_t.upprot_sec indicates that the caller does not need to be in secure mode to use the key
/**
* @}
*/
/**
* @defgroup MCUXCLELS_STATUS_ MCUXCLELS_STATUS_
* @brief Return code definitions
* @ingroup mcuxClEls_Types_Macros
* @{
*/
#define MCUXCLELS_STATUS_OK ((mcuxClEls_Status_t) 0x05552E03u) ///< No error occurred
#define MCUXCLELS_STATUS_OK_WAIT ((mcuxClEls_Status_t) 0x05552E07u) ///< An <tt>_Async</tt> function successfully started an ELS command. Call #mcuxClEls_WaitForOperation to complete it
#define MCUXCLELS_STATUS_HW_FAULT ((mcuxClEls_Status_t) 0x05555330u) ///< ELS hardware detected a fault
#define MCUXCLELS_STATUS_HW_ALGORITHM ((mcuxClEls_Status_t) 0x05555334u) ///< An algorithm failed in hardware
#define MCUXCLELS_STATUS_HW_OPERATIONAL ((mcuxClEls_Status_t) 0x05555338u) ///< ELS was operated incorrectly
#define MCUXCLELS_STATUS_HW_BUS ((mcuxClEls_Status_t) 0x0555533Cu) ///< A bus access failed
#define MCUXCLELS_STATUS_HW_INTEGRITY ((mcuxClEls_Status_t) 0x05555370u) ///< An integrity check failed in hardware
#define MCUXCLELS_STATUS_HW_PRNG ((mcuxClEls_Status_t) 0x05555374u) ///< Read access to PRNG output while PRNG is not in ready state
#define MCUXCLELS_STATUS_HW_DTRNG ((mcuxClEls_Status_t) 0x05555378u) ///< Unable to get entropy from dTRNG with current configuration
#define MCUXCLELS_STATUS_SW_FAULT ((mcuxClEls_Status_t) 0x0555F0F0u) ///< Software detected a fault
#define MCUXCLELS_STATUS_SW_CANNOT_INTERRUPT ((mcuxClEls_Status_t) 0x055553B0u) ///< an ELS command was started while the ELS was still busy, or a SHA-Direct command was started while the SHA kernel was still busy
#define MCUXCLELS_STATUS_SW_INVALID_PARAM ((mcuxClEls_Status_t) 0x055553F8u) ///< Incorrect parameters were supplied
#define MCUXCLELS_STATUS_SW_INVALID_STATE ((mcuxClEls_Status_t) 0x055553B8u) ///< This can happen when ELS is in a wrong state for the requested ELS command
#define MCUXCLELS_STATUS_SW_COUNTER_EXPIRED ((mcuxClEls_Status_t) 0x055553BCu) ///< A software counter expired while waiting for an ELS operation to finish
#define MCUXCLELS_STATUS_SW_COMPARISON_FAILED ((mcuxClEls_Status_t) 0x05558930u) ///< A comparison between an ELS flag and its expected value failed
#ifdef MCUXCL_FEATURE_ELS_LOCKING
#define MCUXCLELS_STATUS_SW_LOCKING_FAILED ((mcuxClEls_Status_t) 0x055553F4u) ///< Unable to obtain ELS lock
#define MCUXCLELS_STATUS_SW_STATUS_LOCKED ((mcuxClEls_Status_t) 0x05552E0Bu) ///< ELS status is locked
#endif /* MCUXCL_FEATURE_ELS_LOCKING */
/** @} */
#define MCUXCLELS_STATUS_IS_HW_ERROR(x_) ((((mcuxClEls_Status_t) (x_)) & 0x0000FF00U) == 0x0000E100U) ///< Checks whether an error code is a hardware error. Indicates that an error was reported by ELS hardware.
#define MCUXCLELS_STATUS_IS_SW_ERROR(x_) ((((mcuxClEls_Status_t) (x_)) & 0x0000FF00U) == 0x0000F000U) ///< Checks whether an error code is a software error. Indicates that the error was detected by the driver software and not by ELS hardware.
/**
* @}
*/
/**********************************************
* TYPEDEFS
**********************************************/
/**
* @defgroup mcuxClEls_Types_Types mcuxClEls_Types_Types
* @brief Defines all types of @ref mcuxClEls_Types
* @ingroup mcuxClEls_Types
* @{
*/
/**
* @brief Type for ELS driver status codes
*/
typedef uint32_t mcuxClEls_Status_t;
/**
* @brief Deprecated type for ELS driver protected status codes
*/
typedef MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_Status_Protected_t;
/**
* @brief Type for ELS keystore indices
*/
typedef uint32_t mcuxClEls_KeyIndex_t;
/** Type for ELS key store key properties */
typedef union
{
struct
{
uint32_t value; ///< Accesses the bit field as a full word; initialize with a combination of constants from @ref MCUXCLELS_KEYPROPERTY_VALUE_
} word; ///< Access #mcuxClEls_KeyProp_t word-wise
struct
{
#ifdef MCUXCL_FEATURE_ELS_PUK_INTERNAL
uint32_t ksize :2; ///< Key size
uint32_t :3; ///< RFU
#else
uint32_t ksize :1; ///< Key size
uint32_t :4; ///< RFU
#endif
uint32_t kactv :1; ///< Status flag to indicate whether the key slot contains an active key or not
uint32_t kbase :1; ///< Status flag to indicate whether the key slot is a base slot or the second slot of a 256-bit key
uint32_t fgp :1; ///< Hardware feature flag: General purpose key slot
uint32_t frtn :1; ///< Hardware feature flag: Retention key slot
uint32_t fhwo :1; ///< Hardware feature flag: Hardware-out key slot
#ifdef MCUXCL_FEATURE_ELS_PUK_INTERNAL
uint32_t :1; ///< RFU
uint32_t upuk :1; ///< Usage permission for Trusted Public Key
uint32_t utecdh :1; ///< Usage permission for Private key that can only be used in ECDH with Trusted Public Key
#else
uint32_t :3; ///< RFU
#endif /* MCUXCL_FEATURE_ELS_PUK_INTERNAL */
uint32_t ucmac :1; ///< Usage permission for CMAC
uint32_t uksk :1; ///< Usage permission for key signing
uint32_t urtf :1; ///< Usage permission for RTF signing
uint32_t uckdf :1; ///< Usage permission for CKDF
uint32_t uhkdf :1; ///< Usage permission for HKDF
uint32_t uecsg :1; ///< Usage permission for ECDSA signing
uint32_t uecdh :1; ///< Usage permission for Elliptic Curve Diffie-Hellman
uint32_t uaes :1; ///< Usage permission for AES
uint32_t uhmac :1; ///< Usage permission for HMAC
uint32_t ukwk :1; ///< Usage permission for key wrapping
uint32_t ukuok :1; ///< Usage permission for key unwrapping, but not for key wrapping
uint32_t utlspms :1; ///< Usage permission as a TLS premaster secret
uint32_t utlsms :1; ///< Usage permission as a TLS master secret
uint32_t ukgsrc :1; ///< Usage permission as input for ECC key generation
uint32_t uhwo :1; ///< Usage permission in a hardware-out key slot
uint32_t wrpok :1; ///< Usage permission to wrap
uint32_t duk :1; ///< Device-unique key flag
uint32_t upprot_priv :1; ///< Access restriction to privileged mode
uint32_t upprot_sec :1; ///< Access restriction to TrustZone secure mode
} bits; ///< Access #mcuxClEls_KeyProp_t bit-wise
} mcuxClEls_KeyProp_t;
#define utlpsms utlspms ///< Deprecated name for #mcuxClEls_KeyProp_t.utlspms
/**
* @brief Function type for transfer of data to a memory-mapped register
*
* This function type is used as a callback for handling data transfer from memory to a memory-mapped register.
* Such a function shall read data from the @c uint8_t array source, and write data via a sequence of writes to @p destRegister.
* Further specification of this function's behavior can be found in the documentation of the function that accepts this function as a callback parameter.
*
* @param [out] pDestRegister Memory-mapped register that the output data shall be written to
* @param [in] pSource Array containing the input data
* @param [in] sourceLength Size of @p source in bytes
* @param [in, out] pCallerData Custom pointer that is provided by the caller and forwarded to the callback function by the operation
* @return An error code that can be any error code in @ref MCUXCLELS_STATUS_, see individual documentation for more information
*/
typedef mcuxClEls_Status_t (*mcuxClEls_TransferToRegisterFunction_t)(
uint32_t volatile * pDestRegister,
uint8_t const * pSource,
size_t sourceLength,
void * pCallerData);
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* MCUXCLELS_TYPES_H_ */
/**
* @}
*
* @}
*/
@@ -0,0 +1,549 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2022 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/**
* @file mcuxClEls_mapping.h
* @brief Header providing mapping for legacy function/definition names (with CSS)
*/
#ifndef MCUXCLELS_MAPPING_H_
#define MCUXCLELS_MAPPING_H_
/* Public definitions */
/**
* MCUXCLCSS_CSS_((?:INTERRUPT_DISABLE|INTERRUPT_ENABLE|INTERRUPT_KEEP|INTERRUPT_SET|RESET_CLEAR|RESET_KEEP))(?!\w)
* -->
* MCUXCLELS_ELS_\1
*
* MCUXCLCSS_((?:API|AEAD_AAD_BLOCK_SIZE|AEAD_ACPMOD_AADPROC|AEAD_ACPMOD_FINAL|AEAD_ACPMOD_INIT|AEAD_ACPMOD_MSGPROC|AEAD_CONTEXT_SIZE|AEAD_DECRYPT|AEAD_ENCRYPT|AEAD_EXTERN_KEY|AEAD_INTERN_KEY|AEAD_IV_BLOCK_SIZE|AEAD_LASTINIT_FALSE|AEAD_LASTINIT_TRUE|AEAD_STATE_IN_DISABLE|AEAD_STATE_IN_ENABLE|AEAD_STATE_OUT_ENABLE|AEAD_TAG_SIZE|CIPHERPARAM_ALGORITHM_AES_CBC|CIPHERPARAM_ALGORITHM_AES_CTR|CIPHERPARAM_ALGORITHM_AES_ECB|CIPHER_BLOCK_SIZE_AES|CIPHER_DECRYPT|CIPHER_ENCRYPT|CIPHER_EXTERNAL_KEY|CIPHER_INTERNAL_KEY|CIPHER_KEY_SIZE_AES_128|CIPHER_KEY_SIZE_AES_192|CIPHER_KEY_SIZE_AES_256|CIPHER_STATE_IN_DISABLE|CIPHER_STATE_IN_ENABLE|CIPHER_STATE_OUT_DISABLE|CIPHER_STATE_OUT_ENABLE|CKDF_ALGO_SP800108|CKDF_ALGO_SP80056C_EXPAND|CKDF_ALGO_SP80056C_EXTRACT|CKDF_DERIVATIONDATA_SIZE|CKDF_RTF_DERIV|CKDF_SP80056C_DERIVATIONDATA_SIZE_16|CKDF_SP80056C_DERIVATIONDATA_SIZE_32|CKDF_SYSTEM_MEMORY_DERIV|CMAC_EXTERNAL_KEY_DISABLE|CMAC_EXTERNAL_KEY_ENABLE|CMAC_FINALIZE_DISABLE|CMAC_FINALIZE_ENABLE|CMAC_INITIALIZE_DISABLE|CMAC_INITIALIZE_ENABLE|CMAC_KEY_SIZE_128|CMAC_KEY_SIZE_256|CMAC_OUT_SIZE))(?!\w)
* MCUXCLCSS_((?:CMD_CRC_CMD_ID_AUTH_CIPHER|CMD_CRC_CMD_ID_CHAL_RESP_GEN|CMD_CRC_CMD_ID_CIPHER|CMD_CRC_CMD_ID_CKDF|CMD_CRC_CMD_ID_CMAC|CMD_CRC_CMD_ID_DRBG_TEST|CMD_CRC_CMD_ID_DTRNG_CFG_LOAD|CMD_CRC_CMD_ID_DTRNG_EVAL|CMD_CRC_CMD_ID_ECKXH|CMD_CRC_CMD_ID_ECSIGN|CMD_CRC_CMD_ID_ECVFY|CMD_CRC_CMD_ID_GDET_CFG_LOAD|CMD_CRC_CMD_ID_GDET_TRIM|CMD_CRC_CMD_ID_HASH|CMD_CRC_CMD_ID_HKDF|CMD_CRC_CMD_ID_HMAC|CMD_CRC_CMD_ID_KDELETE|CMD_CRC_CMD_ID_KEYGEN|CMD_CRC_CMD_ID_KEYIN|CMD_CRC_CMD_ID_KEYOUT|CMD_CRC_CMD_ID_KEYPROV|CMD_CRC_CMD_ID_RND_REQ|CMD_CRC_CMD_ID_TLS|CMD_CRC_DISABLE|CMD_CRC_ENABLE|CMD_CRC_INITIAL_VALUE|CMD_CRC_POLYNOMIAL|CMD_CRC_REFERENCE_INIT|CMD_CRC_REFERENCE_RESET|CMD_CRC_REFERENCE_UPDATE_AEAD_FINALIZE|CMD_CRC_REFERENCE_UPDATE_AEAD_INIT|CMD_CRC_REFERENCE_UPDATE_AEAD_PARTIALINIT|CMD_CRC_REFERENCE_UPDATE_AEAD_UPDATEAAD|CMD_CRC_REFERENCE_UPDATE_AEAD_UPDATEDATA|CMD_CRC_REFERENCE_UPDATE_CIPHER|CMD_CRC_REFERENCE_UPDATE_CKDF_SP800108|CMD_CRC_REFERENCE_UPDATE_CKDF_SP80056C_EXPAND|CMD_CRC_REFERENCE_UPDATE_CKDF_SP80056C_EXTRACT|CMD_CRC_REFERENCE_UPDATE_CMAC))(?!\w)
* MCUXCLCSS_((?:CMD_CRC_REFERENCE_UPDATE_ECCKEYEXCHANGE|CMD_CRC_REFERENCE_UPDATE_ECCKEYEXCHANGEINT|CMD_CRC_REFERENCE_UPDATE_ECCKEYGEN|CMD_CRC_REFERENCE_UPDATE_ECCSIGN|CMD_CRC_REFERENCE_UPDATE_ECCVERFIFY|CMD_CRC_REFERENCE_UPDATE_ECCVERFIFYINT|CMD_CRC_REFERENCE_UPDATE_GLITCHDETECTOR_LOADCONFIG|CMD_CRC_REFERENCE_UPDATE_GLITCHDETECTOR_TRIM|CMD_CRC_REFERENCE_UPDATE_HASH|CMD_CRC_REFERENCE_UPDATE_HKDF_RFC5869|CMD_CRC_REFERENCE_UPDATE_HKDF_SP80056C|CMD_CRC_REFERENCE_UPDATE_HMAC|CMD_CRC_REFERENCE_UPDATE_KEYDELETE|CMD_CRC_REFERENCE_UPDATE_KEYEXPORT|CMD_CRC_REFERENCE_UPDATE_KEYIMPORT|CMD_CRC_REFERENCE_UPDATE_KEYIMPORTPUK|CMD_CRC_REFERENCE_UPDATE_KEYPROVISION|CMD_CRC_REFERENCE_UPDATE_KEYPROVISIONROM|CMD_CRC_REFERENCE_UPDATE_PRNG_INIT|CMD_CRC_REFERENCE_UPDATE_RESPGEN|CMD_CRC_REFERENCE_UPDATE_RNG_DRBGREQUEST|CMD_CRC_REFERENCE_UPDATE_RNG_DRBGREQUESTRAW|CMD_CRC_REFERENCE_UPDATE_RNG_DRBGTESTAESCTR|CMD_CRC_REFERENCE_UPDATE_RNG_DRBGTESTAESECB|CMD_CRC_REFERENCE_UPDATE_RNG_DRBGTESTEXTRACT|CMD_CRC_REFERENCE_UPDATE_RNG_DRBGTESTINSTANTIATE|CMD_CRC_REFERENCE_UPDATE_RNG_DTRNG_CONFIGEVALUATE))(?!\w)
* MCUXCLCSS_((?:CMD_CRC_REFERENCE_UPDATE_RNG_DTRNG_CONFIGLOAD|CMD_CRC_REFERENCE_UPDATE_TLSGENERATEMASTERKEYFROMPREMASTERKEY|CMD_CRC_REFERENCE_UPDATE_TLSGENERATESESSIONKEYSFROMMASTERKEY|CMD_CRC_RESET|CMD_CRC_VALUE_DISABLE|CMD_CRC_VALUE_ENABLE|CMD_CRC_VALUE_RESET|DMA_READBACK_PROTECTION_TOKEN|ECC_EXTKEY_EXTERNAL|ECC_EXTKEY_INTERNAL|ECC_GEN_PUBLIC_KEY|ECC_HASHED|ECC_INCLUDE_RANDOM_DATA|ECC_NOT_HASHED|ECC_NO_RANDOM_DATA|ECC_NO_RTF|ECC_OUTPUTKEY_DETERMINISTIC|ECC_OUTPUTKEY_KEYEXCHANGE|ECC_OUTPUTKEY_RANDOM|ECC_OUTPUTKEY_SIGN|ECC_PUBLICKEY_SIGN_DISABLE|ECC_PUBLICKEY_SIGN_ENABLE|ECC_PUBLICKEY_SIZE|ECC_REVERSEFETCH_DISABLE|ECC_REVERSEFETCH_ENABLE|ECC_RTF|ECC_SIGNATURE_R_SIZE|ECC_SIGNATURE_SIZE|ECC_SKIP_PUBLIC_KEY|ECC_VALUE_HASHED|ECC_VALUE_NOT_HASHED|ECC_VALUE_NO_RTF|ECC_VALUE_RTF|ERROR_FLAGS_CLEAR|ERROR_FLAGS_KEEP|GLITCHDETECTOR_CFG_SIZE|GLITCHDETECTOR_TRIM_SIZE|GLITCH_DETECTOR_INTERRUPT_DISABLE|GLITCH_DETECTOR_INTERRUPT_ENABLE|GLITCH_DETECTOR_NEG_KEEP))(?!\w)
* MCUXCLCSS_((?:GLITCH_DETECTOR_NEG_SET|GLITCH_DETECTOR_POS_KEEP|GLITCH_DETECTOR_POS_SET|GLITCH_DETECTOR_RESET_CLEAR|GLITCH_DETECTOR_RESET_KEEP|HASH_BLOCK_SIZE_SHA_224|HASH_BLOCK_SIZE_SHA_256|HASH_BLOCK_SIZE_SHA_384|HASH_BLOCK_SIZE_SHA_512|HASH_INIT_DISABLE|HASH_INIT_ENABLE|HASH_LOAD_DISABLE|HASH_LOAD_ENABLE|HASH_MODE_SHA_224|HASH_MODE_SHA_256|HASH_MODE_SHA_384|HASH_MODE_SHA_512|HASH_OUTPUT_DISABLE|HASH_OUTPUT_ENABLE|HASH_OUTPUT_SIZE_SHA_224|HASH_OUTPUT_SIZE_SHA_256|HASH_OUTPUT_SIZE_SHA_384|HASH_OUTPUT_SIZE_SHA_512|HASH_RTF_OUTPUT_DISABLE|HASH_RTF_OUTPUT_ENABLE|HASH_RTF_OUTPUT_SIZE|HASH_RTF_UPDATE_DISABLE|HASH_RTF_UPDATE_ENABLE|HASH_STATE_SIZE_SHA_224|HASH_STATE_SIZE_SHA_256|HASH_STATE_SIZE_SHA_384|HASH_STATE_SIZE_SHA_512|HASH_VALUE_MODE_SHA_224|HASH_VALUE_MODE_SHA_256|HASH_VALUE_MODE_SHA_384|HASH_VALUE_MODE_SHA_512|HKDF_ALGO_RFC5869|HKDF_ALGO_SP80056C|HKDF_RFC5869_DERIVATIONDATA_SIZE|HKDF_SP80056C_TARGETKEY_SIZE|HKDF_VALUE_MEMORY_DERIV|HKDF_VALUE_RTF_DERIV|HMAC_EXTERNAL_KEY_DISABLE|HMAC_EXTERNAL_KEY_ENABLE|HMAC_OUTPUT_SIZE|HMAC_PADDED_KEY_SIZE|HW_VERSION))(?!\w)
* MCUXCLCSS_((?:KEYGEN_VALUE_DETERMINISTIC|KEYGEN_VALUE_GEN_PUB_KEY|KEYGEN_VALUE_NO_PUB_KEY|KEYGEN_VALUE_NO_RANDOM_DATA|KEYGEN_VALUE_RANDOM|KEYGEN_VALUE_SIGN_PUBLICKEY|KEYGEN_VALUE_TYPE_KEYEXCHANGE|KEYGEN_VALUE_TYPE_SIGN|KEYGEN_VALUE_USE_RANDOM_DATA|KEYIMPORT_KFMT_PBK|KEYIMPORT_KFMT_PUF|KEYIMPORT_KFMT_RFC3394|KEYIMPORT_KFMT_UDF|KEYIMPORT_REVERSEFETCH_DISABLE|KEYIMPORT_REVERSEFETCH_ENABLE|KEYIMPORT_VALUE_KFMT_PBK|KEYIMPORT_VALUE_KFMT_PUF|KEYIMPORT_VALUE_KFMT_RFC3394|KEYIMPORT_VALUE_KFMT_UDF|KEYPROPERTY_ACTIVE_FALSE|KEYPROPERTY_ACTIVE_TRUE|KEYPROPERTY_AES_FALSE|KEYPROPERTY_AES_TRUE|KEYPROPERTY_BASE_SLOT|KEYPROPERTY_CKDF_FALSE|KEYPROPERTY_CKDF_TRUE|KEYPROPERTY_CMAC_FALSE|KEYPROPERTY_CMAC_TRUE|KEYPROPERTY_DEVICE_UNIQUE_FALSE|KEYPROPERTY_DEVICE_UNIQUE_TRUE|KEYPROPERTY_ECC_DH_PRIVATE_FALSE|KEYPROPERTY_ECC_DH_PRIVATE_TRUE|KEYPROPERTY_ECC_FALSE|KEYPROPERTY_ECC_TRUE|KEYPROPERTY_GENERAL_PURPOSE_SLOT_FALSE|KEYPROPERTY_GENERAL_PURPOSE_SLOT_TRUE|KEYPROPERTY_HKDF_FALSE|KEYPROPERTY_HKDF_TRUE|KEYPROPERTY_HMAC_FALSE|KEYPROPERTY_HMAC_TRUE|KEYPROPERTY_HW_OUT_FALSE|KEYPROPERTY_HW_OUT_SLOT_FALSE))(?!\w)
* MCUXCLCSS_((?:KEYPROPERTY_HW_OUT_SLOT_TRUE|KEYPROPERTY_HW_OUT_TRUE|KEYPROPERTY_INPUT_FOR_ECC_FALSE|KEYPROPERTY_INPUT_FOR_ECC_TRUE|KEYPROPERTY_KEY_SIZE_128|KEYPROPERTY_KEY_SIZE_256|KEYPROPERTY_KEY_SIZE_512|KEYPROPERTY_KSK_FALSE|KEYPROPERTY_KSK_TRUE|KEYPROPERTY_KUOK_FALSE|KEYPROPERTY_KUOK_TRUE|KEYPROPERTY_KWK_FALSE|KEYPROPERTY_KWK_TRUE|KEYPROPERTY_PRIVILEGED_FALSE|KEYPROPERTY_PRIVILEGED_TRUE|KEYPROPERTY_PUK_FALSE|KEYPROPERTY_PUK_TRUE|KEYPROPERTY_RETENTION_SLOT_FALSE|KEYPROPERTY_RETENTION_SLOT_TRUE|KEYPROPERTY_RTF_FALSE|KEYPROPERTY_RTF_TRUE|KEYPROPERTY_SECOND_SLOT|KEYPROPERTY_SECURE_FALSE|KEYPROPERTY_SECURE_TRUE|KEYPROPERTY_TECDH_FALSE|KEYPROPERTY_TECDH_TRUE|KEYPROPERTY_TLS_MASTER_SECRET_FALSE|KEYPROPERTY_TLS_MASTER_SECRET_TRUE|KEYPROPERTY_TLS_PREMASTER_SECRET_FALSE|KEYPROPERTY_TLS_PREMASTER_SECRET_TRUE|KEYPROPERTY_VALUE_ACTIVE|KEYPROPERTY_VALUE_AES|KEYPROPERTY_VALUE_BASE_SLOT|KEYPROPERTY_VALUE_CKDF|KEYPROPERTY_VALUE_CMAC|KEYPROPERTY_VALUE_DUK|KEYPROPERTY_VALUE_ECDH|KEYPROPERTY_VALUE_ECSGN|KEYPROPERTY_VALUE_GENERAL_PURPOSE_SLOT|KEYPROPERTY_VALUE_HKDF|KEYPROPERTY_VALUE_HMAC))(?!\w)
* MCUXCLCSS_((?:KEYPROPERTY_VALUE_HW_OUT|KEYPROPERTY_VALUE_HW_OUT_SLOT|KEYPROPERTY_VALUE_KEY_SIZE_128|KEYPROPERTY_VALUE_KEY_SIZE_256|KEYPROPERTY_VALUE_KEY_SIZE_512|KEYPROPERTY_VALUE_KGSRC|KEYPROPERTY_VALUE_KSK|KEYPROPERTY_VALUE_KUOK|KEYPROPERTY_VALUE_KWK|KEYPROPERTY_VALUE_NOTPRIVILEGED|KEYPROPERTY_VALUE_NOTSECURE|KEYPROPERTY_VALUE_PRIVILEGED|KEYPROPERTY_VALUE_PUK|KEYPROPERTY_VALUE_RETENTION_SLOT|KEYPROPERTY_VALUE_RTF|KEYPROPERTY_VALUE_SECURE|KEYPROPERTY_VALUE_TECDH|KEYPROPERTY_VALUE_TLS_MASTER_SECRET|KEYPROPERTY_VALUE_TLS_PREMASTER_SECRET|KEYPROPERTY_VALUE_WRPOK|KEYPROPERTY_WRAP_FALSE|KEYPROPERTY_WRAP_TRUE|KEYPROV_DUK_UPDATE_DISABLE|KEYPROV_DUK_UPDATE_ENABLE|KEYPROV_KEYSHARE_TABLE_SIZE|KEYPROV_KEY_PART_1_SIZE|KEYPROV_NOIC_DISABLE|KEYPROV_NOIC_ENABLE|KEYPROV_TESTERSHARE_SIZE|KEYPROV_VALUE_NOIC|KEY_SLOTS|MASTER_UNLOCK_ANY|RESET_CANCEL|RESET_DO_NOT_CANCEL|RESP_GEN_AVAILABLE_SLOT_0|RESP_GEN_AVAILABLE_SLOT_1|RESP_GEN_AVAILABLE_SLOT_2|RESP_GEN_SLOTS|RFC3394_CONTAINER_SIZE_128|RFC3394_CONTAINER_SIZE_256|RFC3394_CONTAINER_SIZE_P256|RFC3394_OVERHEAD|RNG_DRBG_TEST_EXTRACT_OUTPUT_MAX_SIZE))(?!\w)
* MCUXCLCSS_((?:RNG_DRBG_TEST_EXTRACT_OUTPUT_MIN_SIZE|RNG_DRBG_TEST_MODE_AES_CTR|RNG_DRBG_TEST_MODE_AES_ECB|RNG_DRBG_TEST_MODE_EXTRACT|RNG_DRBG_TEST_MODE_INSTANTIATE|RNG_DTRNG_CONFIG_SIZE|RNG_DTRNG_EVAL_CONFIG_SIZE|RNG_DTRNG_EVAL_RESULT_SIZE|RNG_RAW_ENTROPY_SIZE|RNG_RND_REQ_PRND_INIT|RNG_RND_REQ_RND_RAW|STATUS_DRBGENTLVL_HIGH|STATUS_DRBGENTLVL_LOW|STATUS_DRBGENTLVL_NONE|STATUS_ECDSAVFY_ERROR|STATUS_ECDSAVFY_FAIL|STATUS_ECDSAVFY_NORUN|STATUS_ECDSAVFY_OK|STATUS_HW_ALGORITHM|STATUS_HW_BUS|STATUS_HW_DTRNG|STATUS_HW_FAULT|STATUS_HW_INTEGRITY|STATUS_HW_OPERATIONAL|STATUS_HW_PRNG|STATUS_IS_HW_ERROR|STATUS_IS_SW_ERROR|STATUS_OK|STATUS_OK_WAIT|STATUS_PPROT_PRIVILEGED_NONSECURE|STATUS_PPROT_PRIVILEGED_SECURE|STATUS_PPROT_UNPRIVILEGED_NONSECURE|STATUS_PPROT_UNPRIVILEGED_SECURE|STATUS_SW_CANNOT_INTERRUPT|STATUS_SW_COMPARISON_FAILED|STATUS_SW_COUNTER_EXPIRED|STATUS_SW_FAULT|STATUS_SW_INVALID_PARAM|STATUS_SW_INVALID_STATE|STATUS_SW_LOCKING_FAILED|STATUS_SW_STATUS_LOCKED|TLS_DERIVATIONDATA_SIZE|TLS_FINALIZE|TLS_INIT|TLS_RANDOM_SIZE))(?!\w)
* -->
* MCUXCLELS_\1
*/
#define MCUXCLCSS_API MCUXCLELS_API
#define MCUXCLCSS_AEAD_AAD_BLOCK_SIZE MCUXCLELS_AEAD_AAD_BLOCK_SIZE
#define MCUXCLCSS_AEAD_ACPMOD_AADPROC MCUXCLELS_AEAD_ACPMOD_AADPROC
#define MCUXCLCSS_AEAD_ACPMOD_FINAL MCUXCLELS_AEAD_ACPMOD_FINAL
#define MCUXCLCSS_AEAD_ACPMOD_INIT MCUXCLELS_AEAD_ACPMOD_INIT
#define MCUXCLCSS_AEAD_ACPMOD_MSGPROC MCUXCLELS_AEAD_ACPMOD_MSGPROC
#define MCUXCLCSS_AEAD_CONTEXT_SIZE MCUXCLELS_AEAD_CONTEXT_SIZE
#define MCUXCLCSS_AEAD_DECRYPT MCUXCLELS_AEAD_DECRYPT
#define MCUXCLCSS_AEAD_ENCRYPT MCUXCLELS_AEAD_ENCRYPT
#define MCUXCLCSS_AEAD_EXTERN_KEY MCUXCLELS_AEAD_EXTERN_KEY
#define MCUXCLCSS_AEAD_INTERN_KEY MCUXCLELS_AEAD_INTERN_KEY
#define MCUXCLCSS_AEAD_IV_BLOCK_SIZE MCUXCLELS_AEAD_IV_BLOCK_SIZE
#define MCUXCLCSS_AEAD_LASTINIT_FALSE MCUXCLELS_AEAD_LASTINIT_FALSE
#define MCUXCLCSS_AEAD_LASTINIT_TRUE MCUXCLELS_AEAD_LASTINIT_TRUE
#define MCUXCLCSS_AEAD_STATE_IN_DISABLE MCUXCLELS_AEAD_STATE_IN_DISABLE
#define MCUXCLCSS_AEAD_STATE_IN_ENABLE MCUXCLELS_AEAD_STATE_IN_ENABLE
#define MCUXCLCSS_AEAD_STATE_OUT_ENABLE MCUXCLELS_AEAD_STATE_OUT_ENABLE
#define MCUXCLCSS_AEAD_TAG_SIZE MCUXCLELS_AEAD_TAG_SIZE
#define MCUXCLCSS_CIPHERPARAM_ALGORITHM_AES_CBC MCUXCLELS_CIPHERPARAM_ALGORITHM_AES_CBC
#define MCUXCLCSS_CIPHERPARAM_ALGORITHM_AES_CTR MCUXCLELS_CIPHERPARAM_ALGORITHM_AES_CTR
#define MCUXCLCSS_CIPHERPARAM_ALGORITHM_AES_ECB MCUXCLELS_CIPHERPARAM_ALGORITHM_AES_ECB
#define MCUXCLCSS_CIPHER_BLOCK_SIZE_AES MCUXCLELS_CIPHER_BLOCK_SIZE_AES
#define MCUXCLCSS_CIPHER_DECRYPT MCUXCLELS_CIPHER_DECRYPT
#define MCUXCLCSS_CIPHER_ENCRYPT MCUXCLELS_CIPHER_ENCRYPT
#define MCUXCLCSS_CIPHER_EXTERNAL_KEY MCUXCLELS_CIPHER_EXTERNAL_KEY
#define MCUXCLCSS_CIPHER_INTERNAL_KEY MCUXCLELS_CIPHER_INTERNAL_KEY
#define MCUXCLCSS_CIPHER_KEY_SIZE_AES_128 MCUXCLELS_CIPHER_KEY_SIZE_AES_128
#define MCUXCLCSS_CIPHER_KEY_SIZE_AES_192 MCUXCLELS_CIPHER_KEY_SIZE_AES_192
#define MCUXCLCSS_CIPHER_KEY_SIZE_AES_256 MCUXCLELS_CIPHER_KEY_SIZE_AES_256
#define MCUXCLCSS_CIPHER_STATE_IN_DISABLE MCUXCLELS_CIPHER_STATE_IN_DISABLE
#define MCUXCLCSS_CIPHER_STATE_IN_ENABLE MCUXCLELS_CIPHER_STATE_IN_ENABLE
#define MCUXCLCSS_CIPHER_STATE_OUT_DISABLE MCUXCLELS_CIPHER_STATE_OUT_DISABLE
#define MCUXCLCSS_CIPHER_STATE_OUT_ENABLE MCUXCLELS_CIPHER_STATE_OUT_ENABLE
#define MCUXCLCSS_CKDF_ALGO_SP800108 MCUXCLELS_CKDF_ALGO_SP800108
#define MCUXCLCSS_CKDF_ALGO_SP80056C_EXPAND MCUXCLELS_CKDF_ALGO_SP80056C_EXPAND
#define MCUXCLCSS_CKDF_ALGO_SP80056C_EXTRACT MCUXCLELS_CKDF_ALGO_SP80056C_EXTRACT
#define MCUXCLCSS_CKDF_DERIVATIONDATA_SIZE MCUXCLELS_CKDF_DERIVATIONDATA_SIZE
#define MCUXCLCSS_HKDF_RTF_DERIV MCUXCLELS_HKDF_RTF_DERIV
#define MCUXCLCSS_CKDF_SP80056C_DERIVATIONDATA_SIZE_16 MCUXCLELS_CKDF_SP80056C_DERIVATIONDATA_SIZE_16
#define MCUXCLCSS_CKDF_SP80056C_DERIVATIONDATA_SIZE_32 MCUXCLELS_CKDF_SP80056C_DERIVATIONDATA_SIZE_32
#define MCUXCLCSS_HKDF_SYSTEM_MEMORY_DERIV MCUXCLELS_HKDF_SYSTEM_MEMORY_DERIV
#define MCUXCLCSS_CMAC_EXTERNAL_KEY_DISABLE MCUXCLELS_CMAC_EXTERNAL_KEY_DISABLE
#define MCUXCLCSS_CMAC_EXTERNAL_KEY_ENABLE MCUXCLELS_CMAC_EXTERNAL_KEY_ENABLE
#define MCUXCLCSS_CMAC_FINALIZE_DISABLE MCUXCLELS_CMAC_FINALIZE_DISABLE
#define MCUXCLCSS_CMAC_FINALIZE_ENABLE MCUXCLELS_CMAC_FINALIZE_ENABLE
#define MCUXCLCSS_CMAC_INITIALIZE_DISABLE MCUXCLELS_CMAC_INITIALIZE_DISABLE
#define MCUXCLCSS_CMAC_INITIALIZE_ENABLE MCUXCLELS_CMAC_INITIALIZE_ENABLE
#define MCUXCLCSS_CMAC_KEY_SIZE_128 MCUXCLELS_CMAC_KEY_SIZE_128
#define MCUXCLCSS_CMAC_KEY_SIZE_256 MCUXCLELS_CMAC_KEY_SIZE_256
#define MCUXCLCSS_CMAC_OUT_SIZE MCUXCLELS_CMAC_OUT_SIZE
#define MCUXCLCSS_CMD_CRC_CMD_ID_AUTH_CIPHER MCUXCLELS_CMD_CRC_CMD_ID_AUTH_CIPHER
#define MCUXCLCSS_CMD_CRC_CMD_ID_CHAL_RESP_GEN MCUXCLELS_CMD_CRC_CMD_ID_CHAL_RESP_GEN
#define MCUXCLCSS_CMD_CRC_CMD_ID_CIPHER MCUXCLELS_CMD_CRC_CMD_ID_CIPHER
#define MCUXCLCSS_CMD_CRC_CMD_ID_CKDF MCUXCLELS_CMD_CRC_CMD_ID_CKDF
#define MCUXCLCSS_CMD_CRC_CMD_ID_CMAC MCUXCLELS_CMD_CRC_CMD_ID_CMAC
#define MCUXCLCSS_CMD_CRC_CMD_ID_DRBG_TEST MCUXCLELS_CMD_CRC_CMD_ID_DRBG_TEST
#define MCUXCLCSS_CMD_CRC_CMD_ID_DTRNG_CFG_LOAD MCUXCLELS_CMD_CRC_CMD_ID_DTRNG_CFG_LOAD
#define MCUXCLCSS_CMD_CRC_CMD_ID_DTRNG_EVAL MCUXCLELS_CMD_CRC_CMD_ID_DTRNG_EVAL
#define MCUXCLCSS_CMD_CRC_CMD_ID_ECKXH MCUXCLELS_CMD_CRC_CMD_ID_ECKXH
#define MCUXCLCSS_CMD_CRC_CMD_ID_ECSIGN MCUXCLELS_CMD_CRC_CMD_ID_ECSIGN
#define MCUXCLCSS_CMD_CRC_CMD_ID_ECVFY MCUXCLELS_CMD_CRC_CMD_ID_ECVFY
#define MCUXCLCSS_CMD_CRC_CMD_ID_GDET_CFG_LOAD MCUXCLELS_CMD_CRC_CMD_ID_GDET_CFG_LOAD
#define MCUXCLCSS_CMD_CRC_CMD_ID_GDET_TRIM MCUXCLELS_CMD_CRC_CMD_ID_GDET_TRIM
#define MCUXCLCSS_CMD_CRC_CMD_ID_HASH MCUXCLELS_CMD_CRC_CMD_ID_HASH
#define MCUXCLCSS_CMD_CRC_CMD_ID_HKDF MCUXCLELS_CMD_CRC_CMD_ID_HKDF
#define MCUXCLCSS_CMD_CRC_CMD_ID_HMAC MCUXCLELS_CMD_CRC_CMD_ID_HMAC
#define MCUXCLCSS_CMD_CRC_CMD_ID_KDELETE MCUXCLELS_CMD_CRC_CMD_ID_KDELETE
#define MCUXCLCSS_CMD_CRC_CMD_ID_KEYGEN MCUXCLELS_CMD_CRC_CMD_ID_KEYGEN
#define MCUXCLCSS_CMD_CRC_CMD_ID_KEYIN MCUXCLELS_CMD_CRC_CMD_ID_KEYIN
#define MCUXCLCSS_CMD_CRC_CMD_ID_KEYOUT MCUXCLELS_CMD_CRC_CMD_ID_KEYOUT
#define MCUXCLCSS_CMD_CRC_CMD_ID_KEYPROV MCUXCLELS_CMD_CRC_CMD_ID_KEYPROV
#define MCUXCLCSS_CMD_CRC_CMD_ID_RND_REQ MCUXCLELS_CMD_CRC_CMD_ID_RND_REQ
#define MCUXCLCSS_CMD_CRC_CMD_ID_TLS MCUXCLELS_CMD_CRC_CMD_ID_TLS
#define MCUXCLCSS_CMD_CRC_DISABLE MCUXCLELS_CMD_CRC_DISABLE
#define MCUXCLCSS_CMD_CRC_ENABLE MCUXCLELS_CMD_CRC_ENABLE
#define MCUXCLCSS_CMD_CRC_INITIAL_VALUE MCUXCLELS_CMD_CRC_INITIAL_VALUE
#define MCUXCLCSS_CMD_CRC_POLYNOMIAL MCUXCLELS_CMD_CRC_POLYNOMIAL
#define MCUXCLCSS_CMD_CRC_REFERENCE_INIT MCUXCLELS_CMD_CRC_REFERENCE_INIT
#define MCUXCLCSS_CMD_CRC_REFERENCE_RESET MCUXCLELS_CMD_CRC_REFERENCE_RESET
#define MCUXCLCSS_CMD_CRC_REFERENCE_UPDATE_AEAD_FINALIZE MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_AEAD_FINALIZE
#define MCUXCLCSS_CMD_CRC_REFERENCE_UPDATE_AEAD_INIT MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_AEAD_INIT
#define MCUXCLCSS_CMD_CRC_REFERENCE_UPDATE_AEAD_PARTIALINIT MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_AEAD_PARTIALINIT
#define MCUXCLCSS_CMD_CRC_REFERENCE_UPDATE_AEAD_UPDATEAAD MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_AEAD_UPDATEAAD
#define MCUXCLCSS_CMD_CRC_REFERENCE_UPDATE_AEAD_UPDATEDATA MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_AEAD_UPDATEDATA
#define MCUXCLCSS_CMD_CRC_REFERENCE_UPDATE_CIPHER MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_CIPHER
#define MCUXCLCSS_CMD_CRC_REFERENCE_UPDATE_CKDF_SP800108 MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_CKDF_SP800108
#define MCUXCLCSS_CMD_CRC_REFERENCE_UPDATE_CKDF_SP80056C_EXPAND MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_CKDF_SP80056C_EXPAND
#define MCUXCLCSS_CMD_CRC_REFERENCE_UPDATE_CKDF_SP80056C_EXTRACT MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_CKDF_SP80056C_EXTRACT
#define MCUXCLCSS_CMD_CRC_REFERENCE_UPDATE_CMAC MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_CMAC
#define MCUXCLCSS_CMD_CRC_REFERENCE_UPDATE_ECCKEYEXCHANGE MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_ECCKEYEXCHANGE
#define MCUXCLCSS_CMD_CRC_REFERENCE_UPDATE_ECCKEYEXCHANGEINT MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_ECCKEYEXCHANGEINT
#define MCUXCLCSS_CMD_CRC_REFERENCE_UPDATE_ECCKEYGEN MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_ECCKEYGEN
#define MCUXCLCSS_CMD_CRC_REFERENCE_UPDATE_ECCSIGN MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_ECCSIGN
#define MCUXCLCSS_CMD_CRC_REFERENCE_UPDATE_ECCVERFIFY MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_ECCVERFIFY
#define MCUXCLCSS_CMD_CRC_REFERENCE_UPDATE_ECCVERFIFYINT MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_ECCVERFIFYINT
#define MCUXCLCSS_CMD_CRC_REFERENCE_UPDATE_GLITCHDETECTOR_LOADCONFIG MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_GLITCHDETECTOR_LOADCONFIG
#define MCUXCLCSS_CMD_CRC_REFERENCE_UPDATE_GLITCHDETECTOR_TRIM MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_GLITCHDETECTOR_TRIM
#define MCUXCLCSS_CMD_CRC_REFERENCE_UPDATE_HASH MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_HASH
#define MCUXCLCSS_CMD_CRC_REFERENCE_UPDATE_HKDF_RFC5869 MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_HKDF_RFC5869
#define MCUXCLCSS_CMD_CRC_REFERENCE_UPDATE_HKDF_SP80056C MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_HKDF_SP80056C
#define MCUXCLCSS_CMD_CRC_REFERENCE_UPDATE_HMAC MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_HMAC
#define MCUXCLCSS_CMD_CRC_REFERENCE_UPDATE_KEYDELETE MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_KEYDELETE
#define MCUXCLCSS_CMD_CRC_REFERENCE_UPDATE_KEYEXPORT MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_KEYEXPORT
#define MCUXCLCSS_CMD_CRC_REFERENCE_UPDATE_KEYIMPORT MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_KEYIMPORT
#define MCUXCLCSS_CMD_CRC_REFERENCE_UPDATE_KEYIMPORTPUK MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_KEYIMPORTPUK
#define MCUXCLCSS_CMD_CRC_REFERENCE_UPDATE_KEYPROVISION MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_KEYPROVISION
#define MCUXCLCSS_CMD_CRC_REFERENCE_UPDATE_KEYPROVISIONROM MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_KEYPROVISIONROM
#define MCUXCLCSS_CMD_CRC_REFERENCE_UPDATE_PRNG_INIT MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_PRNG_INIT
#define MCUXCLCSS_CMD_CRC_REFERENCE_UPDATE_RESPGEN MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_RESPGEN
#define MCUXCLCSS_CMD_CRC_REFERENCE_UPDATE_RNG_DRBGREQUEST MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_RNG_DRBGREQUEST
#define MCUXCLCSS_CMD_CRC_REFERENCE_UPDATE_RNG_DRBGREQUESTRAW MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_RNG_DRBGREQUESTRAW
#define MCUXCLCSS_CMD_CRC_REFERENCE_UPDATE_RNG_DRBGTESTAESCTR MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_RNG_DRBGTESTAESCTR
#define MCUXCLCSS_CMD_CRC_REFERENCE_UPDATE_RNG_DRBGTESTAESECB MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_RNG_DRBGTESTAESECB
#define MCUXCLCSS_CMD_CRC_REFERENCE_UPDATE_RNG_DRBGTESTEXTRACT MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_RNG_DRBGTESTEXTRACT
#define MCUXCLCSS_CMD_CRC_REFERENCE_UPDATE_RNG_DRBGTESTINSTANTIATE MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_RNG_DRBGTESTINSTANTIATE
#define MCUXCLCSS_CMD_CRC_REFERENCE_UPDATE_RNG_DTRNG_CONFIGEVALUATE MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_RNG_DTRNG_CONFIGEVALUATE
#define MCUXCLCSS_CMD_CRC_REFERENCE_UPDATE_RNG_DTRNG_CONFIGLOAD MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_RNG_DTRNG_CONFIGLOAD
#define MCUXCLCSS_CMD_CRC_REFERENCE_UPDATE_TLSGENERATEMASTERKEYFROMPREMASTERKEY MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_TLSGENERATEMASTERKEYFROMPREMASTERKEY
#define MCUXCLCSS_CMD_CRC_REFERENCE_UPDATE_TLSGENERATESESSIONKEYSFROMMASTERKEY MCUXCLELS_CMD_CRC_REFERENCE_UPDATE_TLSGENERATESESSIONKEYSFROMMASTERKEY
#define MCUXCLCSS_CMD_CRC_RESET MCUXCLELS_CMD_CRC_RESET
#define MCUXCLCSS_CMD_CRC_VALUE_DISABLE MCUXCLELS_CMD_CRC_VALUE_DISABLE
#define MCUXCLCSS_CMD_CRC_VALUE_ENABLE MCUXCLELS_CMD_CRC_VALUE_ENABLE
#define MCUXCLCSS_CMD_CRC_VALUE_RESET MCUXCLELS_CMD_CRC_VALUE_RESET
#define MCUXCLCSS_CSS_INTERRUPT_DISABLE MCUXCLELS_ELS_INTERRUPT_DISABLE
#define MCUXCLCSS_CSS_INTERRUPT_ENABLE MCUXCLELS_ELS_INTERRUPT_ENABLE
#define MCUXCLCSS_CSS_INTERRUPT_KEEP MCUXCLELS_ELS_INTERRUPT_KEEP
#define MCUXCLCSS_CSS_INTERRUPT_SET MCUXCLELS_ELS_INTERRUPT_SET
#define MCUXCLCSS_CSS_RESET_CLEAR MCUXCLELS_ELS_RESET_CLEAR
#define MCUXCLCSS_CSS_RESET_KEEP MCUXCLELS_ELS_RESET_KEEP
#define MCUXCLCSS_DMA_READBACK_PROTECTION_TOKEN MCUXCLELS_DMA_READBACK_PROTECTION_TOKEN
#define MCUXCLCSS_ECC_EXTKEY_EXTERNAL MCUXCLELS_ECC_EXTKEY_EXTERNAL
#define MCUXCLCSS_ECC_EXTKEY_INTERNAL MCUXCLELS_ECC_EXTKEY_INTERNAL
#define MCUXCLCSS_ECC_GEN_PUBLIC_KEY MCUXCLELS_ECC_GEN_PUBLIC_KEY
#define MCUXCLCSS_ECC_HASHED MCUXCLELS_ECC_HASHED
#define MCUXCLCSS_ECC_INCLUDE_RANDOM_DATA MCUXCLELS_ECC_INCLUDE_RANDOM_DATA
#define MCUXCLCSS_ECC_NOT_HASHED MCUXCLELS_ECC_NOT_HASHED
#define MCUXCLCSS_ECC_NO_RANDOM_DATA MCUXCLELS_ECC_NO_RANDOM_DATA
#define MCUXCLCSS_ECC_NO_RTF MCUXCLELS_ECC_NO_RTF
#define MCUXCLCSS_ECC_OUTPUTKEY_DETERMINISTIC MCUXCLELS_ECC_OUTPUTKEY_DETERMINISTIC
#define MCUXCLCSS_ECC_OUTPUTKEY_KEYEXCHANGE MCUXCLELS_ECC_OUTPUTKEY_KEYEXCHANGE
#define MCUXCLCSS_ECC_OUTPUTKEY_RANDOM MCUXCLELS_ECC_OUTPUTKEY_RANDOM
#define MCUXCLCSS_ECC_OUTPUTKEY_SIGN MCUXCLELS_ECC_OUTPUTKEY_SIGN
#define MCUXCLCSS_ECC_PUBLICKEY_SIGN_DISABLE MCUXCLELS_ECC_PUBLICKEY_SIGN_DISABLE
#define MCUXCLCSS_ECC_PUBLICKEY_SIGN_ENABLE MCUXCLELS_ECC_PUBLICKEY_SIGN_ENABLE
#define MCUXCLCSS_ECC_PUBLICKEY_SIZE MCUXCLELS_ECC_PUBLICKEY_SIZE
#define MCUXCLCSS_ECC_REVERSEFETCH_DISABLE MCUXCLELS_ECC_REVERSEFETCH_DISABLE
#define MCUXCLCSS_ECC_REVERSEFETCH_ENABLE MCUXCLELS_ECC_REVERSEFETCH_ENABLE
#define MCUXCLCSS_ECC_RTF MCUXCLELS_ECC_RTF
#define MCUXCLCSS_ECC_SIGNATURE_R_SIZE MCUXCLELS_ECC_SIGNATURE_R_SIZE
#define MCUXCLCSS_ECC_SIGNATURE_SIZE MCUXCLELS_ECC_SIGNATURE_SIZE
#define MCUXCLCSS_ECC_SKIP_PUBLIC_KEY MCUXCLELS_ECC_SKIP_PUBLIC_KEY
#define MCUXCLCSS_ECC_VALUE_HASHED MCUXCLELS_ECC_VALUE_HASHED
#define MCUXCLCSS_ECC_VALUE_NOT_HASHED MCUXCLELS_ECC_VALUE_NOT_HASHED
#define MCUXCLCSS_ECC_VALUE_NO_RTF MCUXCLELS_ECC_VALUE_NO_RTF
#define MCUXCLCSS_ECC_VALUE_RTF MCUXCLELS_ECC_VALUE_RTF
#define MCUXCLCSS_ERROR_FLAGS_CLEAR MCUXCLELS_ERROR_FLAGS_CLEAR
#define MCUXCLCSS_ERROR_FLAGS_KEEP MCUXCLELS_ERROR_FLAGS_KEEP
#define MCUXCLCSS_GLITCHDETECTOR_CFG_SIZE MCUXCLELS_GLITCHDETECTOR_CFG_SIZE
#define MCUXCLCSS_GLITCHDETECTOR_TRIM_SIZE MCUXCLELS_GLITCHDETECTOR_TRIM_SIZE
#define MCUXCLCSS_GLITCH_DETECTOR_INTERRUPT_DISABLE MCUXCLELS_GLITCH_DETECTOR_INTERRUPT_DISABLE
#define MCUXCLCSS_GLITCH_DETECTOR_INTERRUPT_ENABLE MCUXCLELS_GLITCH_DETECTOR_INTERRUPT_ENABLE
#define MCUXCLCSS_GLITCH_DETECTOR_NEG_KEEP MCUXCLELS_GLITCH_DETECTOR_NEG_KEEP
#define MCUXCLCSS_GLITCH_DETECTOR_NEG_SET MCUXCLELS_GLITCH_DETECTOR_NEG_SET
#define MCUXCLCSS_GLITCH_DETECTOR_POS_KEEP MCUXCLELS_GLITCH_DETECTOR_POS_KEEP
#define MCUXCLCSS_GLITCH_DETECTOR_POS_SET MCUXCLELS_GLITCH_DETECTOR_POS_SET
#define MCUXCLCSS_GLITCH_DETECTOR_RESET_CLEAR MCUXCLELS_GLITCH_DETECTOR_RESET_CLEAR
#define MCUXCLCSS_GLITCH_DETECTOR_RESET_KEEP MCUXCLELS_GLITCH_DETECTOR_RESET_KEEP
#define MCUXCLCSS_HASH_BLOCK_SIZE_SHA_224 MCUXCLELS_HASH_BLOCK_SIZE_SHA_224
#define MCUXCLCSS_HASH_BLOCK_SIZE_SHA_256 MCUXCLELS_HASH_BLOCK_SIZE_SHA_256
#define MCUXCLCSS_HASH_BLOCK_SIZE_SHA_384 MCUXCLELS_HASH_BLOCK_SIZE_SHA_384
#define MCUXCLCSS_HASH_BLOCK_SIZE_SHA_512 MCUXCLELS_HASH_BLOCK_SIZE_SHA_512
#define MCUXCLCSS_HASH_INIT_DISABLE MCUXCLELS_HASH_INIT_DISABLE
#define MCUXCLCSS_HASH_INIT_ENABLE MCUXCLELS_HASH_INIT_ENABLE
#define MCUXCLCSS_HASH_LOAD_DISABLE MCUXCLELS_HASH_LOAD_DISABLE
#define MCUXCLCSS_HASH_LOAD_ENABLE MCUXCLELS_HASH_LOAD_ENABLE
#define MCUXCLCSS_HASH_MODE_SHA_224 MCUXCLELS_HASH_MODE_SHA_224
#define MCUXCLCSS_HASH_MODE_SHA_256 MCUXCLELS_HASH_MODE_SHA_256
#define MCUXCLCSS_HASH_MODE_SHA_384 MCUXCLELS_HASH_MODE_SHA_384
#define MCUXCLCSS_HASH_MODE_SHA_512 MCUXCLELS_HASH_MODE_SHA_512
#define MCUXCLCSS_HASH_OUTPUT_DISABLE MCUXCLELS_HASH_OUTPUT_DISABLE
#define MCUXCLCSS_HASH_OUTPUT_ENABLE MCUXCLELS_HASH_OUTPUT_ENABLE
#define MCUXCLCSS_HASH_OUTPUT_SIZE_SHA_224 MCUXCLELS_HASH_OUTPUT_SIZE_SHA_224
#define MCUXCLCSS_HASH_OUTPUT_SIZE_SHA_256 MCUXCLELS_HASH_OUTPUT_SIZE_SHA_256
#define MCUXCLCSS_HASH_OUTPUT_SIZE_SHA_384 MCUXCLELS_HASH_OUTPUT_SIZE_SHA_384
#define MCUXCLCSS_HASH_OUTPUT_SIZE_SHA_512 MCUXCLELS_HASH_OUTPUT_SIZE_SHA_512
#define MCUXCLCSS_HASH_RTF_OUTPUT_DISABLE MCUXCLELS_HASH_RTF_OUTPUT_DISABLE
#define MCUXCLCSS_HASH_RTF_OUTPUT_ENABLE MCUXCLELS_HASH_RTF_OUTPUT_ENABLE
#define MCUXCLCSS_HASH_RTF_OUTPUT_SIZE MCUXCLELS_HASH_RTF_OUTPUT_SIZE
#define MCUXCLCSS_HASH_RTF_UPDATE_DISABLE MCUXCLELS_HASH_RTF_UPDATE_DISABLE
#define MCUXCLCSS_HASH_RTF_UPDATE_ENABLE MCUXCLELS_HASH_RTF_UPDATE_ENABLE
#define MCUXCLCSS_HASH_STATE_SIZE_SHA_224 MCUXCLELS_HASH_STATE_SIZE_SHA_224
#define MCUXCLCSS_HASH_STATE_SIZE_SHA_256 MCUXCLELS_HASH_STATE_SIZE_SHA_256
#define MCUXCLCSS_HASH_STATE_SIZE_SHA_384 MCUXCLELS_HASH_STATE_SIZE_SHA_384
#define MCUXCLCSS_HASH_STATE_SIZE_SHA_512 MCUXCLELS_HASH_STATE_SIZE_SHA_512
#define MCUXCLCSS_HASH_VALUE_MODE_SHA_224 MCUXCLELS_HASH_VALUE_MODE_SHA_224
#define MCUXCLCSS_HASH_VALUE_MODE_SHA_256 MCUXCLELS_HASH_VALUE_MODE_SHA_256
#define MCUXCLCSS_HASH_VALUE_MODE_SHA_384 MCUXCLELS_HASH_VALUE_MODE_SHA_384
#define MCUXCLCSS_HASH_VALUE_MODE_SHA_512 MCUXCLELS_HASH_VALUE_MODE_SHA_512
#define MCUXCLCSS_HKDF_ALGO_RFC5869 MCUXCLELS_HKDF_ALGO_RFC5869
#define MCUXCLCSS_HKDF_ALGO_SP80056C MCUXCLELS_HKDF_ALGO_SP80056C
#define MCUXCLCSS_HKDF_RFC5869_DERIVATIONDATA_SIZE MCUXCLELS_HKDF_RFC5869_DERIVATIONDATA_SIZE
#define MCUXCLCSS_HKDF_SP80056C_TARGETKEY_SIZE MCUXCLELS_HKDF_SP80056C_TARGETKEY_SIZE
#define MCUXCLCSS_HKDF_VALUE_MEMORY_DERIV MCUXCLELS_HKDF_VALUE_MEMORY_DERIV
#define MCUXCLCSS_HKDF_VALUE_RTF_DERIV MCUXCLELS_HKDF_VALUE_RTF_DERIV
#define MCUXCLCSS_HMAC_EXTERNAL_KEY_DISABLE MCUXCLELS_HMAC_EXTERNAL_KEY_DISABLE
#define MCUXCLCSS_HMAC_EXTERNAL_KEY_ENABLE MCUXCLELS_HMAC_EXTERNAL_KEY_ENABLE
#define MCUXCLCSS_HMAC_OUTPUT_SIZE MCUXCLELS_HMAC_OUTPUT_SIZE
#define MCUXCLCSS_HMAC_PADDED_KEY_SIZE MCUXCLELS_HMAC_PADDED_KEY_SIZE
#define MCUXCLCSS_HW_VERSION MCUXCLELS_HW_VERSION
#define MCUXCLCSS_KEYGEN_VALUE_DETERMINISTIC MCUXCLELS_KEYGEN_VALUE_DETERMINISTIC
#define MCUXCLCSS_KEYGEN_VALUE_GEN_PUB_KEY MCUXCLELS_KEYGEN_VALUE_GEN_PUB_KEY
#define MCUXCLCSS_KEYGEN_VALUE_NO_PUB_KEY MCUXCLELS_KEYGEN_VALUE_NO_PUB_KEY
#define MCUXCLCSS_KEYGEN_VALUE_NO_RANDOM_DATA MCUXCLELS_KEYGEN_VALUE_NO_RANDOM_DATA
#define MCUXCLCSS_KEYGEN_VALUE_RANDOM MCUXCLELS_KEYGEN_VALUE_RANDOM
#define MCUXCLCSS_KEYGEN_VALUE_SIGN_PUBLICKEY MCUXCLELS_KEYGEN_VALUE_SIGN_PUBLICKEY
#define MCUXCLCSS_KEYGEN_VALUE_TYPE_KEYEXCHANGE MCUXCLELS_KEYGEN_VALUE_TYPE_KEYEXCHANGE
#define MCUXCLCSS_KEYGEN_VALUE_TYPE_SIGN MCUXCLELS_KEYGEN_VALUE_TYPE_SIGN
#define MCUXCLCSS_KEYGEN_VALUE_USE_RANDOM_DATA MCUXCLELS_KEYGEN_VALUE_USE_RANDOM_DATA
#define MCUXCLCSS_KEYIMPORT_KFMT_PBK MCUXCLELS_KEYIMPORT_KFMT_PBK
#define MCUXCLCSS_KEYIMPORT_KFMT_PUF MCUXCLELS_KEYIMPORT_KFMT_PUF
#define MCUXCLCSS_KEYIMPORT_KFMT_RFC3394 MCUXCLELS_KEYIMPORT_KFMT_RFC3394
#define MCUXCLCSS_KEYIMPORT_KFMT_UDF MCUXCLELS_KEYIMPORT_KFMT_UDF
#define MCUXCLCSS_KEYIMPORT_REVERSEFETCH_DISABLE MCUXCLELS_KEYIMPORT_REVERSEFETCH_DISABLE
#define MCUXCLCSS_KEYIMPORT_REVERSEFETCH_ENABLE MCUXCLELS_KEYIMPORT_REVERSEFETCH_ENABLE
#define MCUXCLCSS_KEYIMPORT_VALUE_KFMT_PBK MCUXCLELS_KEYIMPORT_VALUE_KFMT_PBK
#define MCUXCLCSS_KEYIMPORT_VALUE_KFMT_PUF MCUXCLELS_KEYIMPORT_VALUE_KFMT_PUF
#define MCUXCLCSS_KEYIMPORT_VALUE_KFMT_RFC3394 MCUXCLELS_KEYIMPORT_VALUE_KFMT_RFC3394
#define MCUXCLCSS_KEYIMPORT_VALUE_KFMT_UDF MCUXCLELS_KEYIMPORT_VALUE_KFMT_UDF
#define MCUXCLCSS_KEYPROPERTY_ACTIVE_FALSE MCUXCLELS_KEYPROPERTY_ACTIVE_FALSE
#define MCUXCLCSS_KEYPROPERTY_ACTIVE_TRUE MCUXCLELS_KEYPROPERTY_ACTIVE_TRUE
#define MCUXCLCSS_KEYPROPERTY_AES_FALSE MCUXCLELS_KEYPROPERTY_AES_FALSE
#define MCUXCLCSS_KEYPROPERTY_AES_TRUE MCUXCLELS_KEYPROPERTY_AES_TRUE
#define MCUXCLCSS_KEYPROPERTY_BASE_SLOT MCUXCLELS_KEYPROPERTY_BASE_SLOT
#define MCUXCLCSS_KEYPROPERTY_CKDF_FALSE MCUXCLELS_KEYPROPERTY_CKDF_FALSE
#define MCUXCLCSS_KEYPROPERTY_CKDF_TRUE MCUXCLELS_KEYPROPERTY_CKDF_TRUE
#define MCUXCLCSS_KEYPROPERTY_CMAC_FALSE MCUXCLELS_KEYPROPERTY_CMAC_FALSE
#define MCUXCLCSS_KEYPROPERTY_CMAC_TRUE MCUXCLELS_KEYPROPERTY_CMAC_TRUE
#define MCUXCLCSS_KEYPROPERTY_DEVICE_UNIQUE_FALSE MCUXCLELS_KEYPROPERTY_DEVICE_UNIQUE_FALSE
#define MCUXCLCSS_KEYPROPERTY_DEVICE_UNIQUE_TRUE MCUXCLELS_KEYPROPERTY_DEVICE_UNIQUE_TRUE
#define MCUXCLCSS_KEYPROPERTY_ECC_DH_PRIVATE_FALSE MCUXCLELS_KEYPROPERTY_ECC_DH_PRIVATE_FALSE
#define MCUXCLCSS_KEYPROPERTY_ECC_DH_PRIVATE_TRUE MCUXCLELS_KEYPROPERTY_ECC_DH_PRIVATE_TRUE
#define MCUXCLCSS_KEYPROPERTY_ECC_FALSE MCUXCLELS_KEYPROPERTY_ECC_FALSE
#define MCUXCLCSS_KEYPROPERTY_ECC_TRUE MCUXCLELS_KEYPROPERTY_ECC_TRUE
#define MCUXCLCSS_KEYPROPERTY_GENERAL_PURPOSE_SLOT_FALSE MCUXCLELS_KEYPROPERTY_GENERAL_PURPOSE_SLOT_FALSE
#define MCUXCLCSS_KEYPROPERTY_GENERAL_PURPOSE_SLOT_TRUE MCUXCLELS_KEYPROPERTY_GENERAL_PURPOSE_SLOT_TRUE
#define MCUXCLCSS_KEYPROPERTY_HKDF_FALSE MCUXCLELS_KEYPROPERTY_HKDF_FALSE
#define MCUXCLCSS_KEYPROPERTY_HKDF_TRUE MCUXCLELS_KEYPROPERTY_HKDF_TRUE
#define MCUXCLCSS_KEYPROPERTY_HMAC_FALSE MCUXCLELS_KEYPROPERTY_HMAC_FALSE
#define MCUXCLCSS_KEYPROPERTY_HMAC_TRUE MCUXCLELS_KEYPROPERTY_HMAC_TRUE
#define MCUXCLCSS_KEYPROPERTY_HW_OUT_FALSE MCUXCLELS_KEYPROPERTY_HW_OUT_FALSE
#define MCUXCLCSS_KEYPROPERTY_HW_OUT_SLOT_FALSE MCUXCLELS_KEYPROPERTY_HW_OUT_SLOT_FALSE
#define MCUXCLCSS_KEYPROPERTY_HW_OUT_SLOT_TRUE MCUXCLELS_KEYPROPERTY_HW_OUT_SLOT_TRUE
#define MCUXCLCSS_KEYPROPERTY_HW_OUT_TRUE MCUXCLELS_KEYPROPERTY_HW_OUT_TRUE
#define MCUXCLCSS_KEYPROPERTY_INPUT_FOR_ECC_FALSE MCUXCLELS_KEYPROPERTY_INPUT_FOR_ECC_FALSE
#define MCUXCLCSS_KEYPROPERTY_INPUT_FOR_ECC_TRUE MCUXCLELS_KEYPROPERTY_INPUT_FOR_ECC_TRUE
#define MCUXCLCSS_KEYPROPERTY_KEY_SIZE_128 MCUXCLELS_KEYPROPERTY_KEY_SIZE_128
#define MCUXCLCSS_KEYPROPERTY_KEY_SIZE_256 MCUXCLELS_KEYPROPERTY_KEY_SIZE_256
#define MCUXCLCSS_KEYPROPERTY_KEY_SIZE_512 MCUXCLELS_KEYPROPERTY_KEY_SIZE_512
#define MCUXCLCSS_KEYPROPERTY_KSK_FALSE MCUXCLELS_KEYPROPERTY_KSK_FALSE
#define MCUXCLCSS_KEYPROPERTY_KSK_TRUE MCUXCLELS_KEYPROPERTY_KSK_TRUE
#define MCUXCLCSS_KEYPROPERTY_KUOK_FALSE MCUXCLELS_KEYPROPERTY_KUOK_FALSE
#define MCUXCLCSS_KEYPROPERTY_KUOK_TRUE MCUXCLELS_KEYPROPERTY_KUOK_TRUE
#define MCUXCLCSS_KEYPROPERTY_KWK_FALSE MCUXCLELS_KEYPROPERTY_KWK_FALSE
#define MCUXCLCSS_KEYPROPERTY_KWK_TRUE MCUXCLELS_KEYPROPERTY_KWK_TRUE
#define MCUXCLCSS_KEYPROPERTY_PRIVILEGED_FALSE MCUXCLELS_KEYPROPERTY_PRIVILEGED_FALSE
#define MCUXCLCSS_KEYPROPERTY_PRIVILEGED_TRUE MCUXCLELS_KEYPROPERTY_PRIVILEGED_TRUE
#define MCUXCLCSS_KEYPROPERTY_PUK_FALSE MCUXCLELS_KEYPROPERTY_PUK_FALSE
#define MCUXCLCSS_KEYPROPERTY_PUK_TRUE MCUXCLELS_KEYPROPERTY_PUK_TRUE
#define MCUXCLCSS_KEYPROPERTY_RETENTION_SLOT_FALSE MCUXCLELS_KEYPROPERTY_RETENTION_SLOT_FALSE
#define MCUXCLCSS_KEYPROPERTY_RETENTION_SLOT_TRUE MCUXCLELS_KEYPROPERTY_RETENTION_SLOT_TRUE
#define MCUXCLCSS_KEYPROPERTY_RTF_FALSE MCUXCLELS_KEYPROPERTY_RTF_FALSE
#define MCUXCLCSS_KEYPROPERTY_RTF_TRUE MCUXCLELS_KEYPROPERTY_RTF_TRUE
#define MCUXCLCSS_KEYPROPERTY_SECOND_SLOT MCUXCLELS_KEYPROPERTY_SECOND_SLOT
#define MCUXCLCSS_KEYPROPERTY_SECURE_FALSE MCUXCLELS_KEYPROPERTY_SECURE_FALSE
#define MCUXCLCSS_KEYPROPERTY_SECURE_TRUE MCUXCLELS_KEYPROPERTY_SECURE_TRUE
#define MCUXCLCSS_KEYPROPERTY_TECDH_FALSE MCUXCLELS_KEYPROPERTY_TECDH_FALSE
#define MCUXCLCSS_KEYPROPERTY_TECDH_TRUE MCUXCLELS_KEYPROPERTY_TECDH_TRUE
#define MCUXCLCSS_KEYPROPERTY_TLS_MASTER_SECRET_FALSE MCUXCLELS_KEYPROPERTY_TLS_MASTER_SECRET_FALSE
#define MCUXCLCSS_KEYPROPERTY_TLS_MASTER_SECRET_TRUE MCUXCLELS_KEYPROPERTY_TLS_MASTER_SECRET_TRUE
#define MCUXCLCSS_KEYPROPERTY_TLS_PREMASTER_SECRET_FALSE MCUXCLELS_KEYPROPERTY_TLS_PREMASTER_SECRET_FALSE
#define MCUXCLCSS_KEYPROPERTY_TLS_PREMASTER_SECRET_TRUE MCUXCLELS_KEYPROPERTY_TLS_PREMASTER_SECRET_TRUE
#define MCUXCLCSS_KEYPROPERTY_VALUE_ACTIVE MCUXCLELS_KEYPROPERTY_VALUE_ACTIVE
#define MCUXCLCSS_KEYPROPERTY_VALUE_AES MCUXCLELS_KEYPROPERTY_VALUE_AES
#define MCUXCLCSS_KEYPROPERTY_VALUE_BASE_SLOT MCUXCLELS_KEYPROPERTY_VALUE_BASE_SLOT
#define MCUXCLCSS_KEYPROPERTY_VALUE_CKDF MCUXCLELS_KEYPROPERTY_VALUE_CKDF
#define MCUXCLCSS_KEYPROPERTY_VALUE_CMAC MCUXCLELS_KEYPROPERTY_VALUE_CMAC
#define MCUXCLCSS_KEYPROPERTY_VALUE_DUK MCUXCLELS_KEYPROPERTY_VALUE_DUK
#define MCUXCLCSS_KEYPROPERTY_VALUE_ECDH MCUXCLELS_KEYPROPERTY_VALUE_ECDH
#define MCUXCLCSS_KEYPROPERTY_VALUE_ECSGN MCUXCLELS_KEYPROPERTY_VALUE_ECSGN
#define MCUXCLCSS_KEYPROPERTY_VALUE_GENERAL_PURPOSE_SLOT MCUXCLELS_KEYPROPERTY_VALUE_GENERAL_PURPOSE_SLOT
#define MCUXCLCSS_KEYPROPERTY_VALUE_HKDF MCUXCLELS_KEYPROPERTY_VALUE_HKDF
#define MCUXCLCSS_KEYPROPERTY_VALUE_HMAC MCUXCLELS_KEYPROPERTY_VALUE_HMAC
#define MCUXCLCSS_KEYPROPERTY_VALUE_HW_OUT MCUXCLELS_KEYPROPERTY_VALUE_HW_OUT
#define MCUXCLCSS_KEYPROPERTY_VALUE_HW_OUT_SLOT MCUXCLELS_KEYPROPERTY_VALUE_HW_OUT_SLOT
#define MCUXCLCSS_KEYPROPERTY_VALUE_KEY_SIZE_128 MCUXCLELS_KEYPROPERTY_VALUE_KEY_SIZE_128
#define MCUXCLCSS_KEYPROPERTY_VALUE_KEY_SIZE_256 MCUXCLELS_KEYPROPERTY_VALUE_KEY_SIZE_256
#define MCUXCLCSS_KEYPROPERTY_VALUE_KEY_SIZE_512 MCUXCLELS_KEYPROPERTY_VALUE_KEY_SIZE_512
#define MCUXCLCSS_KEYPROPERTY_VALUE_KGSRC MCUXCLELS_KEYPROPERTY_VALUE_KGSRC
#define MCUXCLCSS_KEYPROPERTY_VALUE_KSK MCUXCLELS_KEYPROPERTY_VALUE_KSK
#define MCUXCLCSS_KEYPROPERTY_VALUE_KUOK MCUXCLELS_KEYPROPERTY_VALUE_KUOK
#define MCUXCLCSS_KEYPROPERTY_VALUE_KWK MCUXCLELS_KEYPROPERTY_VALUE_KWK
#define MCUXCLCSS_KEYPROPERTY_VALUE_NOTPRIVILEGED MCUXCLELS_KEYPROPERTY_VALUE_NOTPRIVILEGED
#define MCUXCLCSS_KEYPROPERTY_VALUE_NOTSECURE MCUXCLELS_KEYPROPERTY_VALUE_NOTSECURE
#define MCUXCLCSS_KEYPROPERTY_VALUE_PRIVILEGED MCUXCLELS_KEYPROPERTY_VALUE_PRIVILEGED
#define MCUXCLCSS_KEYPROPERTY_VALUE_PUK MCUXCLELS_KEYPROPERTY_VALUE_PUK
#define MCUXCLCSS_KEYPROPERTY_VALUE_RETENTION_SLOT MCUXCLELS_KEYPROPERTY_VALUE_RETENTION_SLOT
#define MCUXCLCSS_KEYPROPERTY_VALUE_RTF MCUXCLELS_KEYPROPERTY_VALUE_RTF
#define MCUXCLCSS_KEYPROPERTY_VALUE_SECURE MCUXCLELS_KEYPROPERTY_VALUE_SECURE
#define MCUXCLCSS_KEYPROPERTY_VALUE_TECDH MCUXCLELS_KEYPROPERTY_VALUE_TECDH
#define MCUXCLCSS_KEYPROPERTY_VALUE_TLS_MASTER_SECRET MCUXCLELS_KEYPROPERTY_VALUE_TLS_MASTER_SECRET
#define MCUXCLCSS_KEYPROPERTY_VALUE_TLS_PREMASTER_SECRET MCUXCLELS_KEYPROPERTY_VALUE_TLS_PREMASTER_SECRET
#define MCUXCLCSS_KEYPROPERTY_VALUE_WRPOK MCUXCLELS_KEYPROPERTY_VALUE_WRPOK
#define MCUXCLCSS_KEYPROPERTY_WRAP_FALSE MCUXCLELS_KEYPROPERTY_WRAP_FALSE
#define MCUXCLCSS_KEYPROPERTY_WRAP_TRUE MCUXCLELS_KEYPROPERTY_WRAP_TRUE
#define MCUXCLCSS_KEYPROV_DUK_UPDATE_DISABLE MCUXCLELS_KEYPROV_DUK_UPDATE_DISABLE
#define MCUXCLCSS_KEYPROV_DUK_UPDATE_ENABLE MCUXCLELS_KEYPROV_DUK_UPDATE_ENABLE
#define MCUXCLCSS_KEYPROV_KEYSHARE_TABLE_SIZE MCUXCLELS_KEYPROV_KEYSHARE_TABLE_SIZE
#define MCUXCLCSS_KEYPROV_KEY_PART_1_SIZE MCUXCLELS_KEYPROV_KEY_PART_1_SIZE
#define MCUXCLCSS_KEYPROV_NOIC_DISABLE MCUXCLELS_KEYPROV_NOIC_DISABLE
#define MCUXCLCSS_KEYPROV_NOIC_ENABLE MCUXCLELS_KEYPROV_NOIC_ENABLE
#define MCUXCLCSS_KEYPROV_TESTERSHARE_SIZE MCUXCLELS_KEYPROV_TESTERSHARE_SIZE
#define MCUXCLCSS_KEYPROV_VALUE_NOIC MCUXCLELS_KEYPROV_VALUE_NOIC
#define MCUXCLCSS_KEY_SLOTS MCUXCLELS_KEY_SLOTS
#define MCUXCLCSS_MASTER_UNLOCK_ANY MCUXCLELS_MASTER_UNLOCK_ANY
#define MCUXCLCSS_RESET_CANCEL MCUXCLELS_RESET_CANCEL
#define MCUXCLCSS_RESET_DO_NOT_CANCEL MCUXCLELS_RESET_DO_NOT_CANCEL
#define MCUXCLCSS_RESP_GEN_AVAILABLE_SLOT_0 MCUXCLELS_RESP_GEN_AVAILABLE_SLOT_0
#define MCUXCLCSS_RESP_GEN_AVAILABLE_SLOT_1 MCUXCLELS_RESP_GEN_AVAILABLE_SLOT_1
#define MCUXCLCSS_RESP_GEN_AVAILABLE_SLOT_2 MCUXCLELS_RESP_GEN_AVAILABLE_SLOT_2
#define MCUXCLCSS_RESP_GEN_SLOTS MCUXCLELS_RESP_GEN_SLOTS
#define MCUXCLCSS_RFC3394_CONTAINER_SIZE_128 MCUXCLELS_RFC3394_CONTAINER_SIZE_128
#define MCUXCLCSS_RFC3394_CONTAINER_SIZE_256 MCUXCLELS_RFC3394_CONTAINER_SIZE_256
#define MCUXCLCSS_RFC3394_CONTAINER_SIZE_P256 MCUXCLELS_RFC3394_CONTAINER_SIZE_P256
#define MCUXCLCSS_RFC3394_OVERHEAD MCUXCLELS_RFC3394_OVERHEAD
#define MCUXCLCSS_RNG_DRBG_TEST_EXTRACT_OUTPUT_MAX_SIZE MCUXCLELS_RNG_DRBG_TEST_EXTRACT_OUTPUT_MAX_SIZE
#define MCUXCLCSS_RNG_DRBG_TEST_EXTRACT_OUTPUT_MIN_SIZE MCUXCLELS_RNG_DRBG_TEST_EXTRACT_OUTPUT_MIN_SIZE
#define MCUXCLCSS_RNG_DRBG_TEST_MODE_AES_CTR MCUXCLELS_RNG_DRBG_TEST_MODE_AES_CTR
#define MCUXCLCSS_RNG_DRBG_TEST_MODE_AES_ECB MCUXCLELS_RNG_DRBG_TEST_MODE_AES_ECB
#define MCUXCLCSS_RNG_DRBG_TEST_MODE_EXTRACT MCUXCLELS_RNG_DRBG_TEST_MODE_EXTRACT
#define MCUXCLCSS_RNG_DRBG_TEST_MODE_INSTANTIATE MCUXCLELS_RNG_DRBG_TEST_MODE_INSTANTIATE
#define MCUXCLCSS_RNG_DTRNG_CONFIG_SIZE MCUXCLELS_RNG_DTRNG_CONFIG_SIZE
#define MCUXCLCSS_RNG_DTRNG_EVAL_CONFIG_SIZE MCUXCLELS_RNG_DTRNG_EVAL_CONFIG_SIZE
#define MCUXCLCSS_RNG_DTRNG_EVAL_RESULT_SIZE MCUXCLELS_RNG_DTRNG_EVAL_RESULT_SIZE
#define MCUXCLCSS_RNG_RAW_ENTROPY_SIZE MCUXCLELS_RNG_RAW_ENTROPY_SIZE
#define MCUXCLCSS_RNG_RND_REQ_PRND_INIT MCUXCLELS_RNG_RND_REQ_PRND_INIT
#define MCUXCLCSS_RNG_RND_REQ_RND_RAW MCUXCLELS_RNG_RND_REQ_RND_RAW
#define MCUXCLCSS_STATUS_DRBGENTLVL_HIGH MCUXCLELS_STATUS_DRBGENTLVL_HIGH
#define MCUXCLCSS_STATUS_DRBGENTLVL_LOW MCUXCLELS_STATUS_DRBGENTLVL_LOW
#define MCUXCLCSS_STATUS_DRBGENTLVL_NONE MCUXCLELS_STATUS_DRBGENTLVL_NONE
#define MCUXCLCSS_STATUS_ECDSAVFY_ERROR MCUXCLELS_STATUS_ECDSAVFY_ERROR
#define MCUXCLCSS_STATUS_ECDSAVFY_FAIL MCUXCLELS_STATUS_ECDSAVFY_FAIL
#define MCUXCLCSS_STATUS_ECDSAVFY_NORUN MCUXCLELS_STATUS_ECDSAVFY_NORUN
#define MCUXCLCSS_STATUS_ECDSAVFY_OK MCUXCLELS_STATUS_ECDSAVFY_OK
#define MCUXCLCSS_STATUS_HW_ALGORITHM MCUXCLELS_STATUS_HW_ALGORITHM
#define MCUXCLCSS_STATUS_HW_BUS MCUXCLELS_STATUS_HW_BUS
#define MCUXCLCSS_STATUS_HW_DTRNG MCUXCLELS_STATUS_HW_DTRNG
#define MCUXCLCSS_STATUS_HW_FAULT MCUXCLELS_STATUS_HW_FAULT
#define MCUXCLCSS_STATUS_HW_INTEGRITY MCUXCLELS_STATUS_HW_INTEGRITY
#define MCUXCLCSS_STATUS_HW_OPERATIONAL MCUXCLELS_STATUS_HW_OPERATIONAL
#define MCUXCLCSS_STATUS_HW_PRNG MCUXCLELS_STATUS_HW_PRNG
#define MCUXCLCSS_STATUS_IS_HW_ERROR MCUXCLELS_STATUS_IS_HW_ERROR
#define MCUXCLCSS_STATUS_IS_SW_ERROR MCUXCLELS_STATUS_IS_SW_ERROR
#define MCUXCLCSS_STATUS_OK MCUXCLELS_STATUS_OK
#define MCUXCLCSS_STATUS_OK_WAIT MCUXCLELS_STATUS_OK_WAIT
#define MCUXCLCSS_STATUS_PPROT_PRIVILEGED_NONSECURE MCUXCLELS_STATUS_PPROT_PRIVILEGED_NONSECURE
#define MCUXCLCSS_STATUS_PPROT_PRIVILEGED_SECURE MCUXCLELS_STATUS_PPROT_PRIVILEGED_SECURE
#define MCUXCLCSS_STATUS_PPROT_UNPRIVILEGED_NONSECURE MCUXCLELS_STATUS_PPROT_UNPRIVILEGED_NONSECURE
#define MCUXCLCSS_STATUS_PPROT_UNPRIVILEGED_SECURE MCUXCLELS_STATUS_PPROT_UNPRIVILEGED_SECURE
#define MCUXCLCSS_STATUS_SW_CANNOT_INTERRUPT MCUXCLELS_STATUS_SW_CANNOT_INTERRUPT
#define MCUXCLCSS_STATUS_SW_COMPARISON_FAILED MCUXCLELS_STATUS_SW_COMPARISON_FAILED
#define MCUXCLCSS_STATUS_SW_COUNTER_EXPIRED MCUXCLELS_STATUS_SW_COUNTER_EXPIRED
#define MCUXCLCSS_STATUS_SW_FAULT MCUXCLELS_STATUS_SW_FAULT
#define MCUXCLCSS_STATUS_SW_INVALID_PARAM MCUXCLELS_STATUS_SW_INVALID_PARAM
#define MCUXCLCSS_STATUS_SW_INVALID_STATE MCUXCLELS_STATUS_SW_INVALID_STATE
#define MCUXCLCSS_STATUS_SW_LOCKING_FAILED MCUXCLELS_STATUS_SW_LOCKING_FAILED
#define MCUXCLCSS_STATUS_SW_STATUS_LOCKED MCUXCLELS_STATUS_SW_STATUS_LOCKED
#define MCUXCLCSS_TLS_DERIVATIONDATA_SIZE MCUXCLELS_TLS_DERIVATIONDATA_SIZE
#define MCUXCLCSS_TLS_FINALIZE MCUXCLELS_TLS_FINALIZE
#define MCUXCLCSS_TLS_INIT MCUXCLELS_TLS_INIT
#define MCUXCLCSS_TLS_RANDOM_SIZE MCUXCLELS_TLS_RANDOM_SIZE
/* Public types */
/**
* mcuxClCss_((?:AeadOption_t|CipherOption_t|CkdfOption_t|CmacOption_t|CommandCrcConfig_t|EccByte_t|EccKeyExchOption_t|EccKeyGenOption_t|EccSignOption_t|EccVerifyOption_t|ErrorHandling_t|HashOption_t|HkdfOption_t|HmacOption_t|HwConfig_t|HwState_t|HwVersion_t|InterruptOptionEn_t|InterruptOptionRst_t|InterruptOptionSet_t|KeyImportOption_t|KeyIndex_t|KeyProp_t|KeyProvisionOption_t|ResetOption_t|Status_Protected_t|Status_t|TlsOption_t|TransferToRegisterFunction_t))(?!\w)
* -->
* mcuxClEls_\1
*/
#define mcuxClCss_AeadOption_t mcuxClEls_AeadOption_t
#define mcuxClCss_CipherOption_t mcuxClEls_CipherOption_t
#define mcuxClCss_CkdfOption_t mcuxClEls_CkdfOption_t
#define mcuxClCss_CmacOption_t mcuxClEls_CmacOption_t
#define mcuxClCss_CommandCrcConfig_t mcuxClEls_CommandCrcConfig_t
#define mcuxClCss_EccByte_t mcuxClEls_EccByte_t
#define mcuxClCss_EccKeyExchOption_t mcuxClEls_EccKeyExchOption_t
#define mcuxClCss_EccKeyGenOption_t mcuxClEls_EccKeyGenOption_t
#define mcuxClCss_EccSignOption_t mcuxClEls_EccSignOption_t
#define mcuxClCss_EccVerifyOption_t mcuxClEls_EccVerifyOption_t
#define mcuxClCss_ErrorHandling_t mcuxClEls_ErrorHandling_t
#define mcuxClCss_HashOption_t mcuxClEls_HashOption_t
#define mcuxClCss_HkdfOption_t mcuxClEls_HkdfOption_t
#define mcuxClCss_HmacOption_t mcuxClEls_HmacOption_t
#define mcuxClCss_HwConfig_t mcuxClEls_HwConfig_t
#define mcuxClCss_HwState_t mcuxClEls_HwState_t
#define mcuxClCss_HwVersion_t mcuxClEls_HwVersion_t
#define mcuxClCss_InterruptOptionEn_t mcuxClEls_InterruptOptionEn_t
#define mcuxClCss_InterruptOptionRst_t mcuxClEls_InterruptOptionRst_t
#define mcuxClCss_InterruptOptionSet_t mcuxClEls_InterruptOptionSet_t
#define mcuxClCss_KeyImportOption_t mcuxClEls_KeyImportOption_t
#define mcuxClCss_KeyIndex_t mcuxClEls_KeyIndex_t
#define mcuxClCss_KeyProp_t mcuxClEls_KeyProp_t
#define mcuxClCss_KeyProvisionOption_t mcuxClEls_KeyProvisionOption_t
#define mcuxClCss_ResetOption_t mcuxClEls_ResetOption_t
#define mcuxClCss_Status_Protected_t mcuxClEls_Status_Protected_t
#define mcuxClCss_Status_t mcuxClEls_Status_t
#define mcuxClCss_TlsOption_t mcuxClEls_TlsOption_t
#define mcuxClCss_TransferToRegisterFunction_t mcuxClEls_TransferToRegisterFunction_t
/* Public functions */
/**
* mcuxClCss_((?:Aead_Finalize_Async|Aead_Init_Async|Aead_PartialInit_Async|Aead_UpdateAad_Async|Aead_UpdateData_Async|Cipher_Async|Ckdf_Sp800108_Async|Ckdf_Sp80056c_Expand_Async|Ckdf_Sp80056c_Extract_Async|Cmac_Async|CompareDmaFinalOutputAddress|ConfigureCommandCRC|Disable|EccKeyExchangeInt_Async|EccKeyExchange_Async|EccKeyGen_Async|EccSign_Async|EccVerifyInt_Async|EccVerify_Async|Enable_Async|GetCommandCRC|GetErrorCode|GetErrorLevel|GetHwConfig|GetHwState|GetHwVersion|GetIntEnableFlags|GetKeyProperties|GetLastDmaAddress|GetLock|GetRandomStartDelay|GlitchDetector_GetEventCounter|GlitchDetector_LoadConfig_Async|GlitchDetector_ResetEventCounter|GlitchDetector_Trim_Async|Hash_Async|Hash_ShaDirect|Hkdf_Rfc5869_Async|Hkdf_Sp80056c_Async|Hmac_Async|IsLocked|KeyDelete_Async|KeyExport_Async|KeyImportPuk_Async|KeyImport_Async|KeyProvisionRom_Async|KeyProvision_Async|LimitedWaitForOperation|Prng_GetRandom|Prng_GetRandomWord|Prng_Init_Async|ReleaseLock|ResetErrorFlags|ResetIntFlags|Reset_Async|RespGen_Async|Rng_DrbgRequestRaw_Async|Rng_DrbgRequest_Async|Rng_DrbgTestAesCtr_Async|Rng_DrbgTestAesEcb_Async|Rng_DrbgTestExtract_Async|Rng_DrbgTestInstantiate_Async|Rng_Dtrng_ConfigEvaluate_Async|Rng_Dtrng_ConfigLoadPrv_Async|Rng_Dtrng_ConfigLoad_Async|SetIntEnableFlags|SetIntFlags|SetMasterUnlock|SetRandomStartDelay|ShaDirect_Disable|ShaDirect_Enable|TlsGenerateMasterKeyFromPreMasterKey_Async|TlsGenerateSessionKeysFromMasterKey_Async|UpdateRefCRC|VerifyVsRefCRC|WaitForOperation))(?!\w)
* -->
* mcuxClEls_\1
*/
#define mcuxClCss_Aead_Finalize_Async mcuxClEls_Aead_Finalize_Async
#define mcuxClCss_Aead_Init_Async mcuxClEls_Aead_Init_Async
#define mcuxClCss_Aead_PartialInit_Async mcuxClEls_Aead_PartialInit_Async
#define mcuxClCss_Aead_UpdateAad_Async mcuxClEls_Aead_UpdateAad_Async
#define mcuxClCss_Aead_UpdateData_Async mcuxClEls_Aead_UpdateData_Async
#define mcuxClCss_Cipher_Async mcuxClEls_Cipher_Async
#define mcuxClCss_Ckdf_Sp800108_Async mcuxClEls_Ckdf_Sp800108_Async
#define mcuxClCss_Ckdf_Sp80056c_Expand_Async mcuxClEls_Ckdf_Sp80056c_Expand_Async
#define mcuxClCss_Ckdf_Sp80056c_Extract_Async mcuxClEls_Ckdf_Sp80056c_Extract_Async
#define mcuxClCss_Cmac_Async mcuxClEls_Cmac_Async
#define mcuxClCss_CompareDmaFinalOutputAddress mcuxClEls_CompareDmaFinalOutputAddress
#define mcuxClCss_ConfigureCommandCRC mcuxClEls_ConfigureCommandCRC
#define mcuxClCss_Disable mcuxClEls_Disable
#define mcuxClCss_EccKeyExchangeInt_Async mcuxClEls_EccKeyExchangeInt_Async
#define mcuxClCss_EccKeyExchange_Async mcuxClEls_EccKeyExchange_Async
#define mcuxClCss_EccKeyGen_Async mcuxClEls_EccKeyGen_Async
#define mcuxClCss_EccSign_Async mcuxClEls_EccSign_Async
#define mcuxClCss_EccVerifyInt_Async mcuxClEls_EccVerifyInt_Async
#define mcuxClCss_EccVerify_Async mcuxClEls_EccVerify_Async
#define mcuxClCss_Enable_Async mcuxClEls_Enable_Async
#define mcuxClCss_GetCommandCRC mcuxClEls_GetCommandCRC
#define mcuxClCss_GetErrorCode mcuxClEls_GetErrorCode
#define mcuxClCss_GetErrorLevel mcuxClEls_GetErrorLevel
#define mcuxClCss_GetHwConfig mcuxClEls_GetHwConfig
#define mcuxClCss_GetHwState mcuxClEls_GetHwState
#define mcuxClCss_GetHwVersion mcuxClEls_GetHwVersion
#define mcuxClCss_GetIntEnableFlags mcuxClEls_GetIntEnableFlags
#define mcuxClCss_GetKeyProperties mcuxClEls_GetKeyProperties
#define mcuxClCss_GetLastDmaAddress mcuxClEls_GetLastDmaAddress
#define mcuxClCss_GetLock mcuxClEls_GetLock
#define mcuxClCss_GetRandomStartDelay mcuxClEls_GetRandomStartDelay
#define mcuxClCss_GlitchDetector_GetEventCounter mcuxClEls_GlitchDetector_GetEventCounter
#define mcuxClCss_GlitchDetector_LoadConfig_Async mcuxClEls_GlitchDetector_LoadConfig_Async
#define mcuxClCss_GlitchDetector_ResetEventCounter mcuxClEls_GlitchDetector_ResetEventCounter
#define mcuxClCss_GlitchDetector_Trim_Async mcuxClEls_GlitchDetector_Trim_Async
#define mcuxClCss_Hash_Async mcuxClEls_Hash_Async
#define mcuxClCss_Hash_ShaDirect mcuxClEls_Hash_ShaDirect
#define mcuxClCss_Hkdf_Rfc5869_Async mcuxClEls_Hkdf_Rfc5869_Async
#define mcuxClCss_Hkdf_Sp80056c_Async mcuxClEls_Hkdf_Sp80056c_Async
#define mcuxClCss_Hmac_Async mcuxClEls_Hmac_Async
#define mcuxClCss_IsLocked mcuxClEls_IsLocked
#define mcuxClCss_KeyDelete_Async mcuxClEls_KeyDelete_Async
#define mcuxClCss_KeyExport_Async mcuxClEls_KeyExport_Async
#define mcuxClCss_KeyImportPuk_Async mcuxClEls_KeyImportPuk_Async
#define mcuxClCss_KeyImport_Async mcuxClEls_KeyImport_Async
#define mcuxClCss_KeyProvisionRom_Async mcuxClEls_KeyProvisionRom_Async
#define mcuxClCss_KeyProvision_Async mcuxClEls_KeyProvision_Async
#define mcuxClCss_LimitedWaitForOperation mcuxClEls_LimitedWaitForOperation
#define mcuxClCss_Prng_GetRandom mcuxClEls_Prng_GetRandom
#define mcuxClCss_Prng_GetRandomWord mcuxClEls_Prng_GetRandomWord
#define mcuxClCss_Prng_Init_Async mcuxClEls_Prng_Init_Async
#define mcuxClCss_ReleaseLock mcuxClEls_ReleaseLock
#define mcuxClCss_ResetErrorFlags mcuxClEls_ResetErrorFlags
#define mcuxClCss_ResetIntFlags mcuxClEls_ResetIntFlags
#define mcuxClCss_Reset_Async mcuxClEls_Reset_Async
#define mcuxClCss_RespGen_Async mcuxClEls_RespGen_Async
#define mcuxClCss_Rng_DrbgRequestRaw_Async mcuxClEls_Rng_DrbgRequestRaw_Async
#define mcuxClCss_Rng_DrbgRequest_Async mcuxClEls_Rng_DrbgRequest_Async
#define mcuxClCss_Rng_DrbgTestAesCtr_Async mcuxClEls_Rng_DrbgTestAesCtr_Async
#define mcuxClCss_Rng_DrbgTestAesEcb_Async mcuxClEls_Rng_DrbgTestAesEcb_Async
#define mcuxClCss_Rng_DrbgTestExtract_Async mcuxClEls_Rng_DrbgTestExtract_Async
#define mcuxClCss_Rng_DrbgTestInstantiate_Async mcuxClEls_Rng_DrbgTestInstantiate_Async
#define mcuxClCss_Rng_Dtrng_ConfigEvaluate_Async mcuxClEls_Rng_Dtrng_ConfigEvaluate_Async
#define mcuxClCss_Rng_Dtrng_ConfigLoadPrv_Async mcuxClEls_Rng_Dtrng_ConfigLoadPrv_Async
#define mcuxClCss_Rng_Dtrng_ConfigLoad_Async mcuxClEls_Rng_Dtrng_ConfigLoad_Async
#define mcuxClCss_SetIntEnableFlags mcuxClEls_SetIntEnableFlags
#define mcuxClCss_SetIntFlags mcuxClEls_SetIntFlags
#define mcuxClCss_SetMasterUnlock mcuxClEls_SetMasterUnlock
#define mcuxClCss_SetRandomStartDelay mcuxClEls_SetRandomStartDelay
#define mcuxClCss_ShaDirect_Disable mcuxClEls_ShaDirect_Disable
#define mcuxClCss_ShaDirect_Enable mcuxClEls_ShaDirect_Enable
#define mcuxClCss_TlsGenerateMasterKeyFromPreMasterKey_Async mcuxClEls_TlsGenerateMasterKeyFromPreMasterKey_Async
#define mcuxClCss_TlsGenerateSessionKeysFromMasterKey_Async mcuxClEls_TlsGenerateSessionKeysFromMasterKey_Async
#define mcuxClCss_UpdateRefCRC mcuxClEls_UpdateRefCRC
#define mcuxClCss_VerifyVsRefCRC mcuxClEls_VerifyVsRefCRC
#define mcuxClCss_WaitForOperation mcuxClEls_WaitForOperation
/**
* There are also corresponding changes in other components:
* mcuxClMac_Mode_HMAC_SHA2_256_CSS -> mcuxClMac_Mode_HMAC_SHA2_256_ELS
* mcuxClRandomModes_Mode_CSS_Drbg -> mcuxClRandomModes_Mode_ELS_Drbg
*/
#endif /* MCUXCLELS_MAPPING_H_ */
@@ -0,0 +1,383 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2020-2023 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/** @file mcuxClEls_Common.c
* @brief ELS implementation for common functionality.
* This file implements the functions declared in mcuxClEls_Common.h and adds helper functions used by other implementation headers. */
#include <stdbool.h>
#include <platform_specific_headers.h>
#include <mcuxCsslFlowProtection.h>
#include <mcuxClCore_FunctionIdentifiers.h>
#include <mcuxClEls.h>
#include <internal/mcuxClEls_Internal.h>
#include <internal/mcuxClEls_Internal_Common.h>
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClEls_GetHwVersion)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_GetHwVersion(
mcuxClEls_HwVersion_t * result)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClEls_GetHwVersion);
result->word.value = MCUXCLELS_SFR_READ(ELS_VERSION);
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClEls_GetHwVersion, MCUXCLELS_STATUS_OK);
}
#ifdef MCUXCL_FEATURE_ELS_HWCONFIG
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClEls_GetHwConfig)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_GetHwConfig(
mcuxClEls_HwConfig_t * result)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClEls_GetHwConfig);
result->word.value = MCUXCLELS_SFR_READ(ELS_CONFIG);
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClEls_GetHwConfig, MCUXCLELS_STATUS_OK);
}
#endif /* MCUXCL_FEATURE_ELS_HWCONFIG */
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClEls_GetHwState)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_GetHwState(
mcuxClEls_HwState_t * result)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClEls_GetHwState);
result->word.value = MCUXCLELS_SFR_READ(ELS_STATUS);
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClEls_GetHwState, MCUXCLELS_STATUS_OK);
}
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClEls_Enable_Async)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_Enable_Async(
void)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClEls_Enable_Async);
const uint32_t sfrVal = MCUXCLELS_SFR_FIELD_FORMAT(ELS_CTRL, ELS_EN, 1u);
MCUXCLELS_SFR_WRITE(ELS_CTRL, sfrVal);
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClEls_Enable_Async, MCUXCLELS_STATUS_OK_WAIT);
}
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClEls_Disable)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_Disable(
void)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClEls_Disable);
MCUXCLELS_SET_CTRL_FIELD(MCUXCLELS_SFR_CTRL_ELS_EN, 0u);
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClEls_Disable, MCUXCLELS_STATUS_OK);
}
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClEls_GetErrorCode)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_GetErrorCode(
mcuxClEls_ErrorHandling_t errorHandling)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClEls_GetErrorCode);
mcuxClEls_Status_t result = MCUXCLELS_STATUS_SW_FAULT;
if (1U == MCUXCLELS_GET_STATUS_FIELD(MCUXCLELS_SFR_STATUS_ELS_ERR))
{
if (MCUXCLELS_IS_ERROR_BIT_SET(MCUXCLELS_SFR_ERR_STATUS_FLT_ERR))
{
result = MCUXCLELS_STATUS_HW_FAULT;
}
else if (MCUXCLELS_IS_ERROR_BIT_SET(MCUXCLELS_SFR_ERR_STATUS_ITG_ERR))
{
result = MCUXCLELS_STATUS_HW_INTEGRITY;
}
else if (MCUXCLELS_IS_ERROR_BIT_SET(MCUXCLELS_SFR_ERR_STATUS_OPN_ERR))
{
result = MCUXCLELS_STATUS_HW_OPERATIONAL;
}
else if (MCUXCLELS_IS_ERROR_BIT_SET(MCUXCLELS_SFR_ERR_STATUS_ALG_ERR))
{
result = MCUXCLELS_STATUS_HW_ALGORITHM;
}
else if (MCUXCLELS_IS_ERROR_BIT_SET(MCUXCLELS_SFR_ERR_STATUS_BUS_ERR))
{
result = MCUXCLELS_STATUS_HW_BUS;
}
else if (MCUXCLELS_IS_ERROR_BIT_SET(MCUXCLELS_SFR_ERR_STATUS_PRNG_ERR))
{
result = MCUXCLELS_STATUS_HW_PRNG;
}
else if (MCUXCLELS_IS_ERROR_BIT_SET(MCUXCLELS_SFR_ERR_STATUS_DTRNG_ERR))
{
result = MCUXCLELS_STATUS_HW_DTRNG;
}
else
{
result = MCUXCLELS_STATUS_SW_FAULT;
}
}
else
{
result = MCUXCLELS_STATUS_OK;
}
if (MCUXCLELS_ERROR_FLAGS_CLEAR == errorHandling){
MCUX_CSSL_FP_FUNCTION_CALL_VOID(mcuxClEls_ResetErrorFlags()); /* always returns MCUXCLELS_STATUS_OK. */
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClEls_GetErrorCode, result,
MCUX_CSSL_FP_FUNCTION_CALLED(mcuxClEls_ResetErrorFlags));
}
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClEls_GetErrorCode, result);
}
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClEls_GetErrorLevel)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_GetErrorLevel(
mcuxClEls_ErrorHandling_t errorHandling,
uint32_t *errorLevel)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClEls_GetErrorLevel);
*errorLevel = MCUXCLELS_GET_ERROR_STATUS_FIELD(MCUXCLELS_SFR_ERR_STATUS_ERR_LVL);
MCUX_CSSL_FP_FUNCTION_CALL(result, mcuxClEls_GetErrorCode(errorHandling));
/* Exit function with expectation: mcuxClEls_GetErrorCode was called unconditionally */
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClEls_GetErrorLevel, result,
MCUX_CSSL_FP_FUNCTION_CALLED(mcuxClEls_GetErrorCode));
}
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClEls_WaitForOperation)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_WaitForOperation(
mcuxClEls_ErrorHandling_t errorHandling)
{
/* Enter flow-protected function with expectation: mcuxClEls_GetErrorCode will be called (unconditionally) */
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClEls_WaitForOperation,
MCUX_CSSL_FP_FUNCTION_CALLED(mcuxClEls_GetErrorCode));
while (mcuxClEls_isBusy())
{
// Do nothing
}
MCUX_CSSL_FP_FUNCTION_CALL(result, mcuxClEls_GetErrorCode(errorHandling));
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClEls_WaitForOperation, result);
}
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClEls_LimitedWaitForOperation)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_LimitedWaitForOperation(
uint32_t counterLimit,
mcuxClEls_ErrorHandling_t errorHandling)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClEls_LimitedWaitForOperation);
bool counterExpired = true;
while (0U != counterLimit)
{
if (!mcuxClEls_isBusy())
{
counterExpired = false;
break;
}
counterLimit--;
}
if (true == counterExpired)
{
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClEls_LimitedWaitForOperation, MCUXCLELS_STATUS_SW_COUNTER_EXPIRED);
}
MCUX_CSSL_FP_FUNCTION_CALL(result, mcuxClEls_GetErrorCode(errorHandling));
/* Exit function with expectation: mcuxClEls_GetErrorCode was called */
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClEls_LimitedWaitForOperation, result,
MCUX_CSSL_FP_FUNCTION_CALLED(mcuxClEls_GetErrorCode));
}
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClEls_ResetErrorFlags)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_ResetErrorFlags(
void)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClEls_ResetErrorFlags);
const uint32_t sfrVal = MCUXCLELS_SFR_FIELD_FORMAT(ELS_ERR_STATUS, CLR_ERR_CLR, MCUXCLELS_ERROR_FLAGS_CLEAR);
MCUXCLELS_SFR_WRITE(ELS_ERR_STATUS_CLR, sfrVal);
// Poll error bit to be sure that error bits has been cleared. Required by HW spec.
while(0u != MCUXCLELS_GET_STATUS_FIELD(MCUXCLELS_SFR_STATUS_ELS_ERR))
{
// Do nothing
}
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClEls_ResetErrorFlags, MCUXCLELS_STATUS_OK);
}
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClEls_Reset_Async)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_Reset_Async(
mcuxClEls_ResetOption_t options)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClEls_Reset_Async);
if (mcuxClEls_isBusy() && (MCUXCLELS_RESET_DO_NOT_CANCEL == options))
{
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClEls_Reset_Async, MCUXCLELS_STATUS_SW_CANNOT_INTERRUPT);
}
#ifdef MCUXCL_FEATURE_ELS_ITERATIVE_SEEDING
/* Set the drbg_block_counter to a value triggering a reseed after the upcoming RESET operation via interrupt */
mcuxClEls_rng_drbg_block_counter = MCUXCLELS_RNG_DRBG_BLOCK_COUNTER_THRESHOLD;
#endif /* MCUXCL_FEATURE_ELS_ITERATIVE_SEEDING */
MCUXCLELS_SET_CTRL_FIELD(MCUXCLELS_SFR_CTRL_RESET, 1u);
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClEls_Reset_Async, MCUXCLELS_STATUS_OK_WAIT);
}
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClEls_SetIntEnableFlags)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_SetIntEnableFlags(
mcuxClEls_InterruptOptionEn_t options)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClEls_SetIntEnableFlags);
MCUXCLELS_SFR_WRITE(ELS_INT_ENABLE, options.word.value);
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClEls_SetIntEnableFlags, MCUXCLELS_STATUS_OK);
}
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClEls_GetIntEnableFlags)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_GetIntEnableFlags(
mcuxClEls_InterruptOptionEn_t * result)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClEls_GetIntEnableFlags);
result->word.value = MCUXCLELS_SFR_READ(ELS_INT_ENABLE);
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClEls_GetIntEnableFlags, MCUXCLELS_STATUS_OK);
}
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClEls_ResetIntFlags)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_ResetIntFlags(
mcuxClEls_InterruptOptionRst_t options)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClEls_ResetIntFlags);
MCUXCLELS_SFR_WRITE(ELS_INT_STATUS_CLR, options.word.value);
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClEls_ResetIntFlags, MCUXCLELS_STATUS_OK);
}
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClEls_SetIntFlags)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_SetIntFlags(
mcuxClEls_InterruptOptionSet_t options)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClEls_SetIntFlags);
MCUXCLELS_SFR_WRITE(ELS_INT_STATUS_SET, options.word.value);
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClEls_SetIntFlags, MCUXCLELS_STATUS_OK);
}
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClEls_SetRandomStartDelay)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_SetRandomStartDelay(
uint32_t startDelay)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClEls_SetRandomStartDelay);
MCUXCLELS_INPUT_PARAM_CHECK_PROTECTED(mcuxClEls_SetRandomStartDelay, 1024u < startDelay);
if (mcuxClEls_isBusy())
{
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClEls_SetRandomStartDelay, MCUXCLELS_STATUS_SW_CANNOT_INTERRUPT);
}
MCUXCLELS_SET_CFG_FIELD(MCUXCLELS_SFR_CFG_ADCTRL, startDelay);
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClEls_SetRandomStartDelay, MCUXCLELS_STATUS_OK);
}
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClEls_GetRandomStartDelay)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_GetRandomStartDelay(
uint32_t *startDelay)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClEls_GetRandomStartDelay);
*startDelay = MCUXCLELS_GET_CFG_FIELD(MCUXCLELS_SFR_CFG_ADCTRL);
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClEls_GetRandomStartDelay, MCUXCLELS_STATUS_OK);
}
#ifdef MCUXCL_FEATURE_ELS_LOCKING
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClEls_GetLock)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_GetLock(
uint32_t * pSessionId)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClEls_GetLock);
*pSessionId = MCUXCLELS_SFR_READ(ELS_SESSION_ID);
if(0u == *pSessionId)
{
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClEls_GetLock, MCUXCLELS_STATUS_SW_LOCKING_FAILED);
}
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClEls_GetLock, MCUXCLELS_STATUS_OK);
}
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClEls_ReleaseLock)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_ReleaseLock(
uint32_t sessionId)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClEls_ReleaseLock);
MCUXCLELS_SFR_WRITE(ELS_SESSION_ID, sessionId);
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClEls_ReleaseLock, MCUXCLELS_STATUS_OK);
}
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClEls_IsLocked)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_IsLocked(
void)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClEls_IsLocked);
if(1u == MCUXCLELS_GET_STATUS_FIELD(MCUXCLELS_SFR_STATUS_ELS_LOCKED))
{
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClEls_IsLocked, MCUXCLELS_STATUS_SW_STATUS_LOCKED);
}
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClEls_IsLocked, MCUXCLELS_STATUS_OK);
}
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClEls_SetMasterUnlock)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_SetMasterUnlock(
uint32_t masterId)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClEls_SetMasterUnlock);
MCUXCLELS_SFR_WRITE(ELS_MASTER_ID, masterId);
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClEls_SetMasterUnlock, MCUXCLELS_STATUS_OK);
}
#endif /* MCUXCL_FEATURE_ELS_LOCKING */
#ifdef MCUXCL_FEATURE_ELS_DMA_ADDRESS_READBACK
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClEls_GetLastDmaAddress)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_GetLastDmaAddress(uint32_t* pLastAddress)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClEls_GetLastDmaAddress);
*pLastAddress = MCUXCLELS_SFR_READ(ELS_DMA_FIN_ADDR);
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClEls_GetLastDmaAddress, MCUXCLELS_STATUS_OK);
}
#endif /* MCUXCL_FEATURE_ELS_DMA_ADDRESS_READBACK */
#ifdef MCUXCL_FEATURE_ELS_DMA_FINAL_ADDRESS_READBACK
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClEls_CompareDmaFinalOutputAddress)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_CompareDmaFinalOutputAddress(
uint8_t *outputStartAddress,
size_t expectedLength)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClEls_CompareDmaFinalOutputAddress,
MCUX_CSSL_FP_FUNCTION_CALLED(mcuxClEls_GetLastDmaAddress));
/* Calculate the expected final address from the input */
uint32_t expectedFinalAddress = (uint32_t)outputStartAddress + expectedLength;
/* Get the actual final address from ELS - no result check as function always returns OK */
uint32_t finalAddress;
MCUX_CSSL_FP_FUNCTION_CALL_VOID(mcuxClEls_GetLastDmaAddress(&finalAddress));
/* Compare the expected address to the actual one */
if(finalAddress != expectedFinalAddress)
{
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClEls_CompareDmaFinalOutputAddress, MCUXCLELS_STATUS_SW_COMPARISON_FAILED);
}
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClEls_CompareDmaFinalOutputAddress, MCUXCLELS_STATUS_OK);
}
#endif /* MCUXCL_FEATURE_ELS_DMA_FINAL_ADDRESS_READBACK */
@@ -0,0 +1,98 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2020-2022 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/** @file mcuxClEls_GlitchDetector.c
* @brief ELS implementation for key management.
* This file implements the functions declared in mcuxClEls_GlitchDetector.h. */
#include <mcuxClEls_GlitchDetector.h>
#include <stdbool.h>
#include <mcuxClEls.h>
#include <mcuxCsslFlowProtection.h>
#include <mcuxClCore_FunctionIdentifiers.h>
#include <internal/mcuxClEls_Internal.h>
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClEls_GlitchDetector_LoadConfig_Async)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_GlitchDetector_LoadConfig_Async(
uint8_t const * pInput)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClEls_GlitchDetector_LoadConfig_Async);
/* ELS SFRs are not cached => Tell SW to wait for ELS to come back from BUSY state before modifying the SFRs */
if (mcuxClEls_isBusy())
{
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClEls_GlitchDetector_LoadConfig_Async, MCUXCLELS_STATUS_SW_CANNOT_INTERRUPT);
}
mcuxClEls_setInput0_fixedSize(pInput);
mcuxClEls_startCommand(ID_CFG_ELS_CMD_GDET_CFG_LOAD, 0U, ELS_CMD_BIG_ENDIAN);
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClEls_GlitchDetector_LoadConfig_Async, MCUXCLELS_STATUS_OK_WAIT);
}
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClEls_GlitchDetector_Trim_Async)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_GlitchDetector_Trim_Async(
uint8_t * pOutput)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClEls_GlitchDetector_Trim_Async);
/* ELS SFRs are not cached => Tell SW to wait for ELS to come back from BUSY state before modifying the SFRs */
if (mcuxClEls_isBusy())
{
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClEls_GlitchDetector_Trim_Async, MCUXCLELS_STATUS_SW_CANNOT_INTERRUPT);
}
mcuxClEls_setOutput_fixedSize(pOutput);
mcuxClEls_startCommand(ID_CFG_ELS_CMD_GDET_TRIM, 0U, ELS_CMD_BIG_ENDIAN);
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClEls_GlitchDetector_Trim_Async, MCUXCLELS_STATUS_OK_WAIT);
}
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClEls_GlitchDetector_GetEventCounter)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_GlitchDetector_GetEventCounter(
uint8_t * pCount)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClEls_GlitchDetector_GetEventCounter);
// Decode from Gray coding
uint8_t count8 = (uint8_t) MCUXCLELS_GET_GDET_EVTCNT_FIELD(MCUXCLELS_SFR_GDET_EVTCNT_GDET_EVTCNT);
count8 ^= count8 >> 4u;
count8 ^= count8 >> 2u;
count8 ^= count8 >> 1u;
// Assign to the result variable
*pCount = count8;
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClEls_GlitchDetector_GetEventCounter, MCUXCLELS_STATUS_OK);
}
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClEls_GlitchDetector_ResetEventCounter)
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_GlitchDetector_ResetEventCounter(
void)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClEls_GlitchDetector_ResetEventCounter);
// Start GDET Event Counter reset
MCUXCLELS_SFR_WRITE(ELS_GDET_EVTCNT_CLR, 1u);
// The actual reset occurs in a different clock domain from the ELS core clock, so we have to wait for synchroni-
// zation. The spec states that this takes on the order of 2 cycles of the ELS core clock plus 2 cycles of the
// Glitch Detector reference clock.
while(1u != MCUXCLELS_GET_GDET_EVTCNT_FIELD(MCUXCLELS_SFR_GDET_EVTCNT_GDET_EVTCNT_CLR_DONE))
{
// Do nothing
}
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClEls_GlitchDetector_ResetEventCounter, MCUXCLELS_STATUS_OK);
}
@@ -0,0 +1,85 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2023 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/** @file mcuxClMemory_ClearSecure_Internal.h
* @brief Memory header for secure clear function.
* This header exposes functions that enable secure memory clear function.
*/
/**
* @defgroup mcuxClMemory_Clear_Secure_Internal mcuxClMemory_Clear_Secure_Internal
* @brief This function clears all bytes in a memory region to null in a secure way
* when a secure clear is available.
* @ingroup mcuxClMemory
* @{
*/
#ifndef MCUXCLMEMORY_CLEARSECURE_INTERNAL_H_
#define MCUXCLMEMORY_CLEARSECURE_INTERNAL_H_
#include <mcuxClConfig.h> // Exported features flags header
#include <mcuxClCore_Platform.h>
#include <mcuxClMemory_Constants.h>
#include <mcuxClMemory_Types.h>
#include <mcuxClToolchain.h>
#include <mcuxCsslAnalysis.h>
#include <mcuxCsslFlowProtection.h>
#include <internal/mcuxClMemory_SetSecure_Internal.h>
#ifdef __cplusplus
extern "C" {
#endif
/**********************************************
* FUNCTIONS
**********************************************/
/**
* Sets all bytes of a memory buffer to a specified value.
*
* The two buffers must not overlap.
*
* * Data Integrity: Record(pSrc + pDst + length)
*
* @param[out] pDst pointer to the buffer to be set.
* @param[in] length size (in bytes) to be set.
*
* @return A status code encapsulated in a flow-protection type.
* @retval #MCUXCLMEMORY_STATUS_OK If @p length bytes cleared at @p pDst.
* @retval #MCUXCLMEMORY_STATUS_FAULT
*/
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClMemory_clear_secure_int)
static inline MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClMemory_Status_t) mcuxClMemory_clear_secure_int
(
uint8_t * pDst,
uint32_t length
)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClMemory_clear_secure_int);
MCUX_CSSL_FP_FUNCTION_CALL(retval, mcuxClMemory_set_secure_int(pDst, 0u, length));
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClMemory_clear_secure_int, retval, MCUX_CSSL_FP_FUNCTION_CALLED(mcuxClMemory_set_secure_int));
}
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* MCUXCLMEMORY_CLEARSECURE_INTERNAL_H_ */
/**
* @}
*/
@@ -0,0 +1,94 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2020-2021, 2023 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/** @file mcuxClMemory_Clear_Internal.h
* @brief Memory header for clear function.
* This header exposes functions that enable using memory clear function.
*/
/**
* @defgroup mcuxClMemory_Clear_Internal mcuxClMemory_Clear_Internal
* @brief This function clears a memory region.
* @ingroup mcuxClMemory
* @{
*/
#ifndef MCUXCLMEMORY_CLEAR_INTERNAL_H_
#define MCUXCLMEMORY_CLEAR_INTERNAL_H_
#include <mcuxClConfig.h> // Exported features flags header
#include <mcuxClCore_Platform.h>
#include <mcuxClMemory_Constants.h>
#include <mcuxClMemory_Types.h>
#include <mcuxClToolchain.h>
#include <mcuxCsslAnalysis.h>
#include <mcuxCsslFlowProtection.h>
#include <mcuxCsslDataIntegrity.h>
#include <mcuxCsslMemory.h>
#ifdef __cplusplus
extern "C" {
#endif
/**********************************************
* FUNCTIONS
**********************************************/
/**
* Sets all bytes of a memory buffer to a specified value.
*
* The two buffers must not overlap.
*
* * Data Integrity: Record(pDst + length)
*
* @param[out] pDst pointer to the buffer to be set.
* @param[in] length size (in bytes) to be set.
*
* @return A status code encapsulated in a flow-protection type.
* @retval #MCUXCLMEMORY_STATUS_OK If @p length bytes cleared at @p pDst.
* @retval #MCUXCLMEMORY_STATUS_FAULT
*/
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClMemory_clear_int)
static inline MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClMemory_Status_t) mcuxClMemory_clear_int
(
uint8_t * pDst,
uint32_t length
)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClMemory_clear_int);
mcuxClMemory_Status_t retval = MCUXCLMEMORY_STATUS_FAULT;
MCUX_CSSL_FP_FUNCTION_CALL(csslRetval, mcuxCsslMemory_Clear(
mcuxCsslParamIntegrity_Protect(3u, pDst, length, length),
pDst,
length,
length));
retval = (mcuxClMemory_Status_t) csslRetval ^ (MCUXCSSLMEMORY_COMPONENT_MASK ^ MCUXCLMEMORY_COMPONENT_MASK);
MCUX_CSSL_DI_RECORD(identifier /* Not used */, (uint32_t) pDst + length); // Unbalance the SC
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClMemory_clear_int, retval, MCUX_CSSL_FP_FUNCTION_CALLED(mcuxCsslMemory_Clear));
}
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* MCUXCLMEMORY_CLEAR_INTERNAL_H_ */
/**
* @}
*/
@@ -0,0 +1,89 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2023 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/** @file mcuxClMemory_CompareDPASecure_Internal.h
* @brief Memory header for dpa secure compare function.
* This header exposes functions that enable dpa secure memory compare function.
*/
/**
* @defgroup mcuxClMemory_Compare_DPASecure_Internal mcuxClMemory_Compare_DPASecure_Internal
* @brief This function compares two memory region @p lhs and @p rhs.
* @ingroup mcuxClMemory
* @{
*/
#ifndef MCUXCLMEMORY_COMPARE_DPA_SECURE_INTERNAL_H_
#define MCUXCLMEMORY_COMPARE_DPA_SECURE_INTERNAL_H_
#include <mcuxClConfig.h> // Exported features flags header
#include <mcuxClCore_Platform.h>
#include <mcuxClMemory_Constants.h>
#include <mcuxClMemory_Types.h>
#include <mcuxCsslFlowProtection.h>
#include <mcuxClSession_Types.h>
#include <internal/mcuxClMemory_CompareSecure_Internal.h>
#ifdef __cplusplus
extern "C" {
#endif
/**********************************************
* FUNCTIONS
**********************************************/
/**
* Compares two memory buffers with security against fault and DPA.
*
* The two buffers must not overlap.
*
* * Data Integrity: Record(pLhs + pRhs + length)
*
* @param[in] session Handle for the current CL session.
* @param[in] pLhs pointer to the left buffer to be compared.
* @param[in] pRhs pointer to the right buffer to be compared.
* @param[in] length size (in bytes) to be compared.
*
* @return A status code encapsulated in a flow-protection type.
* @retval #MCUXCLMEMORY_STATUS_EQUAL If length bytes of Lhs and Rhs are equal.
* @retval #MCUXCLMEMORY_STATUS_NOT_EQUAL If at least one bytes differ between the two.
* @retval #MCUXCLMEMORY_STATUS_FAULT
*/
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClMemory_compare_dpasecure_int)
static inline MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClMemory_Status_t) mcuxClMemory_compare_dpasecure_int
(
mcuxClSession_Handle_t session,
const uint8_t * pLhs,
const uint8_t * pRhs,
uint32_t length
)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClMemory_compare_dpasecure_int);
(void)session;
MCUX_CSSL_FP_FUNCTION_CALL(retClCompare, mcuxClMemory_compare_secure_int(pLhs, pRhs, length));
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClMemory_compare_dpasecure_int, retClCompare, MCUX_CSSL_FP_FUNCTION_CALLED(mcuxClMemory_compare_secure_int));
}
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* MCUXCLMEMORY_COMPARE_DPA_SECURE_INTERNAL_H_ */
/**
* @}
*/
@@ -0,0 +1,85 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2023 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/** @file mcuxClMemory_CompareSecure_Internal.h
* @brief Memory header for compare function.
* This header exposes functions that enable secure memory compare function.
*/
/**
* @defgroup mcuxClMemory_Compare_Internal mcuxClMemory_Compare_Secure_Internal
* @brief This function compares two memory region @p lhs and @p rhs.
* @ingroup mcuxClMemory
* @{
*/
#ifndef MCUXCLMEMORY_COMPARE_SECURE_INTERNAL_H_
#define MCUXCLMEMORY_COMPARE_SECURE_INTERNAL_H_
#include <mcuxClConfig.h> // Exported features flags header
#include <mcuxClCore_Platform.h>
#include <mcuxClMemory_Constants.h>
#include <mcuxClMemory_Types.h>
#include <mcuxCsslFlowProtection.h>
#include <internal/mcuxClMemory_Compare_Internal.h>
#ifdef __cplusplus
extern "C" {
#endif
/**********************************************
* FUNCTIONS
**********************************************/
/**
* Compares two memory buffers with security against fault and SPA.
*
* The two buffers must not overlap.
*
* * Data Integrity: Record(pLhs + pRhs + length)
*
* @param[in] pLhs pointer to the left buffer to be compared.
* @param[in] pRhs pointer to the right buffer to be compared.
* @param[in] length size (in bytes) to be compared.
*
* @return A status code encapsulated in a flow-protection type.
* @retval #MCUXCLMEMORY_STATUS_EQUAL If length bytes of Lhs and Rhs are equal.
* @retval #MCUXCLMEMORY_STATUS_NOT_EQUAL If at least one bytes differ between the two.
* @retval #MCUXCLMEMORY_STATUS_FAULT
*/
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClMemory_compare_secure_int)
static inline MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClMemory_Status_t) mcuxClMemory_compare_secure_int
(
const uint8_t * pLhs,
const uint8_t * pRhs,
uint32_t length
)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClMemory_compare_secure_int);
MCUX_CSSL_FP_FUNCTION_CALL(retClCompare, mcuxClMemory_compare_int(pLhs, pRhs, length));
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClMemory_compare_secure_int, retClCompare, MCUX_CSSL_FP_FUNCTION_CALLED(mcuxClMemory_compare_int));
}
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* MCUXCLMEMORY_COMPARE_SECURE_INTERNAL_H_ */
/**
* @}
*/
@@ -0,0 +1,91 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2023 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/** @file mcuxClMemory_Compare_Internal.h
* @brief Memory header for internal compare function.
* This header exposes functions that enable memory compare function.
*/
/**
* @defgroup mcuxClMemory_Compare_Internal mcuxClMemory_Compare_Internal
* @brief This function compares two memory region @p lhs and @p rhs.
* @ingroup mcuxClMemory
* @{
*/
#ifndef MCUXCLMEMORY_COMPARE_INTERNAL_H_
#define MCUXCLMEMORY_COMPARE_INTERNAL_H_
#include <mcuxClConfig.h> // Exported features flags header
#include <mcuxClCore_Platform.h>
#include <mcuxClMemory_Constants.h>
#include <mcuxClMemory_Types.h>
#include <mcuxCsslMemory.h>
#include <mcuxCsslFlowProtection.h>
#include <mcuxCsslDataIntegrity.h>
#ifdef __cplusplus
extern "C" {
#endif
/**********************************************
* FUNCTIONS
**********************************************/
/**
* Compares two memory buffer with security agains faults.
*
* The two buffers must not overlap.
*
* * Data Integrity: Record(pLhs + pRhs + length)
*
* @param[in] pLhs pointer to the left buffer to be compared.
* @param[in] pRhs pointer to the right buffer to be compared.
* @param[in] length size (in bytes) to be compared.
*
* @return A status code encapsulated in a flow-protection type.
* @retval #MCUXCLMEMORY_STATUS_EQUAL If length bytes of Lhs and Rhs are equal.
* @retval #MCUXCLMEMORY_STATUS_NOT_EQUAL If at least one bytes differ between the two.
* @retval #MCUXCLMEMORY_STATUS_FAULT
*/
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClMemory_compare_int)
static inline MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClMemory_Status_t) mcuxClMemory_compare_int
(
const uint8_t * pLhs,
const uint8_t * pRhs,
uint32_t length
)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClMemory_compare_int);
mcuxClMemory_Status_t retval = MCUXCLMEMORY_STATUS_FAULT;
MCUX_CSSL_FP_FUNCTION_CALL(csslRetval,
mcuxCsslMemory_Compare(mcuxCsslParamIntegrity_Protect(3u, pLhs, pRhs, length),
pLhs, pRhs, length));
retval = (mcuxClMemory_Status_t) csslRetval ^ (MCUXCSSLMEMORY_COMPONENT_MASK ^ MCUXCLMEMORY_COMPONENT_MASK); // May return invalid parameters too.
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClMemory_compare_int, retval, MCUX_CSSL_FP_FUNCTION_CALLED(mcuxCsslMemory_Compare));
}
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* MCUXCLMEMORY_COMPARE_INTERNAL_H_ */
/**
* @}
*/
@@ -0,0 +1,85 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2023 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/** @file mcuxClMemory_CopySecurePow2_Internal.h
* @brief Memory header for copy functions.
* This header exposes functions that enable secure memory copy function.
*/
/**
* @defgroup mcuxClMemory_CopySecurePow2_Internal mcuxClMemory_CopySecurePow2_Internal
* @brief This function securely copies a memory region from @p src to @p dst when a secure copy is available.
* @ingroup mcuxClMemory
* @{
*/
#ifndef MCUXCLMEMORY_COPYSECURE_ALIGNED_INTERNAL_H_
#define MCUXCLMEMORY_COPYSECURE_ALIGNED_INTERNAL_H_
#include <mcuxClConfig.h> // Exported features flags header
#include <mcuxClCore_Platform.h>
#include <mcuxClMemory_Constants.h>
#include <mcuxClMemory_Types.h>
#include <mcuxClToolchain.h>
#include <mcuxCsslFlowProtection.h>
#include <internal/mcuxClMemory_CopySecure_Internal.h>
#ifdef __cplusplus
extern "C" {
#endif
/**********************************************
* FUNCTIONS
**********************************************/
/**
* Copies a memory buffer to another location with security against fault and SPA.
*
* The two buffers must not overlap.
*
* * Data Integrity: Record(pSrc + pDst + length)
*
* @param[out] pDst pointer to the buffer to be copied to.
* @param[in] pSrc pointer to the buffer to copy.
* @param[in] length size (in bytes) to be copied.
*
* @return A status code encapsulated in a flow-protection type.
* @retval #MCUXCLMEMORY_STATUS_OK If @p length bytes copied at @p pDst.
* @retval #MCUXCLMEMORY_STATUS_FAULT
*/
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClMemory_copy_secure_pow2_int)
static inline MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClMemory_Status_t) mcuxClMemory_copy_secure_pow2_int
(
uint8_t * pDst,
uint8_t const * pSrc,
uint32_t length
)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClMemory_copy_secure_pow2_int);
MCUX_CSSL_FP_FUNCTION_CALL(retval, mcuxClMemory_copy_secure_int(pDst, pSrc, length));
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClMemory_copy_secure_pow2_int, retval, MCUX_CSSL_FP_FUNCTION_CALLED(mcuxClMemory_copy_secure_int));
}
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* MCUXCLMEMORY_COPYSECURE_ALIGNED_INTERNAL_H_ */
/**
* @}
*/
@@ -0,0 +1,85 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2023 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/** @file mcuxClMemory_CopySecure_Internal.h
* @brief Memory header for copy functions.
* This header exposes functions that enable secure memory copy function.
*/
/**
* @defgroup mcuxClMemory_Copy_Secure_Internal mcuxClMemory_Copy_Secure_Internal
* @brief This function securely copies a memory region from @p src to @p dst when a secure copy is available.
* @ingroup mcuxClMemory
* @{
*/
#ifndef MCUXCLMEMORY_COPYSECURE_INTERNAL_H_
#define MCUXCLMEMORY_COPYSECURE_INTERNAL_H_
#include <mcuxClConfig.h> // Exported features flags header
#include <mcuxClCore_Platform.h>
#include <mcuxClMemory_Constants.h>
#include <mcuxClMemory_Types.h>
#include <mcuxClToolchain.h>
#include <mcuxCsslFlowProtection.h>
#include <internal/mcuxClMemory_Copy_Internal.h>
#ifdef __cplusplus
extern "C" {
#endif
/**********************************************
* FUNCTIONS
**********************************************/
/**
* Copies a memory buffer to another location with security against fault and SPA.
*
* The two buffers must not overlap.
*
* * Data Integrity: Record(pSrc + pDst + length)
*
* @param[out] pDst pointer to the buffer to be copied to.
* @param[in] pSrc pointer to the buffer to copy.
* @param[in] length size (in bytes) to be copied.
*
* @return A status code encapsulated in a flow-protection type.
* @retval #MCUXCLMEMORY_STATUS_OK If @p length bytes copied at @p pDst.
* @retval #MCUXCLMEMORY_STATUS_FAULT
*/
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClMemory_copy_secure_int)
static inline MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClMemory_Status_t) mcuxClMemory_copy_secure_int
(
uint8_t * pDst,
uint8_t const * pSrc,
uint32_t length
)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClMemory_copy_secure_int);
MCUX_CSSL_FP_FUNCTION_CALL(retval, mcuxClMemory_copy_int(pDst, pSrc, length));
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClMemory_copy_secure_int, retval, MCUX_CSSL_FP_FUNCTION_CALLED(mcuxClMemory_copy_int));
}
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* MCUXCLMEMORY_COPYSECURE_INTERNAL_H_ */
/**
* @}
*/
@@ -0,0 +1,85 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2023 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/** @file mcuxClMemory_CopySecure_Reversed_Internal.h
* @brief Memory header for copy functions.
* This header exposes functions that enable secure memory copy function.
*/
/**
* @defgroup mcuxClMemory_Copy_Secure_Reversed_Internal mcuxClMemory_Copy_Secure_Reversed_Internal
* @brief This function securely copies a memory region from @p src to @p dst when a secure copy is available.
* @ingroup mcuxClMemory
* @{
*/
#ifndef MCUXCLMEMORY_COPYSECURE_REVERSED_INTERNAL_H_
#define MCUXCLMEMORY_COPYSECURE_REVERSED_INTERNAL_H_
#include <mcuxClConfig.h> // Exported features flags header
#include <mcuxClCore_Platform.h>
#include <mcuxClMemory_Constants.h>
#include <mcuxClMemory_Types.h>
#include <mcuxClToolchain.h>
#include <mcuxCsslFlowProtection.h>
#include <internal/mcuxClMemory_Copy_Reversed_Internal.h>
#ifdef __cplusplus
extern "C" {
#endif
/**********************************************
* FUNCTIONS
**********************************************/
/**
* Copies a memory buffer to another location with security against fault and SPA.
*
* The two buffers must not overlap.
*
* * Data Integrity: Record(pSrc + pDst + length)
*
* @param[out] pDst pointer to the buffer to be copied to.
* @param[in] pSrc pointer to the buffer to copy.
* @param[in] length size (in bytes) to be copied.
*
* @return A status code encapsulated in a flow-protection type.
* @retval #MCUXCLMEMORY_STATUS_OK If @p length bytes copied at @p pDst.
* @retval #MCUXCLMEMORY_STATUS_FAULT
*/
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClMemory_copy_secure_reversed_int)
static inline MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClMemory_Status_t) mcuxClMemory_copy_secure_reversed_int
(
uint8_t * pDst,
uint8_t const * pSrc,
uint32_t length
)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClMemory_copy_secure_reversed_int);
MCUX_CSSL_FP_FUNCTION_CALL(retval, mcuxClMemory_copy_reversed_int(pDst, pSrc, length));
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClMemory_copy_secure_reversed_int, retval, MCUX_CSSL_FP_FUNCTION_CALLED(mcuxClMemory_copy_reversed_int));
}
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* MCUXCLMEMORY_COPYSECURE_REVERSED_INTERNAL_H_ */
/**
* @}
*/
@@ -0,0 +1,88 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2023 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/** @file mcuxClMemory_CopyWords_Internal.h
* @brief Memory header for copy functions.
* This header exposes functions that enable memory copy word function.
*/
/**
* @defgroup mcuxClMemory_Copy_Words_Internal mcuxClMemory_Copy_Words_Internal
* @brief This function copies a memory region from @p src to @p dst in a robust way
* when a copy is available.
* @ingroup mcuxClMemory
* @{
*/
#ifndef MCUXCLMEMORY_COPYWORDS_INTERNAL_H_
#define MCUXCLMEMORY_COPYWORDS_INTERNAL_H_
#include <mcuxClConfig.h> // Exported features flags header
#include <mcuxClCore_Platform.h>
#include <mcuxClMemory_Constants.h>
#include <mcuxClMemory_Types.h>
#include <mcuxClToolchain.h>
#include <mcuxCsslAnalysis.h>
#include <mcuxCsslFlowProtection.h>
#include <mcuxClMemory_Copy.h>
#include <internal/mcuxClMemory_Copy_Internal.h>
#ifdef __cplusplus
extern "C" {
#endif
/**********************************************
* FUNCTIONS
**********************************************/
/**
* Copies a memory buffer to another location with security against fault only.
*
* The two buffers must not overlap and with length being a multiple of 4.
*
* * Data Integrity: Record(pSrc + pDst + length)
*
* @param[out] pDst pointer to the buffer to be copied to.
* @param[in] pSrc pointer to the buffer to copy.
* @param[in] length size (in bytes) to be copied.
*
* @return A status code encapsulated in a flow-protection type.
* @retval #MCUXCLMEMORY_STATUS_OK If @p length bytes copied at @p pDst.
* @retval #MCUXCLMEMORY_STATUS_FAULT
*/
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClMemory_copy_words_int)
static inline MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClMemory_Status_t) mcuxClMemory_copy_words_int
(
uint8_t * pDst,
uint8_t const * pSrc,
uint32_t length
)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClMemory_copy_words_int);
MCUX_CSSL_FP_FUNCTION_CALL(retval, mcuxClMemory_copy_int(pDst, pSrc, length));
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClMemory_copy_words_int, retval, MCUX_CSSL_FP_FUNCTION_CALLED(mcuxClMemory_copy_int));
}
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* MCUXCLMEMORY_COPYWORDS_INTERNAL_H_ */
/**
* @}
*/
@@ -0,0 +1,89 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2020-2021, 2023 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/** @file mcuxClMemory_Copy_Internal.h
* @brief Internal memory header for copy functions.
* This header exposes functions that enable using memory copy function.
*/
/**
* @defgroup mcuxClMemory_Copy_Internal mcuxClMemory_Copy_Internal
* @brief This function copies a memory region from @p src to @p dst.
* @ingroup mcuxClMemory
* @{
*/
#ifndef MCUXCLMEMORY_COPY_INTERNAL_H_
#define MCUXCLMEMORY_COPY_INTERNAL_H_
#include <mcuxClConfig.h> // Exported features flags header
#include <mcuxClCore_Platform.h>
#include <mcuxClMemory_Constants.h>
#include <mcuxClMemory_Types.h>
#include <mcuxClToolchain.h>
#include <mcuxCsslFlowProtection.h>
#include <mcuxCsslDataIntegrity.h>
#include <mcuxClMemory_Copy.h>
#ifdef __cplusplus
extern "C" {
#endif
/**********************************************
* FUNCTIONS
**********************************************/
/**
* Copies a memory buffer to another location with security against fault.
*
* The two buffers must not overlap.
*
* * Data Integrity: Record(pSrc + pDst + length)
*
* @param[out] pDst pointer to the buffer to be copied to.
* @param[in] pSrc pointer to the buffer to copy.
* @param[in] length size (in bytes) to be copied.
*
* @return A status code encapsulated in a flow-protection type.
* @retval #MCUXCLMEMORY_STATUS_OK If @p length bytes copied at @p pDst.
* @retval #MCUXCLMEMORY_STATUS_FAULT
*/
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClMemory_copy_int)
static inline MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClMemory_Status_t) mcuxClMemory_copy_int
(
uint8_t * pDst,
uint8_t const * pSrc,
uint32_t length
)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClMemory_copy_int);
mcuxClMemory_Status_t retval = MCUXCLMEMORY_STATUS_FAULT;
MCUX_CSSL_FP_FUNCTION_CALL_VOID(mcuxClMemory_copy(pDst, pSrc, length, length));
MCUX_CSSL_DI_RECORD(identifier /* Not used */, (uint32_t) pSrc + (uint32_t) pDst + length); // Balance the SC
retval = MCUXCLMEMORY_STATUS_OK;
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClMemory_copy_int, retval, MCUX_CSSL_FP_FUNCTION_CALLED(mcuxClMemory_copy));
}
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* MCUXCLMEMORY_COPY_INTERNAL_H_ */
/**
* @}
*/
@@ -0,0 +1,88 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2023 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/** @file mcuxClMemory_Copy_Reversed_Internal.h
* @brief Memory header for copy functions.
* This header exposes functions that enable secure memory copy function.
*/
/**
* @defgroup mcuxClMemory_Copy_Reversed_Internal mcuxClMemory_Copy_Reversed_Internal
* @brief This function securely copies a memory region from @p src to @p dst when a secure copy is available.
* @ingroup mcuxClMemory
* @{
*/
#ifndef MCUXCLMEMORY_COPY_REVERSED_INTERNAL_H_
#define MCUXCLMEMORY_COPY_REVERSED_INTERNAL_H_
#include <mcuxClConfig.h> // Exported features flags header
#include <mcuxClCore_Platform.h>
#include <mcuxClMemory_Constants.h>
#include <mcuxClMemory_Types.h>
#include <mcuxClToolchain.h>
#include <mcuxCsslFlowProtection.h>
#include <mcuxCsslDataIntegrity.h>
#include <mcuxClMemory_Copy_Reversed.h>
#ifdef __cplusplus
extern "C" {
#endif
/**********************************************
* FUNCTIONS
**********************************************/
/**
* Copies a memory buffer to another location with security against fault.
*
* The two buffers must not overlap.
*
* * Data Integrity: Record(pSrc + pDst + length)
*
* @param[out] pDst pointer to the buffer to be copied to.
* @param[in] pSrc pointer to the buffer to copy.
* @param[in] length size (in bytes) to be copied.
*
* @return A status code encapsulated in a flow-protection type.
* @retval #MCUXCLMEMORY_STATUS_OK If @p length bytes copied at @p pDst.
* @retval #MCUXCLMEMORY_STATUS_FAULT
*/
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClMemory_copy_reversed_int)
static inline MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClMemory_Status_t) mcuxClMemory_copy_reversed_int
(
uint8_t * pDst,
uint8_t const * pSrc,
uint32_t length
)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClMemory_copy_int);
mcuxClMemory_Status_t retval = MCUXCLMEMORY_STATUS_FAULT;
MCUX_CSSL_FP_FUNCTION_CALL_VOID(mcuxClMemory_copy_reversed(pDst, pSrc, length, length));
MCUX_CSSL_DI_RECORD(identifier /* Not used */, (uint32_t) pSrc + (uint32_t) pDst + length); // Balance the SC
retval = MCUXCLMEMORY_STATUS_OK;
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClMemory_copy_int, retval, MCUX_CSSL_FP_FUNCTION_CALLED(mcuxClMemory_copy_reversed));
}
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* MCUXCLMEMORY_COPY_REVERSED_INTERNAL_H_ */
/**
* @}
*/
@@ -0,0 +1,43 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2020-2021, 2023 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/**
* @file mcuxClMemory_Internal.h
* @brief Top-level include file for the internal memory operations.
*/
#ifndef MCUXCLMEMORY_INTERNAL_H
#define MCUXCLMEMORY_INTERNAL_H
#include <mcuxClConfig.h> // Exported features flags header
#include <mcuxCsslFlowProtection.h>
#include <mcuxClCore_FunctionIdentifiers.h>
#include <mcuxClMemory_Constants.h>
#include <mcuxClMemory_Types.h>
#include <internal/mcuxClMemory_Clear_Internal.h>
#include <internal/mcuxClMemory_Compare_Internal.h>
#include <internal/mcuxClMemory_Copy_Internal.h>
#include <internal/mcuxClMemory_Set_Internal.h>
#include <internal/mcuxClMemory_Copy_Reversed_Internal.h>
#include <internal/mcuxClMemory_CopyWords_Internal.h>
#include <internal/mcuxClMemory_ClearSecure_Internal.h>
#include <internal/mcuxClMemory_CompareDPASecure_Internal.h>
#include <internal/mcuxClMemory_CompareSecure_Internal.h>
#include <internal/mcuxClMemory_CopySecure_Internal.h>
#include <internal/mcuxClMemory_SetSecure_Internal.h>
#include <internal/mcuxClMemory_CopySecure_Reversed_Internal.h>
#include <internal/mcuxClMemory_CopySecurePow2_Internal.h>
#endif /* MCUXCLMEMORY_INTERNAL_H */
@@ -0,0 +1,87 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2023 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/** @file mcuxClMemory_SetSecure_Internal.h
* @brief Memory header for set functions.
* This header exposes functions that enable secure memory set function.
*/
/**
* @defgroup mcuxClMemory_Set_Secure_Internal mcuxClMemory_Set_Secure_Internal
* @brief This function sets all bytes in a memory region to a specified value in a secure way
* when a secure set is available.
* @ingroup mcuxClMemory
* @{
*/
#ifndef MCUXCLMEMORY_SETSECURE_INTERNAL_H_
#define MCUXCLMEMORY_SETSECURE_INTERNAL_H_
#include <mcuxClConfig.h> // Exported features flags header
#include <mcuxClCore_Platform.h>
#include <mcuxClMemory_Constants.h>
#include <mcuxClMemory_Types.h>
#include <mcuxClToolchain.h>
#include <mcuxCsslAnalysis.h>
#include <mcuxCsslFlowProtection.h>
#include <internal/mcuxClMemory_Set_Internal.h>
#ifdef __cplusplus
extern "C" {
#endif
/**********************************************
* FUNCTIONS
**********************************************/
/**
* Sets all bytes of a memory buffer to a specified value.
*
* The two buffers must not overlap.
*
* * Data Integrity: Record(pDst + length)
*
* @param[out] pDst pointer to the buffer to be set.
* @param[in] val byte value to be set.
* @param[in] length size (in bytes) to be set.
*
* @return A status code encapsulated in a flow-protection type.
* @retval #MCUXCLMEMORY_STATUS_OK If @p length bytes copied at @p pDst.
* @retval #MCUXCLMEMORY_STATUS_FAULT
*/
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClMemory_set_secure_int)
static inline MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClMemory_Status_t) mcuxClMemory_set_secure_int
(
uint8_t * pDst,
uint8_t val,
uint32_t length
)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClMemory_set_secure_int);
MCUX_CSSL_FP_FUNCTION_CALL(retval, mcuxClMemory_set_int(pDst, val, length));
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClMemory_set_secure_int, retval, MCUX_CSSL_FP_FUNCTION_CALLED(mcuxClMemory_set_int));
}
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* MCUXCLMEMORY_SETSECURE_INTERNAL_H_ */
/**
* @}
*/
@@ -0,0 +1,94 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2020-2021, 2023 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/** @file mcuxClMemory_Set_Internal.h
* @brief Memory header for set function.
* This header exposes functions that enable using memory set functions.
*/
/**
* @defgroup mcuxClMemory_Set_Internal mcuxClMemory_Set_Internal
* @brief This function sets all bytes in a memory region to a specified value.
* @ingroup mcuxClMemory
* @{
*/
#ifndef MCUXCLMEMORY_SET_INTERNAL_H_
#define MCUXCLMEMORY_SET_INTERNAL_H_
#include <mcuxClConfig.h> // Exported features flags header
#include <mcuxClCore_Platform.h>
#include <mcuxClMemory_Constants.h>
#include <mcuxClMemory_Types.h>
#include <mcuxClToolchain.h>
#include <mcuxCsslAnalysis.h>
#include <mcuxCsslFlowProtection.h>
#include <mcuxCsslDataIntegrity.h>
#include <mcuxCsslMemory.h>
#ifdef __cplusplus
extern "C" {
#endif
/**********************************************
* FUNCTIONS
**********************************************/
/**
* Sets all bytes of a memory buffer to a specified value.
*
* The two buffers must not overlap.
*
* * Data Integrity: Record(pDst + length)
*
* @param[out] pDst pointer to the buffer to be set.
* @param[in] val byte value to be set.
* @param[in] length size (in bytes) to be set.
*
* @return A status code encapsulated in a flow-protection type.
* @retval #MCUXCLMEMORY_STATUS_OK If @p length bytes copied at @p pDst.
* @retval #MCUXCLMEMORY_STATUS_FAULT
*/
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClMemory_set_int)
static inline MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClMemory_Status_t) mcuxClMemory_set_int
(
uint8_t * pDst,
uint8_t val,
uint32_t length
)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClMemory_set_int);
mcuxClMemory_Status_t retval = MCUXCLMEMORY_STATUS_FAULT;
MCUX_CSSL_FP_FUNCTION_CALL(csslRetval, mcuxCsslMemory_Set(
mcuxCsslParamIntegrity_Protect(4u, pDst, val, length, length),
pDst, val, length, length
));
retval = (mcuxClMemory_Status_t) csslRetval ^ (MCUXCSSLMEMORY_COMPONENT_MASK ^ MCUXCLMEMORY_COMPONENT_MASK);
MCUX_CSSL_DI_RECORD(identifier /* Not used */, (uint32_t) pDst + length); // Unbalance the SC
MCUX_CSSL_FP_FUNCTION_EXIT(mcuxClMemory_set_int, retval, MCUX_CSSL_FP_FUNCTION_CALLED(mcuxCsslMemory_Set));
}
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* MCUXCLMEMORY_SET_INTERNAL_H_ */
/**
* @}
*/
@@ -0,0 +1,44 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2020-2021, 2023 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/**
* @file mcuxClMemory.h
* @brief Top-level include file for the memory operations.
*
* @defgroup mcuxClMemory mcuxClMemory
* @brief Basic memory operations
*
* This component provides memory functions similar to the ones found in the C standard library.
*
* @{
*/
#ifndef MCUXCLMEMORY_H
#define MCUXCLMEMORY_H
#include <mcuxClConfig.h> // Exported features flags header
#include <mcuxCsslFlowProtection.h>
#include <mcuxClCore_FunctionIdentifiers.h>
#include <mcuxClMemory_Constants.h>
#include <mcuxClMemory_Types.h>
#include <mcuxClMemory_Endianness.h>
#include <mcuxClMemory_Clear.h>
#include <mcuxClMemory_Copy.h>
#include <mcuxClMemory_Copy_Reversed.h>
#include <mcuxClMemory_Set.h>
#include <mcuxClMemory_Xor.h>
/**
* @}
*/
#endif
@@ -0,0 +1,80 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2020-2021, 2023 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/** @file mcuxClMemory_Clear.h
* @brief Memory header for clear functions.
* This header exposes functions that enable using memory clear function.
*/
/**
* @defgroup mcuxClMemory_Clear mcuxClMemory_Clear
* @brief This function clears a memory region.
* @ingroup mcuxClMemory
* @{
*/
#ifndef MCUXCLMEMORY_CLEAR_H_
#define MCUXCLMEMORY_CLEAR_H_
#include <mcuxClConfig.h> // Exported features flags header
#include <mcuxClMemory_Types.h>
#include <mcuxCsslAnalysis.h>
#ifdef __cplusplus
extern "C" {
#endif
/**********************************************
* FUNCTIONS
**********************************************/
/**
* Overwrites a memory buffer with null bytes.
*
* If the destination buffer is too small, i.e. if bufLength < length,
* (length-bufLength) is added to the Flow Protection token (see @ref mcuxCsslFlowProtection).
*
* @param[out] pDst Pointer to the buffer to be cleared.
* @param[in] length size (in bytes) to be cleared.
* @param[in] bufLength buffer size (if bufLength < length, only bufLength bytes are cleared).
*
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClMemory_clear)
MCUX_CSSL_FP_PROTECTED_TYPE(void) mcuxClMemory_clear (uint8_t *pDst, size_t length, size_t bufLength);
/**********************************************
* MACROS
**********************************************/
/** Helper macro to call #mcuxClMemory_clear with flow protection. */
#define MCUXCLMEMORY_FP_MEMORY_CLEAR(pTarget, byteLen) \
MCUX_CSSL_FP_FUNCTION_CALL_VOID(mcuxClMemory_clear((uint8_t *) (pTarget), byteLen, byteLen))
/** Helper macro to call #mcuxClMemory_clear with flow protection with buffer. */
#define MCUXCLMEMORY_FP_MEMORY_CLEAR_WITH_BUFF(pTarget, byteLen, buffLen) \
MCUX_CSSL_FP_FUNCTION_CALL_VOID(mcuxClMemory_clear((uint8_t *) (pTarget), byteLen, buffLen))
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* MCUXCLMEMORY_CLEAR_H_ */
/**
* @}
*/
@@ -0,0 +1,57 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2023 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/** @file mcuxClMemory_Constants.h
* @brief Memory constant header.
* This header exposes constants used by the @ref mcuxClMemory functions. */
/**
* @defgroup mcuxClMemory_Constants mcuxClMemory_Constants
* @brief Defines all constants used by the @ref mcuxClMemory functions.
* @ingroup mcuxClMemory
* @{
*/
#ifndef MCUXCLMEMORY_CONSTANTS_H
#define MCUXCLMEMORY_CONSTANTS_H
/**********************************************
* CONSTANTS
**********************************************/
#define MCUXCLMEMORY_COMPONENT_MASK 0x09990000u ///< Component mask value
/**
* @defgroup MCUXCLMEMORY_STATUS_ MCUXCLMEMORY_STATUS_
* @brief Defines valid mcuxClMemory function return codes
* @ingroup mcuxClMemory_Types_Macros
* @{
*/
#define MCUXCLMEMORY_STATUS_OK ((mcuxClMemory_Status_t) 0x09992E03u) ///< Memory operation successful
#define MCUXCLMEMORY_STATUS_EQUAL ((mcuxClMemory_Status_t) 0x09992E47u) ///< The two contents of the Memory Compare are equal
#define MCUXCLMEMORY_STATUS_NOT_EQUAL ((mcuxClMemory_Status_t) 0x099989B8u) ///< The two contents of the Memory Compare are not equal
#define MCUXCLMEMORY_STATUS_INVALID_PARAMETER ((mcuxClMemory_Status_t) 0x0999533Cu) ///< A parameter was invalid
#define MCUXCLMEMORY_STATUS_FAULT ((mcuxClMemory_Status_t) 0x0999F0F0u) ///< A fault occurred in the execution
/**
* @}
*/
#define MCUXCLMEMORY_ERRORCODE_OK MCUXCLMEMORY_STATUS_OK ///< Memory operation successful
///< @deprecated Please use #MCUXCLMEMORY_STATUS_OK instead
#endif /* MCUXCLMEMORY_CONSTANTS_H */
/**
* @}
*/
@@ -0,0 +1,82 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2020-2021, 2023 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/** @file mcuxClMemory_Copy.h
* @brief Memory header for copy functions.
* This header exposes functions that enable using memory copy function.
*/
/**
* @defgroup mcuxClMemory_Copy mcuxClMemory_Copy
* @brief This function copies a memory region from @p src to @p dst.
* @ingroup mcuxClMemory
* @{
*/
#ifndef MCUXCLMEMORY_COPY_H_
#define MCUXCLMEMORY_COPY_H_
#include <mcuxClConfig.h> // Exported features flags header
#include <mcuxClMemory_Types.h>
#include <mcuxCsslAnalysis.h>
#ifdef __cplusplus
extern "C" {
#endif
/**********************************************
* FUNCTIONS
**********************************************/
/**
* Copies a memory buffer to another location.
*
* The two buffers must not overlap.
*
* If the destination buffer is too small, i.e. if bufLength < length,
* (length-bufLength) is added to the Flow Protection token (see @ref mcuxCsslFlowProtection).
*
* @param[out] pDst pointer to the buffer to be copied to.
* @param[in] pSrc pointer to the buffer to copy.
* @param[in] length size (in bytes) to be copied.
* @param[in] bufLength buffer size (if bufLength < length, only bufLength bytes are copied).
*
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClMemory_copy)
MCUX_CSSL_FP_PROTECTED_TYPE(void) mcuxClMemory_copy (uint8_t *pDst, uint8_t const *pSrc, size_t length, size_t bufLength);
/**********************************************
* MACROS
**********************************************/
/** Helper macro to call #mcuxClMemory_copy with flow protection. */
#define MCUXCLMEMORY_FP_MEMORY_COPY(pTarget, pSource, byteLen) \
MCUX_CSSL_FP_FUNCTION_CALL_VOID(mcuxClMemory_copy((uint8_t *) (pTarget), (const uint8_t *) (pSource), byteLen, byteLen))
/** Helper macro to call #mcuxClMemory_copy with flow protection with buffer. */
#define MCUXCLMEMORY_FP_MEMORY_COPY_WITH_BUFF(pTarget, pSource, byteLen, buffLen) \
MCUX_CSSL_FP_FUNCTION_CALL_VOID(mcuxClMemory_copy((uint8_t *) (pTarget), (const uint8_t *) (pSource), byteLen, buffLen))
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* MCUXCLMEMORY_COPY_H_ */
/**
* @}
*/
@@ -0,0 +1,74 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2023 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/** @file mcuxClMemory_Copy_Reversed.h
* @brief Memory header for reversed copy functions.
* This header exposes functions that enable using memory reversed copy function.
*/
/**
* @defgroup mcuxClMemory_Copy_Reversed mcuxClMemory_Copy_Reversed
* @brief This function copies a memory region from @p src to @p dst reversely.
* @ingroup mcuxClMemory
* @{
*/
#ifndef MCUXCLMEMORY_COPY_REVERSED_H_
#define MCUXCLMEMORY_COPY_REVERSED_H_
#include <mcuxClCore_Platform.h>
#include <mcuxClMemory_Types.h>
#include <mcuxCsslAnalysis.h>
#ifdef __cplusplus
extern "C" {
#endif
/**********************************************
* FUNCTIONS
**********************************************/
/**
* Copies a memory buffer to another location reversely.
*
* If the destination buffer is too small, i.e. if bufLength < length,
* then only bufLength bytes are copied reversely.
*
* @param[out] pDst pointer to the buffer to be copied to.
* @param[in] pSrc pointer to the buffer to copy.
* @param[in] length size (in bytes) to be copied.
* @param[in] bufLength buffer size (if bufLength < length, only bufLength bytes are copied reversely).
*
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClMemory_copy_reversed)
MCUX_CSSL_FP_PROTECTED_TYPE(void) mcuxClMemory_copy_reversed (uint8_t *pDst, uint8_t const *pSrc, size_t length, size_t bufLength);
/**********************************************
* MACROS
**********************************************/
/** Helper macro to call #mcuxClMemory_copy_reversed with flow protection. */
#define MCUXCLMEMORY_FP_MEMORY_COPY_REVERSED(pTarget, pSource, byteLen) \
MCUX_CSSL_FP_FUNCTION_CALL_VOID(mcuxClMemory_copy_reversed((uint8_t *) (pTarget), (const uint8_t *) (pSource), byteLen, byteLen))
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* MCUXCLMEMORY_COPY_REVERSED_H_ */
/**
* @}
*/
@@ -0,0 +1,118 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2020-2021 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/** @file mcuxClMemory_Endianness.h
* @brief Memory header for endianness support functions.
* This header exposes macros that enable using endianness support functions.
*/
/**
* @defgroup mcuxClMemory_Endianness mcuxClMemory_Endianness
* @brief These macros implement endianess management on integers
* @ingroup mcuxClMemory
* @{
*/
#ifndef MCUXCLMEMORY_ENDIANNESS_H_
#define MCUXCLMEMORY_ENDIANNESS_H_
#include <mcuxClMemory_Types.h>
#include <mcuxClConfig.h> // Exported features flags header
/**********************************************
* MACROS
**********************************************/
/**
* @brief Converts a 32-bit unsigned integer to a little-endian order @c uint8_t array .
*
* @note Implementation is platform independent.
*
* @param[out] destination pointer to a 4 byte buffer were 32-bit integer in little-endian will be encoded.
* @param[in] value pointer to the 32-bit integer to be encoded.
*
*/
#define mcuxClMemory_StoreLittleEndian32( destination, value ) \
do \
{ \
uint32_t local_value = (uint32_t)(value); \
((uint8_t*)(destination))[0] = (uint8_t) (((local_value) & 0x000000FFU) >> 0u);\
((uint8_t*)(destination))[1] = (uint8_t) (((local_value) & 0x0000FF00U) >> 8u);\
((uint8_t*)(destination))[2] = (uint8_t) (((local_value) & 0x00FF0000U) >> 16u);\
((uint8_t*)(destination))[3] = (uint8_t) (((local_value) & 0xFF000000U) >> 24u);\
} while (false)
/**
* @brief Converts a 32-bit unsigned integer to a big-endian order @c uint8_t array.
*
* @note Implementation is platform independent.
*
* @param[in] source pointer to a 4 byte big-endian order @c uint8_t buffer that will be converted to an unsigned integer
*
*/
#define mcuxClMemory_StoreBigEndian32( destination, value ) \
do \
{ \
uint32_t local_value = (uint32_t)(value); \
((uint8_t*)(destination))[0] = (uint8_t) (((local_value) & 0xFF000000U) >> 24u);\
((uint8_t*)(destination))[1] = (uint8_t) (((local_value) & 0x00FF0000U) >> 16u);\
((uint8_t*)(destination))[2] = (uint8_t) (((local_value) & 0x0000FF00U) >> 8u);\
((uint8_t*)(destination))[3] = (uint8_t) (((local_value) & 0x000000FFU) >> 0u);\
} while (false)
/**
* @brief Converts a little-endian order @c uint8_t array to a 32-bit unsigned integer.
*
* @note Implementation is platform independent.
*
* @param[in] source pointer to a 4 byte little-endian order @c uint8_t buffer that will be converted to an unsigned integer
*
*/
#define mcuxClMemory_LoadLittleEndian32( source ) \
( (((uint32_t) ((const uint8_t*)(source))[0]) << 0u) | \
(((uint32_t) ((const uint8_t*)(source))[1]) << 8u) | \
(((uint32_t) ((const uint8_t*)(source))[2]) << 16u) | \
(((uint32_t) ((const uint8_t*)(source))[3]) << 24u) )
/**
* @brief Converts a big-endian order @c uint8_t array to a 32-bit unsigned integer.
*
* @param[in] destination pointer to a 4 byte buffer were 32-bit integer in big-endian will be decoded.
*
* @return a 32-bit unsigned integer
*/
#define mcuxClMemory_LoadBigEndian32( source ) \
( (((uint32_t) ((const uint8_t*)(source))[0]) << 24u) | \
(((uint32_t) ((const uint8_t*)(source))[1]) << 16u) | \
(((uint32_t) ((const uint8_t*)(source))[2]) << 8u) | \
(((uint32_t) ((const uint8_t*)(source))[3]) << 0u) )
/**
* @brief MACRO that switches byte endianness of given CPU word.
*
* @param[in] input a 32-bit unsigned integer whose endianness will be reversed.
*
*/
#ifdef __REV
#define MCUXCLMEMORY_SWITCH_4BYTE_ENDIANNESS(input) __REV(input)
#else
#define MCUXCLMEMORY_SWITCH_4BYTE_ENDIANNESS(input) ((((input) & 0xffu) << 24u) | (((input) & 0xff00u) << 8u) | (((input) & 0xff0000u) >> 8u) | (((input) & 0xff000000u) >> 24u))
#endif
#endif /* MCUXCLMEMORY_ENDIANNESS_H_ */
/**
* @}
*/
@@ -0,0 +1,77 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2020-2021, 2023 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/** @file mcuxClMemory_Set.h
* @brief Memory header for set function.
* This header exposes functions that enable using memory set functions.
*/
/**
* @defgroup mcuxClMemory_Set mcuxClMemory_Set
* @brief This function sets all bytes in a memory region to a specified value.
* @ingroup mcuxClMemory
* @{
*/
#ifndef MCUXCLMEMORY_SET_H_
#define MCUXCLMEMORY_SET_H_
#include <mcuxClConfig.h> // Exported features flags header
#include <mcuxClMemory_Types.h>
#include <mcuxCsslAnalysis.h>
#ifdef __cplusplus
extern "C" {
#endif
/**********************************************
* FUNCTIONS
**********************************************/
/**
* Sets all bytes of a memory buffer to a specified value.
*
* If the destination buffer is too small, i.e. if bufLength < length,
* (length-bufLength) is added to the Flow Protection token (see @ref mcuxCsslFlowProtection).
*
* @param[out] pDst pointer to the buffer to be set.
* @param[in] val byte value to be set.
* @param[in] length size (in bytes) to be set.
* @param[in] bufLength buffer size (if bufLength < length, only bufLength bytes are set).
*
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClMemory_set)
MCUX_CSSL_FP_PROTECTED_TYPE(void) mcuxClMemory_set (uint8_t *pDst, uint8_t val, size_t length, size_t bufLength);
/**********************************************
* MACROS
**********************************************/
/** Helper macro to call #mcuxClMemory_set with flow protection. */
#define MCUXCLMEMORY_FP_MEMORY_SET(pTarget, val, byteLen) \
MCUX_CSSL_FP_FUNCTION_CALL_VOID(mcuxClMemory_set((uint8_t *) (pTarget), val, byteLen, byteLen))
/** Helper macro to call #mcuxClMemory_set with flow protection with buffer. */
#define MCUXCLMEMORY_FP_MEMORY_SET_WITH_BUFF(pTarget, val, byteLen, buffLen) \
MCUX_CSSL_FP_FUNCTION_CALL_VOID(mcuxClMemory_set((uint8_t *) (pTarget), val, byteLen, buffLen))
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* MCUXCLMEMORY_SET_H_ */
/**
* @}
*/
@@ -0,0 +1,68 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2020-2021, 2023 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/** @file mcuxClMemory_Types.h
* @brief Memory type header.
* This header exposes types used by the @ref mcuxClMemory functions. */
/**
* @defgroup mcuxClMemory_Types mcuxClMemory_Types
* @brief Defines all types used by the @ref mcuxClMemory functions.
* @ingroup mcuxClMemory
* @{
*/
#ifndef MCUXCLMEMORY_TYPES_H
#define MCUXCLMEMORY_TYPES_H
#include <stdint.h>
#include <stddef.h>
#include <mcuxClConfig.h> // Exported features flags header
#include <mcuxCsslFlowProtection.h>
#include <mcuxClCore_FunctionIdentifiers.h>
/**********************************************
* MACROS
**********************************************/
/**
* @defgroup mcuxClMemory_Types_Macros mcuxClMemory_Types_Macros
* @brief Defines all macros of @ref mcuxClMemory_Types
* @ingroup mcuxClMemory_Types
* @{
*/
#define MCUXCLMEMORY_API extern ///< Marks a function as a public API function of the mcuxClMemory component
/**
* @}
*/
/**********************************************
* TYPEDEFS
**********************************************/
/**
* @brief Type for error codes of mcuxClMemory component functions.
*
* Type returned by mcuxClMemory functions. See @ref MCUXCLMEMORY_STATUS_ for possible options.
*/
typedef uint32_t mcuxClMemory_Status_t;
/**
* @brief Deprecated type for error codes used by code-flow protected mcuxClMemory component functions.
*/
typedef MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClMemory_Status_t) mcuxClMemory_Status_Protected_t;
#endif /* #MCUXCLMEMORY_TYPES_H */
/**
* @}
*/
@@ -0,0 +1,81 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2023-2024 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/** @file mcuxClMemory_Xor.h
* @brief Memory header for xor functions.
* This header exposes functions that enable using memory xor function.
*/
/**
* @defgroup mcuxClMemory_xor mcuxClMemory_xor
* @brief This function performs xor between @p src1 and @p src2, and saves result to @p dst.
* @ingroup mcuxClMemory
* @{
*/
#ifndef MCUXCLMEMORY_XOR_H_
#define MCUXCLMEMORY_XOR_H_
#include <mcuxClConfig.h> // Exported features flags header
#include <mcuxClMemory_Types.h>
#include <mcuxCsslAnalysis.h>
#ifdef __cplusplus
extern "C" {
#endif
/**********************************************
* FUNCTIONS
**********************************************/
/**
* Perform xor for 2 memory buffers.
*
* Operation in place is allowed - one of the input buffer can also be the output buffer.
*
*
* @param[out] pDst pointer to the destination buffer.
* @param[in] pSrc1 pointer to the first source buffer.
* @param[in] pSrc2 pointer to the second source buffer.
* @param[in] length size (in bytes) to be operated
* @param[in] bufLength buffer size (if bufLength < length, only bufLength bytes are operated).
*
*/
MCUX_CSSL_FP_FUNCTION_DECL(mcuxClMemory_xor)
MCUX_CSSL_FP_PROTECTED_TYPE(void) mcuxClMemory_xor(uint8_t *pDst, const uint8_t *pSrc1, const uint8_t *pSrc2, uint32_t length, size_t bufLength);
/**********************************************
* MACROS
**********************************************/
/** Helper macro to call #mcuxClMemory_xor with flow protection. */
#define MCUXCLMEMORY_FP_MEMORY_XOR(pDst, pSrc1, pSrc2, length) \
MCUX_CSSL_FP_FUNCTION_CALL_VOID(mcuxClMemory_xor(pDst, pSrc1, pSrc2, length, length))
/** Helper macro to call #mcuxClMemory_xor with flow protection with buffer. */
#define MCUXCLMEMORY_FP_MEMORY_XOR_WITH_BUFF(pDst, pSrc1, pSrc2, length, bufLen) \
MCUX_CSSL_FP_FUNCTION_CALL_VOID(mcuxClMemory_xor(pDst, pSrc1, pSrc2, length, bufLen))
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* MCUXCLMEMORY_XOR_H_ */
/**
* @}
*/
@@ -0,0 +1,452 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2020-2021, 2023-2024 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
#include <mcuxClMemory.h>
#include <mcuxCsslFlowProtection.h>
#include <mcuxClCore_FunctionIdentifiers.h>
#include <mcuxClToolchain.h>
#include <mcuxCsslAnalysis.h>
#define WORDSIZE (sizeof(uint32_t))
/**
* [DESIGN]
*
* This function considers the following cases of alignment of source and
* destination addresses and length:
*
* Src Addr. | Des Addr. | Length |
* ----------+-----------+-----------+-------------------------------
* aligned | aligned | aligned | Case A: read word, write word
* ----------+-----------+-----------+-------------------------------
* aligned | unaligned | aligned | Case B: read word, write byte
* ----------+-----------+-----------+-------------------------------
* unaligned | aligned | aligned | Case C: read byte, write word
* ----------+-----------+-----------+-------------------------------
* unaligned | unaligned | aligned | Case D: read byte,
* any | any | unaligned | write byte-word-byte
*
* Since SFR address and length shall be aligned,
* Cases A and B cover the usecases of SFR reading; and
* Cases A and C cover the useceses of SFR writing.
*
* If length > bufLength, and bufLength is not aligned, in cases A and B,
* the word containing last byte(s) is read in word, and last byte(s) is written byte-wisely.
* Ps, since length is aligned, last word in source shall be in valid address range.
*
* Case C is a special case of Case D, because the byte-wisely writing will be ignored.
*/
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClMemory_copy)
MCUX_CSSL_FP_PROTECTED_TYPE(void) mcuxClMemory_copy (uint8_t *pDst, uint8_t const *pSrc, size_t length, size_t bufLength)
{
/* This function assumes caller providing valid addresses and length. */
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClMemory_copy);
MCUX_CSSL_FP_LOOP_DECL(mcuxClMemory_copy_loop);
uint8_t *pDstX = pDst;
const uint8_t *pSrcX = pSrc;
uint32_t copiedLength = 0u;
MCUX_CSSL_ANALYSIS_START_SUPPRESS_TYPECAST_BETWEEN_INTEGER_AND_POINTER("casting pointer to integer to check alignment.");
const uint32_t srcAddress = (uint32_t) pSrc;
const uint32_t dstAddress = (uint32_t) pDst;
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_TYPECAST_BETWEEN_INTEGER_AND_POINTER();
const uint32_t srcAddrOrLength = srcAddress | length;
if (0u == (srcAddrOrLength % WORDSIZE)) /* source address and length are both aligned. */
{
uint32_t temp = 0u;
if (0u == (dstAddress % WORDSIZE)) /* destination address is aligned. */
{
/* Case A: copy word-wisely. */
while (((copiedLength + WORDSIZE) <= length) && ((copiedLength + WORDSIZE) <= bufLength))
{
MCUX_CSSL_FP_LOOP_ITERATION(mcuxClMemory_copy_loop);
MCUX_CSSL_ANALYSIS_START_SUPPRESS_INTEGER_OVERFLOW("Caller shall provide valid buffer pSrc[] of length.")
MCUX_CSSL_ANALYSIS_START_SUPPRESS_POINTER_CASTING("source pointer is aligned in Case A.")
temp = *(const uint32_t *) pSrcX;
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_POINTER_CASTING()
pSrcX += WORDSIZE;
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_INTEGER_OVERFLOW()
MCUX_CSSL_FP_LOOP_ITERATION(mcuxClMemory_copy_loop);
copiedLength += WORDSIZE;
MCUX_CSSL_FP_LOOP_ITERATION(mcuxClMemory_copy_loop);
MCUX_CSSL_ANALYSIS_START_SUPPRESS_INTEGER_OVERFLOW("Caller shall provide valid buffer pDst[] of bufLength.")
MCUX_CSSL_ANALYSIS_START_SUPPRESS_POINTER_CASTING("destination pointer is aligned in Case A.")
*(uint32_t *) pDstX = temp;
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_POINTER_CASTING()
pDstX += WORDSIZE;
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_INTEGER_OVERFLOW()
MCUX_CSSL_FP_LOOP_ITERATION(mcuxClMemory_copy_loop);
}
}
/* Case A: remaining byte(s) when (length < bufLength). */
/* Case B: read word-wisely, write byte-wisely. */
while ((copiedLength < length) && (copiedLength < bufLength))
{
if (0u == (copiedLength % WORDSIZE))
{
MCUX_CSSL_ANALYSIS_START_SUPPRESS_INTEGER_OVERFLOW("Caller shall provide valid buffer pSrc[] of length.")
MCUX_CSSL_ANALYSIS_START_SUPPRESS_POINTER_CASTING("source pointer is aligned in Cases A and B.")
temp = *(const uint32_t *) pSrcX;
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_POINTER_CASTING()
pSrcX += WORDSIZE;
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_INTEGER_OVERFLOW()
}
else
{
temp >>= 8u;
}
MCUX_CSSL_FP_LOOP_ITERATION(mcuxClMemory_copy_loop);
MCUX_CSSL_ANALYSIS_START_SUPPRESS_INTEGER_OVERFLOW("Caller shall provide valid buffer pDst[] of bufLength.")
*pDstX = (uint8_t) (temp & 0xFFu);
pDstX++;
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_INTEGER_OVERFLOW()
copiedLength++;
}
}
else
{
/* Cases C & D: read byte-wisely, write (byte-word-byte)-wisely. */
MCUX_CSSL_ANALYSIS_START_SUPPRESS_INTEGER_OVERFLOW("modular arithmetic, mod 4")
const uint32_t unalignedBytes = (0u - dstAddress) % WORDSIZE;
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_INTEGER_OVERFLOW()
// Loop on unaligned bytes if any.
// Loop on words
// Start at first aligned address, increment by 4 bytes. To understand the loop condition, consider without loss of generality a
// byte array b_i of length=4 and bufLength=4.
//
// |0 3|4 4|
// +-------+-------+-------+-------+-------+
// | b_0 | b_1 | b_2 | b_3 | |
// +-------+-------+-------+-------+-------+
//
// In order to determine whether a full word can be copied, check with regard to the copying position i:
// * Starting from i=0, a full word can be copied. i+4 is the first position that is outside of the valid range,
// and it is equal to length.
// Therefore, checking that i+4 <= length and i+4 <= bufLength is a valid condition to check whether a full word can be
// copied.
// Loop on remaining bytes.
//copy unaligned bytes first, if any
for (; (copiedLength < length) && (copiedLength < bufLength) && (copiedLength < unalignedBytes); copiedLength++)
{
MCUX_CSSL_ANALYSIS_START_SUPPRESS_INTEGER_OVERFLOW("Caller shall provide valid buffers pSrc[] of length and pDst[] of bufLength.")
*pDstX = *pSrcX;
pDstX++;
pSrcX++;
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_INTEGER_OVERFLOW()
MCUX_CSSL_FP_LOOP_ITERATION(mcuxClMemory_copy_loop);
}
MCUX_CSSL_ANALYSIS_START_SUPPRESS_POINTER_CASTING("The pointer is CPU word aligned after the byte-loop above.");
uint32_t* p32Dst = (uint32_t *) pDstX;
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_POINTER_CASTING();
//loop on words
for (; ((copiedLength + WORDSIZE) <= length) && ((copiedLength + WORDSIZE) <= bufLength); copiedLength += WORDSIZE)
{
/* Volatile keyword is added to avoid any chance of optimization (i.e. full word read) */
/* The idea is to read byte-wise from SRC to avoid unaligned word reads, but write aligned and word-wise to DST */
MCUX_CSSL_ANALYSIS_START_SUPPRESS_INTEGER_OVERFLOW("Caller shall provide valid buffers pSrc[] of length and pDst[] of bufLength.")
uint32_t crtWordVal = (uint32_t)*(volatile const uint8_t *)pSrcX;
pSrcX++;
MCUX_CSSL_FP_LOOP_ITERATION(mcuxClMemory_copy_loop);
crtWordVal |= (uint32_t)*(volatile const uint8_t *)pSrcX << 8u;
pSrcX++;
MCUX_CSSL_FP_LOOP_ITERATION(mcuxClMemory_copy_loop);
crtWordVal |= (uint32_t)*(volatile const uint8_t *)pSrcX << 16u;
pSrcX++;
MCUX_CSSL_FP_LOOP_ITERATION(mcuxClMemory_copy_loop);
crtWordVal |= (uint32_t)*(volatile const uint8_t *)pSrcX << 24u;
pSrcX++;
MCUX_CSSL_FP_LOOP_ITERATION(mcuxClMemory_copy_loop);
MCUX_CSSL_ANALYSIS_START_SUPPRESS_POINTER_INCOMPATIBLE("The pointer is CPU word aligned after the byte-loop above.");
*p32Dst = crtWordVal;
p32Dst++;
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_POINTER_INCOMPATIBLE();
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_INTEGER_OVERFLOW()
}
pDstX = (uint8_t *) p32Dst;
//loop on remaining bytes
for (; (copiedLength < length) && (copiedLength < bufLength); copiedLength++)
{
MCUX_CSSL_ANALYSIS_START_SUPPRESS_INTEGER_OVERFLOW("Caller shall provide valid buffers pSrc[] of length and pDst[] of bufLength.")
*pDstX = *pSrcX;
pDstX++;
pSrcX++;
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_INTEGER_OVERFLOW()
MCUX_CSSL_FP_LOOP_ITERATION(mcuxClMemory_copy_loop);
}
}
MCUX_CSSL_FP_FUNCTION_EXIT_VOID(mcuxClMemory_copy,
((length <= bufLength) ? length : bufLength) - copiedLength,
MCUX_CSSL_FP_LOOP_ITERATIONS(mcuxClMemory_copy_loop,
((length <= bufLength) ? length : bufLength)) );
}
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClMemory_copy_reversed)
MCUX_CSSL_FP_PROTECTED_TYPE(void) mcuxClMemory_copy_reversed (uint8_t *pDst, uint8_t const *pSrc, size_t length, size_t bufLength)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClMemory_copy_reversed);
uint32_t len = length;
uint32_t diff;
MCUX_CSSL_ANALYSIS_START_SUPPRESS_INTEGER_OVERFLOW("diff is non-negative distance between pSrc and pDst, caculated according to platform architecture.")
if (pDst > pSrc)
{
MCUX_CSSL_ANALYSIS_START_SUPPRESS_TYPECAST_BETWEEN_INTEGER_AND_POINTER("Casting pSrc and pDst to unsigned integer to calculate difference");
MCUX_CSSL_ANALYSIS_START_SUPPRESS_MODIFY_STRING_LITERALS("False positive: The constant string literal pSrc is not being modified");
diff = (uint32_t)pDst - (uint32_t)pSrc;
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_MODIFY_STRING_LITERALS();
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_TYPECAST_BETWEEN_INTEGER_AND_POINTER();
}
else
{
MCUX_CSSL_ANALYSIS_START_SUPPRESS_TYPECAST_BETWEEN_INTEGER_AND_POINTER("Casting pSrc and pDst to unsigned integer to calculate difference");
MCUX_CSSL_ANALYSIS_START_SUPPRESS_MODIFY_STRING_LITERALS("False positive: The constant string literal pSrc is not being modified");
diff = (uint32_t)pSrc - (uint32_t)pDst;
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_MODIFY_STRING_LITERALS();
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_TYPECAST_BETWEEN_INTEGER_AND_POINTER();
}
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_INTEGER_OVERFLOW()
if (bufLength < length)
{
length = bufLength;
len = bufLength;
}
MCUX_CSSL_FP_LOOP_DECL(mcuxClMemory_copy_reversed_loop);
//non-overlap case
if (diff >= length)
{
diff = length;
}
uint8_t *pDstBt;
const uint8_t *pSrcBt;
if (pSrc > pDst)
{
// first copy the non-overlop part
MCUX_CSSL_ANALYSIS_START_SUPPRESS_INTEGER_OVERFLOW("pDstBt will be in the valid range pDst[0 ~ bufLength] and pSrc will be in the valid range pSrc[0 ~ length].")
pSrcBt = pSrc + len - 1U;
pDstBt = (uint8_t *)pDst;
while (len > length - diff)
{
*pDstBt = *pSrcBt;
pDstBt++;
pSrcBt--;
len--;
MCUX_CSSL_FP_LOOP_ITERATION(mcuxClMemory_copy_reversed_loop);
}
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_INTEGER_OVERFLOW()
//then swap the overlap part
MCUX_CSSL_ANALYSIS_START_SUPPRESS_INTEGER_OVERFLOW("pDstBt2 will be in the valid range pDst[0 ~ bufLength].")
uint8_t *pDstBt2 = pDstBt + len - 1u;
while (len > 1U)
{
uint8_t tempByte = *pDstBt2;
*pDstBt2 = *pDstBt;
pDstBt2--;
MCUX_CSSL_FP_LOOP_ITERATION(mcuxClMemory_copy_reversed_loop);
*pDstBt = tempByte;
pDstBt++;
len -= 2U;
MCUX_CSSL_FP_LOOP_ITERATION(mcuxClMemory_copy_reversed_loop);
}
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_INTEGER_OVERFLOW()
}
else
{
// first copy the non-overlop part
MCUX_CSSL_ANALYSIS_START_SUPPRESS_INTEGER_OVERFLOW("pDstBt will be in the valid range pDst[0 ~ bufLength].")
pDstBt = (uint8_t *)pDst + len - 1U;
pSrcBt = pSrc;
while (len > length - diff)
{
*pDstBt = *pSrcBt;
pDstBt--;
pSrcBt++;
len--;
MCUX_CSSL_FP_LOOP_ITERATION(mcuxClMemory_copy_reversed_loop);
}
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_INTEGER_OVERFLOW()
//then swap the overlap part
MCUX_CSSL_ANALYSIS_START_SUPPRESS_INTEGER_OVERFLOW("pDstBt2 will be in the valid range pDst[0 ~ bufLength], pDstBt will be in the valid range pDst[0 ~ bufLength].")
uint8_t *pDstBt2 = pDstBt - len + 1u;
while (len > 1U)
{
uint8_t tempByte = *pDstBt2;
*pDstBt2 = *pDstBt;
pDstBt2++;
MCUX_CSSL_FP_LOOP_ITERATION(mcuxClMemory_copy_reversed_loop);
*pDstBt = tempByte;
pDstBt--;
len -= 2U;
MCUX_CSSL_FP_LOOP_ITERATION(mcuxClMemory_copy_reversed_loop);
}
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_INTEGER_OVERFLOW()
}
/* update SC and return */
MCUX_CSSL_FP_FUNCTION_EXIT_VOID(mcuxClMemory_copy_reversed,
MCUX_CSSL_FP_LOOP_ITERATIONS(mcuxClMemory_copy_reversed_loop, (length - len)));
}
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClMemory_set)
MCUX_CSSL_FP_PROTECTED_TYPE(void) mcuxClMemory_set (uint8_t *pDst, uint8_t val, size_t length, size_t bufLength)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClMemory_set);
MCUX_CSSL_ANALYSIS_COVERITY_START_FALSE_POSITIVE(INTEGER_OVERFLOW, "modular arithmetic, mod 4")
MCUX_CSSL_ANALYSIS_START_SUPPRESS_TYPECAST_BETWEEN_INTEGER_AND_POINTER("casting to unsigned integer to calculate unaligned bytes");
uint32_t unalignedBytes = (0u - (uint32_t)pDst) % (sizeof(uint32_t));
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_TYPECAST_BETWEEN_INTEGER_AND_POINTER();
MCUX_CSSL_ANALYSIS_COVERITY_STOP_FALSE_POSITIVE(INTEGER_OVERFLOW)
MCUX_CSSL_FP_LOOP_DECL(mcuxClMemory_set_loop);
uint32_t wordVal = ((uint32_t)val << 24) | ((uint32_t)val << 16) | ((uint32_t)val << 8) | (uint32_t)val;
//clear unaligned bytes first, if any
size_t i = 0u;
for(i = 0u; (i < length) && (i < bufLength) && (i < unalignedBytes); i++)
{
MCUX_CSSL_ANALYSIS_COVERITY_START_FALSE_POSITIVE(INTEGER_OVERFLOW, "pDst will be in the valid range pDst[0 ~ bufLength].")
*pDst = val;
pDst++;
MCUX_CSSL_FP_LOOP_ITERATION(mcuxClMemory_set_loop);
MCUX_CSSL_ANALYSIS_COVERITY_STOP_FALSE_POSITIVE(INTEGER_OVERFLOW)
}
MCUX_CSSL_ANALYSIS_START_SUPPRESS_POINTER_CASTING("The pointer is CPU word aligned. So, it's safe to cast it to uint32_t*");
uint32_t* p32Dst = (uint32_t *) pDst;
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_POINTER_CASTING();
//loop on words. See mcuxClMemory_copy for an explanation of the condition
while(((i + sizeof(uint32_t)) <= length) && ((i + sizeof(uint32_t)) <= bufLength))
{
MCUX_CSSL_ANALYSIS_COVERITY_START_FALSE_POSITIVE(INTEGER_OVERFLOW, "p32Dst will be in the valid range pDst[0 ~ bufLength] and pSrc will be in the valid range pSrc[0 ~ length].")
MCUX_CSSL_FP_LOOP_ITERATION(mcuxClMemory_set_loop);
MCUX_CSSL_ANALYSIS_START_SUPPRESS_POINTER_INCOMPATIBLE("This assignment never overflows because the pointer p32Dst points to pDst[i] where i <= length - 4");
*p32Dst = wordVal;
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_POINTER_INCOMPATIBLE();
MCUX_CSSL_FP_LOOP_ITERATION(mcuxClMemory_set_loop);
p32Dst++;
MCUX_CSSL_FP_LOOP_ITERATION(mcuxClMemory_set_loop);
i += sizeof(uint32_t);
MCUX_CSSL_FP_LOOP_ITERATION(mcuxClMemory_set_loop);
MCUX_CSSL_ANALYSIS_COVERITY_STOP_FALSE_POSITIVE(INTEGER_OVERFLOW)
}
pDst = (uint8_t *) p32Dst;
//loop on remaining bytes
for(; (i < length) && (i < bufLength); i++)
{
MCUX_CSSL_ANALYSIS_COVERITY_START_FALSE_POSITIVE(INTEGER_OVERFLOW, "pDst will be in the valid range pDst[0 ~ bufLength].")
*pDst = val;
pDst++;
MCUX_CSSL_FP_LOOP_ITERATION(mcuxClMemory_set_loop);
MCUX_CSSL_ANALYSIS_COVERITY_STOP_FALSE_POSITIVE(INTEGER_OVERFLOW)
}
MCUX_CSSL_FP_FUNCTION_EXIT_VOID(mcuxClMemory_set,
((length <= bufLength) ? length : bufLength) - i,
MCUX_CSSL_FP_LOOP_ITERATIONS(mcuxClMemory_set_loop,
((length <= bufLength) ? length : bufLength)));
}
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClMemory_clear)
MCUX_CSSL_FP_PROTECTED_TYPE(void) mcuxClMemory_clear (uint8_t *pDst, size_t length, size_t bufLength)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClMemory_clear, MCUX_CSSL_FP_FUNCTION_CALLED(mcuxClMemory_set));
MCUX_CSSL_FP_FUNCTION_CALL_VOID(mcuxClMemory_set(pDst, 0U, length, bufLength));
MCUX_CSSL_FP_FUNCTION_EXIT_VOID(mcuxClMemory_clear);
}
MCUX_CSSL_FP_FUNCTION_DEF(mcuxClMemory_xor)
MCUX_CSSL_FP_PROTECTED_TYPE(void) mcuxClMemory_xor(uint8_t *pDst, const uint8_t *pSrc1, const uint8_t *pSrc2, uint32_t length, size_t bufLength)
{
MCUX_CSSL_FP_FUNCTION_ENTRY(mcuxClMemory_xor);
uint32_t remainingLen = length;
if (bufLength < remainingLen)
{
remainingLen = bufLength;
}
MCUX_CSSL_FP_LOOP_DECL(mcuxClMemory_xor_loop);
/* xor by word if aligned */
MCUX_CSSL_ANALYSIS_START_SUPPRESS_CAST_TO_VOIDPTR("Typecasting pointer to integer is intentional")
if ((remainingLen >= WORDSIZE) && (0u == ((uint32_t)pDst & (WORDSIZE - 1u)))
&& (0u == ((uint32_t)pSrc1 & (WORDSIZE - 1u)))
&& (0u == ((uint32_t)pSrc2 & (WORDSIZE - 1u))))
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_CAST_TO_VOIDPTR()
{
do
{
MCUX_CSSL_FP_LOOP_ITERATION(mcuxClMemory_xor_loop);
MCUX_CSSL_ANALYSIS_START_SUPPRESS_REINTERPRET_MEMORY("pSrc1, pSrc2 and pDst are word aligned.")
const uint32_t temp1 = *(const uint32_t *)pSrc1;
const uint32_t temp2 = *(const uint32_t *)pSrc2;
*(uint32_t *)pDst = temp1 ^ temp2;
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_REINTERPRET_MEMORY()
MCUX_CSSL_FP_LOOP_ITERATION(mcuxClMemory_xor_loop);
pSrc1 += WORDSIZE;
pSrc2 += WORDSIZE;
pDst += WORDSIZE;
MCUX_CSSL_FP_LOOP_ITERATION(mcuxClMemory_xor_loop);
remainingLen -= WORDSIZE;
MCUX_CSSL_FP_LOOP_ITERATION(mcuxClMemory_xor_loop);
} while (remainingLen >= WORDSIZE);
}
/* xor the remaining bytes */
while (remainingLen > 0u)
{
MCUX_CSSL_ANALYSIS_START_SUPPRESS_INTEGER_OVERFLOW("Caller should set length and bufLength properly to make sure not to overflow.")
const uint8_t temp1 = *pSrc1++;
const uint8_t temp2 = *pSrc2++;
*pDst++ = temp1 ^ temp2;
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_INTEGER_OVERFLOW()
remainingLen--;
MCUX_CSSL_FP_LOOP_ITERATION(mcuxClMemory_xor_loop);
}
MCUX_CSSL_FP_FUNCTION_EXIT_VOID(mcuxClMemory_xor,
MCUX_CSSL_FP_LOOP_ITERATIONS(mcuxClMemory_xor_loop,
((length <= bufLength) ? length : bufLength)));
}
@@ -0,0 +1,694 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2022-2024 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
#ifndef MCUX_CSSL_ANALYSIS_H_
#define MCUX_CSSL_ANALYSIS_H_
#define MCUX_CSSL_ANALYSIS_STR(a) #a
#define MCUX_CSSL_ANALYSIS_EMPTY()
#define MCUX_CSSL_ANALYSIS_DEFER(id) id MCUX_CSSL_ANALYSIS_EMPTY()
#define MCUX_CSSL_ANALYSIS_EXPAND(...) __VA_ARGS__
#define MCUX_CSSL_ANALYSIS_PRAGMA(x) _Pragma(#x)
/* Compiler defines TODO: decide proper placement for those */
#if defined ( __CC_ARM )
/* Arm Compiler 4/5 */
#define MCUX_CSSL_COMPILER_ARMCC
#define MCUX_CSSL_COMPILER_ARM_COMPILER
#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) && (__ARMCC_VERSION < 6100100)
/* Arm Compiler 6.6 LTM (armclang) */
#define MCUX_CSSL_COMPILER_ARMCLANG_LTM
#define MCUX_CSSL_COMPILER_ARM_COMPILER
#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6100100)
/* Arm Compiler above 6.10.1 (armclang) */
#define MCUX_CSSL_COMPILER_ARMCLANG
#define MCUX_CSSL_COMPILER_ARM_COMPILER
#elif defined (_clang_)
#define MCUX_CSSL_COMPILER_ARM_COMPILER /* i.e. Version 6.01 build 0019 */
#endif // defined ( __CC_ARM )
/* Example of common patterns, with either just predefined rationale, or a combination of discards. */
#define MCUX_CSSL_ANALYSIS_START_PATTERN_HW_READ() \
MCUX_CSSL_ANALYSIS_START_SUPPRESS_DISCARD_VOLATILE("Read from a HW peripheral")
#define MCUX_CSSL_ANALYSIS_STOP_PATTERN_HW_READ() \
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_DISCARD_VOLATILE()
#define MCUX_CSSL_ANALYSIS_START_PATTERN_HW_WRITE() \
MCUX_CSSL_ANALYSIS_START_SUPPRESS_DISCARD_VOLATILE("Write to a HW peripheral")
/*MCUX_CSSL_ANALYSIS_START_SUPPRESS_CAST_TO_OBJECT("Write to a HW peripheral")*/
#define MCUX_CSSL_ANALYSIS_STOP_PATTERN_HW_WRITE() \
/*MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_CAST_TO_OBJECT()*/ \
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_DISCARD_VOLATILE()
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_CONVERSION_BETWEEN_ENUM_AND_INTEGER_TYPES(rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(MISRA_C_2012_Rule_10_5, rationale)
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_CONVERSION_BETWEEN_ENUM_AND_INTEGER_TYPES() \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(MISRA_C_2012_Rule_10_5)
#define MCUX_CSSL_ANALYSIS_START_PATTERN_EXTERNAL_API_DECLARATIONS() \
MCUX_CSSL_ANALYSIS_START_SUPPRESS_DECLARED_BUT_NEVER_REFERENCED("Consumed by user, it is declared but never referenced. ")
#define MCUX_CSSL_ANALYSIS_STOP_PATTERN_EXTERNAL_API_DECLARATIONS() \
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_DECLARED_BUT_NEVER_REFERENCED()
#define MCUX_CSSL_ANALYSIS_START_PATTERN_DESCRIPTIVE_IDENTIFIER() \
MCUX_CSSL_ANALYSIS_START_SUPPRESS_AMBIGUOUS_IDENTIFIER("Identifiers longer than 31 characters are allowed for more descriptive naming")
#define MCUX_CSSL_ANALYSIS_STOP_PATTERN_DESCRIPTIVE_IDENTIFIER() \
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_AMBIGUOUS_IDENTIFIER()
#define MCUX_CSSL_ANALYSIS_START_PATTERN_REINTERPRET_MEMORY_OF_OPAQUE_TYPES() \
MCUX_CSSL_ANALYSIS_START_SUPPRESS_REINTERPRET_MEMORY("explicit pointer casts reinterpreting opaque types of workarea-like buffer objects are allowed.")
#define MCUX_CSSL_ANALYSIS_STOP_PATTERN_REINTERPRET_MEMORY() \
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_REINTERPRET_MEMORY()
/* Rule 11.3: applies to casts between ctx structs
* e.g. cast from Aead_Context_t to more specific type AeadModes_Context_t
*/
#define MCUX_CSSL_ANALYSIS_START_CAST_TO_MORE_SPECIFIC_TYPE() \
MCUX_CSSL_ANALYSIS_START_SUPPRESS_REINTERPRET_MEMORY("Cast to a more specific type is allowed")
#define MCUX_CSSL_ANALYSIS_STOP_CAST_TO_MORE_SPECIFIC_TYPE() \
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_REINTERPRET_MEMORY()
#define MCUX_CSSL_ANALYSIS_START_PATTERN_EXTERNAL_HEADER() \
MCUX_CSSL_ANALYSIS_START_SUPPRESS_C11_EXTENSION("External header outside our control") \
MCUX_CSSL_ANALYSIS_START_SUPPRESS_UNDEFINED_VALUE("External header outside our control") \
MCUX_CSSL_ANALYSIS_START_SUPPRESS_RESERVED_MACRO_IDENTIFIER("External header outside our control") \
MCUX_CSSL_ANALYSIS_START_SUPPRESS_PADDED_TO_ALIGNMENT_BOUNDARY("External header outside our control")
#define MCUX_CSSL_ANALYSIS_STOP_PATTERN_EXTERNAL_HEADER() \
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_PADDED_TO_ALIGNMENT_BOUNDARY() \
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_RESERVED_MACRO_IDENTIFIER() \
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_UNDEFINED_VALUE() \
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_C11_EXTENSION()
#define MCUX_CSSL_ANALYSIS_START_PATTERN_EXTERNAL_MACRO() \
MCUX_CSSL_ANALYSIS_START_SUPPRESS_CONTROLLING_EXPRESSION_IS_INVARIANT("External macro outside our control, operation is safe on target platform given correct arguments according to an API are provided") \
MCUX_CSSL_ANALYSIS_START_SUPPRESS_OPERATIONS_ON_INAPPROPRIATE_TYPE("External macro outside our control, operation is safe on target platform given correct arguments according to an API are provided") \
MCUX_CSSL_ANALYSIS_START_SUPPRESS_CONVERSIONS_WITH_INAPPROPRIATE_TYPE("External macro outside our control, operation is safe on target platform given correct arguments according to an API are provided") \
MCUX_CSSL_ANALYSIS_START_SUPPRESS_MISSING_EXPLICIT_PARANTHESIS("External macro outside our control, operation is safe on target platform given correct arguments according to an API are provided") \
MCUX_CSSL_ANALYSIS_START_SUPPRESS_INVALID_WIDTH_IN_SHIFT_OPERATIONS("External macro outside our control, operation is safe on target platform given correct arguments according to an API are provided")
#define MCUX_CSSL_ANALYSIS_STOP_PATTERN_EXTERNAL_MACRO() \
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_CONTROLLING_EXPRESSION_IS_INVARIANT() \
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_OPERATIONS_ON_INAPPROPRIATE_TYPE() \
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_CONVERSIONS_WITH_INAPPROPRIATE_TYPE() \
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_MISSING_EXPLICIT_PARANTHESIS() \
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_INVALID_WIDTH_IN_SHIFT_OPERATIONS()
#define MCUX_CSSL_ANALYSIS_START_PATTERN_OBJ_SIZES() \
MCUX_CSSL_ANALYSIS_START_SUPPRESS_UNUSED_VARIABLE("Variables used to determine object sizes") \
MCUX_CSSL_ANALYSIS_START_SUPPRESS_MISSING_VARIABLE_DECLARATION("Variables used to determine object sizes")
#define MCUX_CSSL_ANALYSIS_STOP_PATTERN_OBJ_SIZES() \
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_MISSING_VARIABLE_DECLARATION() \
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_UNUSED_VARIABLE()
#define MCUX_CSSL_ANALYSIS_START_PATTERN_FUP() \
MCUX_CSSL_ANALYSIS_START_SUPPRESS_MISSING_VARIABLE_DECLARATION("External declarations are generated by the FUP processing tool") \
MCUX_CSSL_ANALYSIS_COVERITY_START_FALSE_POSITIVE(MISRA_C_2012_Rule_5_8, "The FUP processing tool generates a second declaration")
#define MCUX_CSSL_ANALYSIS_STOP_PATTERN_FUP() \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_FALSE_POSITIVE(MISRA_C_2012_Rule_5_8) \
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_MISSING_VARIABLE_DECLARATION()
#define MCUX_CSSL_ANALYSIS_START_PATTERN_FUP_PROGRAM() \
MCUX_CSSL_ANALYSIS_START_PATTERN_EXTERNAL_LINKAGE_FUP() \
MCUX_CSSL_ANALYSIS_START_PATTERN_DEFINITION_IN_TEMP_FILE_FUP()
#define MCUX_CSSL_ANALYSIS_STOP_PATTERN_FUP_PROGRAM() \
MCUX_CSSL_ANALYSIS_STOP_PATTERN_DEFINITION_IN_TEMP_FILE_FUP() \
MCUX_CSSL_ANALYSIS_STOP_PATTERN_EXTERNAL_LINKAGE_FUP()
#define MCUX_CSSL_ANALYSIS_START_PATTERN_EXTERNAL_LINKAGE_FUP() \
MCUX_CSSL_ANALYSIS_START_PATTERN_DESCRIPTIVE_IDENTIFIER() \
MCUX_CSSL_ANALYSIS_COVERITY_START_FALSE_POSITIVE(MISRA_C_2012_Rule_5_8, "The FUP processing tool generates a second external declaration")
#define MCUX_CSSL_ANALYSIS_STOP_PATTERN_EXTERNAL_LINKAGE_FUP() \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_FALSE_POSITIVE(MISRA_C_2012_Rule_5_8) \
MCUX_CSSL_ANALYSIS_STOP_PATTERN_DESCRIPTIVE_IDENTIFIER()
#define MCUX_CSSL_ANALYSIS_START_PATTERN_DEFINITION_IN_TEMP_FILE_FUP() \
MCUX_CSSL_ANALYSIS_COVERITY_START_FALSE_POSITIVE(MISRA_C_2012_Rule_8_6, "The FUP processing tool generates definitions in temporary build files")
#define MCUX_CSSL_ANALYSIS_STOP_PATTERN_DEFINITION_IN_TEMP_FILE_FUP() \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_FALSE_POSITIVE(MISRA_C_2012_Rule_8_6)
#define MCUX_CSSL_ANALYSIS_START_PATTERN_SC_INTEGER_OVERFLOW() \
MCUX_CSSL_ANALYSIS_START_SUPPRESS_INTEGER_OVERFLOW("Integer overflows are allowed/expected for security counter variables per design")
#define MCUX_CSSL_ANALYSIS_STOP_PATTERN_SC_INTEGER_OVERFLOW() \
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_INTEGER_OVERFLOW()
#define MCUX_CSSL_ANALYSIS_START_PATTERN_SWITCH_STATEMENT_RETURN_TERMINATION() \
MCUX_CSSL_ANALYSIS_START_SUPPRESS_SWITCH_STATEMENT_NOT_WELL_FORMED("Return instead of break statement as terminator is allowed")
#define MCUX_CSSL_ANALYSIS_STOP_PATTERN_SWITCH_STATEMENT_RETURN_TERMINATION() \
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_SWITCH_STATEMENT_NOT_WELL_FORMED()
#define MCUX_CSSL_ANALYSIS_START_PATTERN_INVARIANT_EXPRESSION_WORKAREA_CALCULATIONS() \
MCUX_CSSL_ANALYSIS_START_SUPPRESS_CONTROLLING_EXPRESSION_IS_INVARIANT("Invariant expression is allowed in workarea calculation macros")
#define MCUX_CSSL_ANALYSIS_STOP_PATTERN_INVARIANT_EXPRESSION_WORKAREA_CALCULATIONS() \
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_CONTROLLING_EXPRESSION_IS_INVARIANT()
#define MCUX_CSSL_ANALYSIS_START_PATTERN_ADDRESS_IN_SFR_IS_NOT_REUSED_OUTSIDE() \
MCUX_CSSL_ANALYSIS_START_SUPPRESS_ESCAPING_LOCAL_ADDRESS("Address in SFR is for internal use only and does not escape")
#define MCUX_CSSL_ANALYSIS_STOP_PATTERN_ADDRESS_IN_SFR_IS_NOT_REUSED_OUTSIDE() \
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_ESCAPING_LOCAL_ADDRESS()
#define MCUX_CSSL_ANALYSIS_START_PATTERN_DI_INTEGER_OVERFLOW() \
MCUX_CSSL_ANALYSIS_START_SUPPRESS_INTEGER_OVERFLOW("Integer overflows are allowed/expected for DI variables per design")
#define MCUX_CSSL_ANALYSIS_STOP_PATTERN_DI_INTEGER_OVERFLOW() \
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_INTEGER_OVERFLOW()
#define MCUX_CSSL_ANALYSIS_START_PATTERN_DI_CAST_POINTERS() \
MCUX_CSSL_ANALYSIS_START_SUPPRESS_TYPECAST_BETWEEN_INTEGER_AND_POINTER("Typecast pointer to integer for DI record/expunge")
#define MCUX_CSSL_ANALYSIS_STOP_PATTERN_DI_CAST_POINTERS() \
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_TYPECAST_BETWEEN_INTEGER_AND_POINTER()
#define MCUX_CSSL_ANALYSIS_START_PATTERN_SC_CAST_POINTERS() \
MCUX_CSSL_ANALYSIS_START_SUPPRESS_TYPECAST_BETWEEN_INTEGER_AND_POINTER("Typecast pointer (void *) to integer for SC add/sub")
#define MCUX_CSSL_ANALYSIS_STOP_PATTERN_SC_CAST_POINTERS() \
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_TYPECAST_BETWEEN_INTEGER_AND_POINTER()
#define MCUX_CSSL_ANALYSIS_START_PATTERN_EXAMPLE_FUNCTION() \
MCUX_CSSL_ANALYSIS_START_SUPPRESS_MISSING_FUNCTION_DECLARATION("Declaration is not needed for release package. Cant be static as it is declared and used by testing framweork.") \
MCUX_CSSL_ANALYSIS_START_PATTERN_DESCRIPTIVE_IDENTIFIER()
#define MCUX_CSSL_ANALYSIS_STOP_PATTERN_EXAMPLE_FUNCTION() \
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_MISSING_FUNCTION_DECLARATION() \
MCUX_CSSL_ANALYSIS_STOP_PATTERN_DESCRIPTIVE_IDENTIFIER()
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_CAST_VOID() \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(MISRA_C_2012_Rule_11_5, "Typecast pointer (void *) for correct representation to use pointer")
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_CAST_VOID() \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(MISRA_C_2012_Rule_11_5)
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_MISSING_EXPLICIT_PARANTHESIS(rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(MISRA_C_2012_Rule_12_1, rationale)
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_MISSING_EXPLICIT_PARANTHESIS() \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(MISRA_C_2012_Rule_12_1)
#ifdef MCUX_CSSL_COMPILER_ARM_COMPILER
#define MCUX_CSSL_ANALYSIS_START_PATTERN_SIGNED_TRUNCATION() \
MCUX_CSSL_ANALYSIS_START_SUPPRESS_CAST_MAY_RESULT_IN_MISINTERPRETED_DATA("Truncated upper bits are not needed. Operation is implementation defined and documented in arm compiler user guide. If a value of integral type is truncated to a shorter signed integral type, the result is obtained by discarding an appropriate number of most significant bits. If the original number is too large, positive or negative, for the new type, there is no guarantee that the sign of the result is going to be the same as the original. On target ARM architecture two's complement representation is used and a sign will be derived from most significant bit of data remaining after truncation. This operation allows efficient implementation of signed numbers modular arithmetic.")
#define MCUX_CSSL_ANALYSIS_STOP_PATTERN_SIGNED_TRUNCATION() \
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_CAST_MAY_RESULT_IN_MISINTERPRETED_DATA()
#define MCUX_CSSL_ANALYSIS_START_PATTERN_SIGNED_SHIFT() \
MCUX_CSSL_ANALYSIS_START_SUPPRESS_OPERATIONS_ON_INAPPROPRIATE_TYPE("Shift operation on signed numbers is implementation defined and documented in arm compiler user guide. Right shifts on signed quantities are arithmetic (sign extension is performed). Left shifs are logical. This operation allows sign extensions and efficient implementation of signed numbers arithmetic.") \
MCUX_CSSL_ANALYSIS_START_SUPPRESS_SIGNED_SHIFT_AMOUNT("Shift operation on signed numbers is implementation defined and documented in arm compiler user guide. Right shifts on signed quantities are arithmetic (sign extension is performed). Left shifs are logical. This operation allows sign extensions and efficient implementation of signed numbers arithmetic.")
#define MCUX_CSSL_ANALYSIS_STOP_PATTERN_SIGNED_SHIFT() \
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_OPERATIONS_ON_INAPPROPRIATE_TYPE() \
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_SIGNED_SHIFT_AMOUNT()
#define MCUX_CSSL_ANALYSIS_START_PATTERN_TWOS_COMPLEMENT_REPRESENTATION() \
MCUX_CSSL_ANALYSIS_START_SUPPRESS_CAST_MAY_RESULT_IN_MISINTERPRETED_DATA("Algoritihm works correctly assuming two's complement representation of signed numbers. This is true for target ARM platform.")
#define MCUX_CSSL_ANALYSIS_STOP_PATTERN_TWOS_COMPLEMENT_REPRESENTATION() \
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_CAST_MAY_RESULT_IN_MISINTERPRETED_DATA()
#else //defined(MCUX_CSSL_COMPILER_ARM_COMPILER)
#define MCUX_CSSL_ANALYSIS_START_PATTERN_SIGNED_TRUNCATION() \
/* Intentionally empty */
#define MCUX_CSSL_ANALYSIS_STOP_PATTERN_SIGNED_TRUNCATION() \
/* Intentionally empty */
#define MCUX_CSSL_ANALYSIS_START_PATTERN_SIGNED_SHIFT() \
/* Intentionally empty */
#define MCUX_CSSL_ANALYSIS_STOP_PATTERN_SIGNED_SHIFT() \
/* Intentionally empty */
#define MCUX_CSSL_ANALYSIS_START_PATTERN_TWOS_COMPLEMENT_REPRESENTATION() \
/* Intentionally empty */
#define MCUX_CSSL_ANALYSIS_STOP_PATTERN_TWOS_COMPLEMENT_REPRESENTATION() \
/* Intentionally empty */
#endif
#define MCUX_CSSL_ANALYSIS_ASSERT_PARAMETER(value, min_value, max_value, return_code) \
MCUX_CSSL_ANALYSIS_COVERITY_ASSERT(value, min_value, max_value, return_code)
#define MCUX_CSSL_ANALYSIS_ASSERT_PARAMETER_WITH_DATA_TYPE(value,data_type, min_value, max_value, return_code) \
MCUX_CSSL_ANALYSIS_COVERITY_ASSERT_WITH_DATA_TYPE(value, data_type, min_value, max_value, return_code)
/* Example of basic violation suppression */
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_DEAD_CODE(rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(MISRA_C_2012_Rule_2_1, rationale)
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_DEAD_CODE() \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(MISRA_C_2012_Rule_2_1)
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_UNUSED_MACRO(rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(MISRA_C_2012_Rule_2_5, rationale)
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_UNUSED_MACRO() \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(MISRA_C_2012_Rule_2_5)
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_TEXT_IN_COMMENTS(rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(MISRA_C_2012_Rule_3_1, rationale)
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_TEXT_IN_COMMENTS() \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(MISRA_C_2012_Rule_3_1)
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_POINTER_CASTING(rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(MISRA_C_2012_Rule_11_3, rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(CERT_EXP36_C, rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(CERT_EXP39_C, rationale)
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_POINTER_CASTING() \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(CERT_EXP39_C) \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(CERT_EXP36_C) \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(MISRA_C_2012_Rule_11_3)
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_CAST_MAY_RESULT_IN_MISINTERPRETED_DATA(rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(CERT_INT02_C, rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(CERT_INT31_C, rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(CERT_INT00_C, rationale)
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_CAST_MAY_RESULT_IN_MISINTERPRETED_DATA() \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(CERT_INT02_C) \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(CERT_INT31_C) \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(CERT_INT00_C)
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_DISCARD_VOLATILE(rationale) \
MCUX_CSSL_ANALYSIS_CLANG_START_SUPPRESS_WARNING(-Wcast-qual, rationale) \
MCUX_CSSL_ANALYSIS_GHS_START_SUPPRESS_WARNING(1836, rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(MISRA_C_2012_Rule_11_8, rationale)
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_DISCARD_VOLATILE() \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(MISRA_C_2012_Rule_11_8) \
MCUX_CSSL_ANALYSIS_GHS_STOP_SUPPRESS_WARNING(1836) \
MCUX_CSSL_ANALYSIS_CLANG_STOP_SUPPRESS_WARNING(-Wcast-qual)
#define MCUX_CSSL_ANALYSIS_START_PATTERN_HW_REGISTER_INDEXING() \
MCUX_CSSL_ANALYSIS_START_SUPPRESS_OUT_OF_BOUNDS_ACCESS("Apply an index to the base address of a HW peripheral to access the correct SFR-word. The caller is responsible for ensuring that the index is valid.") \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(ARRAY_VS_SINGLETON, "Apply an index to the base address of a HW peripheral to access the correct SFR-word. The caller is responsible for ensuring that the index is valid.")
#define MCUX_CSSL_ANALYSIS_START_PATTERN_HW_REGISTER_INDEXING_WITH_OFFSETOF() \
MCUX_CSSL_ANALYSIS_START_SUPPRESS_OUT_OF_BOUNDS_ACCESS("Apply an index to the base address of a HW peripheral, where index was computed with 'offsetof' macro to ensure a correct offset.") \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(ARRAY_VS_SINGLETON, "Apply an index to the base address of a HW peripheral, where index was computed with 'offsetof' macro to ensure a correct offset.")
#define MCUX_CSSL_ANALYSIS_STOP_PATTERN_HW_REGISTER_INDEXING() \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(ARRAY_VS_SINGLETON) \
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_OUT_OF_BOUNDS_ACCESS()
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_OUT_OF_BOUNDS_ACCESS(rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(MISRA_C_2012_Rule_18_1, rationale)
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_OUT_OF_BOUNDS_ACCESS() \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(MISRA_C_2012_Rule_18_1) \
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_DISCARD_CONST(rationale) \
MCUX_CSSL_ANALYSIS_START_SUPPRESS_DISCARD_CONST_QUALIFIER(rationale)
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_DISCARD_CONST() \
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_DISCARD_CONST_QUALIFIER()
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_DISCARD_CONST_QUALIFIER(rationale) \
MCUX_CSSL_ANALYSIS_CLANG_START_SUPPRESS_WARNING(-Wcast-qual, rationale) \
MCUX_CSSL_ANALYSIS_GHS_START_SUPPRESS_WARNING(1836, rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(MISRA_C_2012_Rule_11_8, rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(CERT_EXP05_C, rationale)
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_DISCARD_CONST_QUALIFIER() \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(CERT_EXP05_C) \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(MISRA_C_2012_Rule_11_8) \
MCUX_CSSL_ANALYSIS_GHS_STOP_SUPPRESS_WARNING(1836) \
MCUX_CSSL_ANALYSIS_CLANG_STOP_SUPPRESS_WARNING(-Wcast-qual)
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_NULL_POINTER_CONSTANT(rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(MISRA_C_2012_Rule_11_9, rationale)
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_NULL_POINTER_CONSTANT() \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(MISRA_C_2012_Rule_11_9)
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_REINTERPRET_MEMORY_BETWEEN_INAPT_ESSENTIAL_TYPES(rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(MISRA_C_2012_Rule_11_3, rationale)
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_REINTERPRET_MEMORY_BETWEEN_INAPT_ESSENTIAL_TYPES() \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(MISRA_C_2012_Rule_11_3)
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_REINTERPRET_MEMORY(rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(MISRA_C_2012_Rule_11_3, rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(CERT_EXP39_C, rationale)
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_REINTERPRET_MEMORY() \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(CERT_EXP39_C) \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(MISRA_C_2012_Rule_11_3)
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_ARRAY_OUT_OF_BOUNDS(rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(CERT_ARR30_C, rationale)
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_ARRAY_OUT_OF_BOUNDS() \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(CERT_ARR30_C)
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_TYPECAST_BETWEEN_INTEGER_AND_POINTER(rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(MISRA_C_2012_Rule_11_4, rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(MISRA_C_2012_Rule_11_6, rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(CERT_INT36_C, rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(CERT_MSC15_C, rationale)
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_TYPECAST_BETWEEN_INTEGER_AND_POINTER() \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(CERT_MSC15_C) \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(CERT_INT36_C) \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(MISRA_C_2012_Rule_11_6) \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(MISRA_C_2012_Rule_11_4)
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_TYPECAST_INTEGER_TO_POINTER(rationale) \
MCUX_CSSL_ANALYSIS_START_SUPPRESS_TYPECAST_BETWEEN_INTEGER_AND_POINTER(rationale)
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_TYPECAST_INTEGER_TO_POINTER() \
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_TYPECAST_BETWEEN_INTEGER_AND_POINTER()
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_AMBIGUOUS_IDENTIFIER(rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(MISRA_C_2012_Rule_5_1, rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(MISRA_C_2012_Rule_5_4, rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(MISRA_C_2012_Rule_5_5, rationale)
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_AMBIGUOUS_IDENTIFIER() \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(MISRA_C_2012_Rule_5_5) \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(MISRA_C_2012_Rule_5_4) \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(MISRA_C_2012_Rule_5_1)
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_REINTERPRET_STRUCT(rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(MISRA_C_2012_Rule_11_1, rationale)
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_REINTERPRET_STRUCT() \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(MISRA_C_2012_Rule_11_1)
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_DECLARED_BUT_NEVER_DEFINED(rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(MISRA_C_2012_Rule_8_6, rationale)
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_DECLARED_BUT_NEVER_DEFINED() \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(MISRA_C_2012_Rule_8_6)
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_DEFINED_MORE_THAN_ONCE(rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(MISRA_C_2012_Rule_8_5, rationale)
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_DEFINED_MORE_THAN_ONCE() \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(MISRA_C_2012_Rule_8_5)
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_DECLARED_BUT_NEVER_REFERENCED(rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(MISRA_C_2012_Rule_2_2, rationale)
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_DECLARED_BUT_NEVER_REFERENCED() \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(MISRA_C_2012_Rule_2_2)
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_INTEGER_OVERFLOW(rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(INTEGER_OVERFLOW, rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(CERT_INT30_C, rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(CERT_INT32_C, rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(CERT_INT08_C, rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(MISRA_C_2012_Rule_12_4, rationale)
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_INTEGER_OVERFLOW() \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(MISRA_C_2012_Rule_12_4) \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(CERT_INT08_C) \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(CERT_INT32_C) \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(CERT_INT30_C) \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(INTEGER_OVERFLOW)
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_INTEGER_WRAP(rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(CERT_INT30_C, rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(CERT_INT08_C, rationale)
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_INTEGER_WRAP() \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(CERT_INT08_C) \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(CERT_INT30_C)
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_POINTER_INCOMPATIBLE(rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(CERT_EXP39_C, rationale)
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_POINTER_INCOMPATIBLE() \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(CERT_EXP39_C)
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_DEREFERENCE_NULL_POINTER(rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(CERT_EXP34_C, rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(FORWARD_NULL, rationale)
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_DEREFERENCE_NULL_POINTER() \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(FORWARD_NULL) \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(CERT_EXP34_C)
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_SWITCH_STATEMENT_NOT_WELL_FORMED(rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(MISRA_C_2012_Rule_16_1, rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(MISRA_C_2012_Rule_16_3, rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(MISRA_C_2012_Rule_16_6, rationale)
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_SWITCH_STATEMENT_NOT_WELL_FORMED() \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(MISRA_C_2012_Rule_16_1) \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(MISRA_C_2012_Rule_16_3) \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(MISRA_C_2012_Rule_16_6)
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_CONTROLLING_EXPRESSION_IS_INVARIANT(rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(MISRA_C_2012_Rule_14_3, rationale)
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_CONTROLLING_EXPRESSION_IS_INVARIANT() \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(MISRA_C_2012_Rule_14_3)
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_ESCAPING_LOCAL_ADDRESS(rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(MISRA_C_2012_Rule_18_6, rationale)
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_ESCAPING_LOCAL_ADDRESS() \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(MISRA_C_2012_Rule_18_6)
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_BOOLEAN_TYPE_FOR_CONDITIONAL_EXPRESSION() \
MCUX_CSSL_ANALYSIS_COVERITY_START_FALSE_POSITIVE(MISRA_C_2012_Rule_14_4, "Conditional expression does have a boolean type.")
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_BOOLEAN_TYPE_FOR_CONDITIONAL_EXPRESSION() \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_FALSE_POSITIVE(MISRA_C_2012_Rule_14_4)
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_C11_EXTENSION(rationale) \
MCUX_CSSL_ANALYSIS_CLANG_START_SUPPRESS_WARNING(-Wc11-extensions, rationale)
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_C11_EXTENSION() \
MCUX_CSSL_ANALYSIS_CLANG_STOP_SUPPRESS_WARNING(-Wc11-extensions)
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_UNDEFINED_VALUE(rationale) \
MCUX_CSSL_ANALYSIS_CLANG_START_SUPPRESS_WARNING(-Wundef, rationale)
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_UNDEFINED_VALUE() \
MCUX_CSSL_ANALYSIS_CLANG_STOP_SUPPRESS_WARNING(-Wundef)
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_RESERVED_IDENTIFIER(rationale) \
MCUX_CSSL_ANALYSIS_CLANG_START_SUPPRESS_WARNING(-Wreserved-identifier, rationale)
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_RESERVED_IDENTIFIER() \
MCUX_CSSL_ANALYSIS_CLANG_STOP_SUPPRESS_WARNING(-Wreserved-identifier)
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_RESERVED_MACRO_IDENTIFIER(rationale) \
MCUX_CSSL_ANALYSIS_CLANG_START_SUPPRESS_WARNING(-Wreserved-macro-identifier, rationale)
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_RESERVED_MACRO_IDENTIFIER() \
MCUX_CSSL_ANALYSIS_CLANG_STOP_SUPPRESS_WARNING(-Wreserved-macro-identifier)
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_MISSING_FUNCTION_DECLARATION(rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(MISRA_C_2012_Rule_8_4, rationale)
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_MISSING_FUNCTION_DECLARATION() \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(MISRA_C_2012_Rule_8_4)
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_MISSING_VARIABLE_DECLARATION(rationale) \
MCUX_CSSL_ANALYSIS_CLANG_START_SUPPRESS_WARNING(-Wmissing-variable-declarations, rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(MISRA_C_2012_Rule_8_4, rationale)
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_MISSING_VARIABLE_DECLARATION() \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(MISRA_C_2012_Rule_8_4) \
MCUX_CSSL_ANALYSIS_CLANG_STOP_SUPPRESS_WARNING(-Wmissing-variable-declarations)
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_CAST_OF_COMPOSITE_EXPRESSION(rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(MISRA_C_2012_Rule_10_8, rationale)
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_CAST_OF_COMPOSITE_EXPRESSION() \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(MISRA_C_2012_Rule_10_8)
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_UNUSED_VARIABLE(rationale) \
MCUX_CSSL_ANALYSIS_CLANG_START_SUPPRESS_WARNING(-Wunused-variable, rationale)
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_UNUSED_VARIABLE() \
MCUX_CSSL_ANALYSIS_CLANG_STOP_SUPPRESS_WARNING(-Wunused-variable)
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_PADDED_TO_ALIGNMENT_BOUNDARY(rationale) \
MCUX_CSSL_ANALYSIS_CLANG_START_SUPPRESS_WARNING(-Wpadded, rationale)
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_PADDED_TO_ALIGNMENT_BOUNDARY() \
MCUX_CSSL_ANALYSIS_CLANG_STOP_SUPPRESS_WARNING(-Wpadded)
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_HARDWARE_ACCESS(rationale) \
MCUX_CSSL_ANALYSIS_GCC_START_SUPPRESS_WARNING(-Warray-bounds, rationale)
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_HARDWARE_ACCESS() \
MCUX_CSSL_ANALYSIS_GCC_STOP_SUPPRESS_WARNING(-Warray-bounds)
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_TAINTED_EXPRESSION(rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(MISRA_C_2012_Directive_4_14, rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(TAINTED_SCALAR, rationale)
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_TAINTED_EXPRESSION() \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(MISRA_C_2012_Directive_4_14) \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(TAINTED_SCALAR)
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_INVALID_WIDTH_IN_SHIFT_OPERATIONS(rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(MISRA_C_2012_Directive_12_2, rationale)
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_INVALID_WIDTH_IN_SHIFT_OPERATIONS() \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(MISRA_C_2012_Directive_12_2)
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_CONVERSIONS_WITH_INAPPROPRIATE_TYPE(rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(MISRA_C_2012_Rule_10_4, rationale)
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_CONVERSIONS_WITH_INAPPROPRIATE_TYPE() \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(MISRA_C_2012_Rule_10_4)
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_OPERATIONS_ON_INAPPROPRIATE_TYPE(rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(MISRA_C_2012_Rule_10_1, rationale)
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_OPERATIONS_ON_INAPPROPRIATE_TYPE() \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(MISRA_C_2012_Rule_10_1)
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_FLEXIBLE_ARRAY(rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(MISRA_C_2012_Rule_18_7, rationale)
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_FLEXIBLE_ARRAY() \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(MISRA_C_2012_Rule_18_7)
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_ASSIGNING_COMPOSITE_EXPRESSION(rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(MISRA_C_2012_Rule_10_6, rationale)
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_ASSIGNING_COMPOSITE_EXPRESSION() \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(MISRA_C_2012_Rule_10_6)
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_STDARG_USAGE(rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(MISRA_C_2012_Rule_17_1, rationale)
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_STDARG_USAGE() \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(MISRA_C_2012_Rule_17_1)
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_VA_ARGS_USAGE(rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(MISRA_C_2012_Rule_10_1, rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(MISRA_C_2012_Rule_10_4, rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(MISRA_C_2012_Rule_20_7, rationale)
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_VA_ARGS_USAGE() \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(MISRA_C_2012_Rule_20_7) \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(MISRA_C_2012_Rule_10_4) \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(MISRA_C_2012_Rule_10_1)
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_TYPECAST_VOIDPTR_TO_FUNCTION(rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(MISRA_C_2012_Rule_11_5, rationale)
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_TYPECAST_VOIDPTR_TO_FUNCTION() \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(MISRA_C_2012_Rule_11_5)
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_CONCATENATION_PREPROCESSOR(rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(MISRA_C_2012_Rule_20_10, rationale)
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_CONCATENATION_PREPROCESSOR() \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(MISRA_C_2012_Rule_20_10)
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_SIGNED_SHIFT_AMOUNT(rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(CERT_INT13_C, rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(CERT_INT14_C, rationale)
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_SIGNED_SHIFT_AMOUNT() \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(CERT_INT14_C) \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(CERT_INT13_C)
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_MODIFY_STRING_LITERALS(rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(CERT_STR30_C, rationale)
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_MODIFY_STRING_LITERALS() \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(CERT_STR30_C)
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_RETURN_CODE_NOT_CHECKED(rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(MISRA_C_2012_Directive_4_7, rationale)
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_RETURN_CODE_NOT_CHECKED() \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(MISRA_C_2012_Directive_4_7)
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_CAST_TO_VOIDPTR(rationale) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(MISRA_C_2012_Rule_11_6, rationale)
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_CAST_TO_VOIDPTR() \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(MISRA_C_2012_Rule_11_6)
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_FUNCTIONS_CONSUMED_BY_CUSTOMER() \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(CERT_DCL15_C, "can not make function static as it is consumed by customers.") \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(CERT_DCL19_C, "can not make function static as it is consumed by customers.")
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_FUNCTIONS_CONSUMED_BY_CUSTOMER() \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(CERT_DCL19_C) \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(CERT_DCL15_C)
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_TYPE_NAME_DOESNT_NEED_TO_BE_WRAPPED_BY_PARANTHESIS() \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(MISRA_C_2012_Rule_20_7, " Not wrapping a macro parameter in parentheses is allowed, if the parameter represents a type name")
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_TYPE_NAME_DOESNT_NEED_TO_BE_WRAPPED_BY_PARANTHESIS() \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(MISRA_C_2012_Rule_20_7)
#define MCUX_CSSL_ANALYSIS_START_SUPPRESS_IMPLICIT_CAST_FROM_CHAR() \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(MISRA_C_2012_Rule_10_3, "Implicit cast between char and uint8_t in examples is allowed for readability purposes")
#define MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_IMPLICIT_CAST_FROM_CHAR() \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(MISRA_C_2012_Rule_10_3)
/* Tool specific handling: Coverity checkers */
#if defined(__COVERITY__)
#define MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(checker_identifier, rationale) \
MCUX_CSSL_ANALYSIS_EXPAND(MCUX_CSSL_ANALYSIS_DEFER(MCUX_CSSL_ANALYSIS_PRAGMA)(coverity compliance block deviate checker_identifier rationale))
#define MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(checker_identifier) \
MCUX_CSSL_ANALYSIS_EXPAND(MCUX_CSSL_ANALYSIS_DEFER(MCUX_CSSL_ANALYSIS_PRAGMA)(coverity compliance end_block checker_identifier))
#define MCUX_CSSL_ANALYSIS_COVERITY_START_FALSE_POSITIVE(checker_identifier, rationale) \
MCUX_CSSL_ANALYSIS_EXPAND(MCUX_CSSL_ANALYSIS_DEFER(MCUX_CSSL_ANALYSIS_PRAGMA)(coverity compliance block fp checker_identifier rationale))
#define MCUX_CSSL_ANALYSIS_COVERITY_STOP_FALSE_POSITIVE(checker_identifier) \
MCUX_CSSL_ANALYSIS_EXPAND(MCUX_CSSL_ANALYSIS_DEFER(MCUX_CSSL_ANALYSIS_PRAGMA)(coverity compliance end_block checker_identifier))
#define MCUX_CSSL_ANALYSIS_COVERITY_ASSERT(value, min_value, max_value, return_code) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(NO_EFFECT, "The minimum or the maximum value may have no effect for the condition.") \
MCUX_CSSL_ANALYSIS_START_SUPPRESS_CONTROLLING_EXPRESSION_IS_INVARIANT("The minimum or the maximum value may have no effect for the condition.") \
if(((min_value) <= (value)) && ((value) <= (max_value))) \
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_CONTROLLING_EXPRESSION_IS_INVARIANT() \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(NO_EFFECT) \
{\
/* Do Nothing*/ \
}\
else \
{\
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(MISRA_C_2012_Rule_17_4, "For void return, don't need to return a value at the end of function")\
return return_code;\
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(MISRA_C_2012_Rule_17_4)\
}
#define MCUX_CSSL_ANALYSIS_COVERITY_ASSERT_WITH_DATA_TYPE(value, data_type, min_value, max_value, return_code) \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(CERT_INT36_C, "The minimum or the maximum value may have no effect for the condition.") \
MCUX_CSSL_ANALYSIS_START_SUPPRESS_CONTROLLING_EXPRESSION_IS_INVARIANT("This is for the case where value is unsigned and min_value is unsigned zero.") \
MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(MISRA_C_2012_Rule_11_4, "The minimum or the maximum value may have no effect for the condition.") \
if((((data_type)(min_value)) <= ((data_type)(value))) && (((data_type)(value)) <= ((data_type)(max_value)))) \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(MISRA_C_2012_Rule_11_4) \
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_CONTROLLING_EXPRESSION_IS_INVARIANT() \
MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(CERT_INT36_C) \
{\
/* Do Nothing*/ \
}\
else \
{\
return return_code;\
}
#else
#define MCUX_CSSL_ANALYSIS_COVERITY_START_DEVIATE(checker_identifier, rationale)
#define MCUX_CSSL_ANALYSIS_COVERITY_STOP_DEVIATE(checker_identifier)
#define MCUX_CSSL_ANALYSIS_COVERITY_START_FALSE_POSITIVE(checker_identifier, rationale)
#define MCUX_CSSL_ANALYSIS_COVERITY_STOP_FALSE_POSITIVE(checker_identifier)
#define MCUX_CSSL_ANALYSIS_COVERITY_ASSERT(value, min_value, max_value, return_code)
#define MCUX_CSSL_ANALYSIS_COVERITY_ASSERT_WITH_DATA_TYPE(value, data_type, min_value, max_value, return_code)
#endif
/* Tool specific handling: Clang warnings */
#if defined(__clang__)
#define MCUX_CSSL_ANALYSIS_CLANG_START_SUPPRESS_WARNING(warning_identifier, rationale) \
MCUX_CSSL_ANALYSIS_EXPAND(MCUX_CSSL_ANALYSIS_DEFER(MCUX_CSSL_ANALYSIS_PRAGMA)(clang diagnostic push)) \
MCUX_CSSL_ANALYSIS_EXPAND(MCUX_CSSL_ANALYSIS_DEFER(MCUX_CSSL_ANALYSIS_PRAGMA)(clang diagnostic ignored MCUX_CSSL_ANALYSIS_STR(warning_identifier)))
#define MCUX_CSSL_ANALYSIS_CLANG_STOP_SUPPRESS_WARNING(warning_identifier) \
MCUX_CSSL_ANALYSIS_EXPAND(MCUX_CSSL_ANALYSIS_DEFER(MCUX_CSSL_ANALYSIS_PRAGMA)(clang diagnostic pop))
#else
#define MCUX_CSSL_ANALYSIS_CLANG_START_SUPPRESS_WARNING(warning_identifier, rationale)
#define MCUX_CSSL_ANALYSIS_CLANG_STOP_SUPPRESS_WARNING(warning_identifier)
#endif
/* Tool specific handling: GHS warnings */
#if defined(__ghs__)
#define MCUX_CSSL_ANALYSIS_GHS_START_SUPPRESS_WARNING(warning_identifier, rationale) \
MCUX_CSSL_ANALYSIS_PRAGMA(ghs nowarning warning_identifier)
#define MCUX_CSSL_ANALYSIS_GHS_STOP_SUPPRESS_WARNING(warning_identifier) \
MCUX_CSSL_ANALYSIS_PRAGMA(ghs endnowarning warning_identifier)
#else
#define MCUX_CSSL_ANALYSIS_GHS_START_SUPPRESS_WARNING(warning_identifier, rationale)
#define MCUX_CSSL_ANALYSIS_GHS_STOP_SUPPRESS_WARNING(warning_identifier)
#endif
/* Tool specific handling: GCC warnings */
#if defined(__GNUC__)
#define MCUX_CSSL_ANALYSIS_GCC_START_SUPPRESS_WARNING(warning_identifier, rationale) \
MCUX_CSSL_ANALYSIS_EXPAND(MCUX_CSSL_ANALYSIS_DEFER(MCUX_CSSL_ANALYSIS_PRAGMA)(GCC diagnostic push)) \
MCUX_CSSL_ANALYSIS_EXPAND(MCUX_CSSL_ANALYSIS_DEFER(MCUX_CSSL_ANALYSIS_PRAGMA)(GCC diagnostic ignored MCUX_CSSL_ANALYSIS_STR(warning_identifier)))
#define MCUX_CSSL_ANALYSIS_GCC_STOP_SUPPRESS_WARNING(warning_identifier) \
MCUX_CSSL_ANALYSIS_EXPAND(MCUX_CSSL_ANALYSIS_DEFER(MCUX_CSSL_ANALYSIS_PRAGMA)(GCC diagnostic pop))
#else
#define MCUX_CSSL_ANALYSIS_GCC_START_SUPPRESS_WARNING(warning_identifier, rationale)
#define MCUX_CSSL_ANALYSIS_GCC_STOP_SUPPRESS_WARNING(warning_identifier)
#endif
/* Arm Compiler 4/5 */
#if defined(MCUX_CSSL_COMPILER_ARMCC)
#define MCUX_CSSL_ANALYSIS_ARMCC_START_SUPPRESS_WARNING(warning_identifier, rationale) \
MCUX_CSSL_ANALYSIS_EXPAND(MCUX_CSSL_ANALYSIS_DEFER(MCUX_CSSL_ANALYSIS_PRAGMA)(push)) \
MCUX_CSSL_ANALYSIS_EXPAND(MCUX_CSSL_ANALYSIS_DEFER(MCUX_CSSL_ANALYSIS_PRAGMA)(diag_suppress MCUX_CSSL_ANALYSIS_STR(warning_identifier)))
#define MCUX_CSSL_ANALYSIS_ARMCC_STOP_SUPPRESS_WARNING(warning_identifier) \
MCUX_CSSL_ANALYSIS_EXPAND(MCUX_CSSL_ANALYSIS_DEFER(MCUX_CSSL_ANALYSIS_PRAGMA)(pop))
#else
#define MCUX_CSSL_ANALYSIS_ARMCC_START_SUPPRESS_WARNING(warning_identifier, rationale)
#define MCUX_CSSL_ANALYSIS_ARMCC_STOP_SUPPRESS_WARNING(warning_identifier)
#endif
/* Arm Compiler 6 / Arm Compiler for Embedded 6 */
#if defined(MCUX_CSSL_COMPILER_ARMCLANG) || defined(MCUX_CSSL_COMPILER_ARMCLANG_LTM)
#define MCUX_CSSL_ANALYSIS_ARMCLANG_START_SUPPRESS_WARNING(warning_identifier, rationale) \
MCUX_CSSL_ANALYSIS_EXPAND(MCUX_CSSL_ANALYSIS_DEFER(MCUX_CSSL_ANALYSIS_PRAGMA)(clang diagnostic push)) \
MCUX_CSSL_ANALYSIS_EXPAND(MCUX_CSSL_ANALYSIS_DEFER(MCUX_CSSL_ANALYSIS_PRAGMA)(clang diagnostic ignored MCUX_CSSL_ANALYSIS_STR(warning_identifier)))
#define MCUX_CSSL_ANALYSIS_ARMCLANG_STOP_SUPPRESS_WARNING(warning_identifier) \
MCUX_CSSL_ANALYSIS_EXPAND(MCUX_CSSL_ANALYSIS_DEFER(MCUX_CSSL_ANALYSIS_PRAGMA)(clang diagnostic pop))
#else
#define MCUX_CSSL_ANALYSIS_ARMCLANG_START_SUPPRESS_WARNING(warning_identifier, rationale)
#define MCUX_CSSL_ANALYSIS_ARMCLANG_STOP_SUPPRESS_WARNING(warning_identifier)
#endif
#endif /* MCUX_CSSL_ANALYSIS_H_ */
@@ -0,0 +1,216 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2019-2020, 2023 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
#ifndef MCUX_CSSL_C_PRE_PROCESSOR_H_
#define MCUX_CSSL_C_PRE_PROCESSOR_H_
/**
* @file mcuxCsslCPreProcessor.h
* @brief The default implementation is based on standard C preprocessor
* functionality
*/
#define MCUX_CSSL_CPP_STR(a) #a
#define MCUX_CSSL_CPP_ADD(a) + (a)
#define MCUX_CSSL_CPP_CAT_IMPL(a, b) a##b
#define MCUX_CSSL_CPP_CAT(a, b) \
MCUX_CSSL_CPP_CAT_IMPL(a, b)
#define MCUX_CSSL_CPP_CAT3(a, b, c) \
MCUX_CSSL_CPP_CAT(MCUX_CSSL_CPP_CAT(a, b), c)
#define MCUX_CSSL_CPP_CAT4(a, b, c, d) \
MCUX_CSSL_CPP_CAT(MCUX_CSSL_CPP_CAT(a, b), MCUX_CSSL_CPP_CAT(c, d))
#define MCUX_CSSL_CPP_CAT6(a, b, c, d, e, f) \
MCUX_CSSL_CPP_CAT3( \
MCUX_CSSL_CPP_CAT(a, b), \
MCUX_CSSL_CPP_CAT(c, d), \
MCUX_CSSL_CPP_CAT(e, f))
#define MCUX_CSSL_CPP_SEQUENCE_32TO0() \
32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, \
16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0
#define MCUX_CSSL_CPP_SEQUENCE_N_UNTIL_5TO0() \
n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, \
n, n, n, n, n, n, n, n, n, n, n, 5, 4, 3, 2, 1, 0
#define MCUX_CSSL_CPP_SEQUENCE_N_UNTIL_4TO0() \
n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, \
n, n, n, n, n, n, n, n, n, n, n, n, 4, 3, 2, 1, 0
#define MCUX_CSSL_CPP_SEQUENCE_N_UNTIL_3TO0() \
n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, \
n, n, n, n, n, n, n, n, n, n, n, n, n, 3, 2, 1, 0
#define MCUX_CSSL_CPP_SEQUENCE_N_UNTIL_2TO0() \
n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, \
n, n, n, n, n, n, n, n, n, n, n, n, n, n, 2, 1, 0
#define MCUX_CSSL_CPP_ARG_N( \
_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, \
_18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, \
N, ...) \
N
#define MCUX_CSSL_CPP_ARGCOUNT_IMPL(...) \
MCUX_CSSL_CPP_ARG_N(__VA_ARGS__)
#define MCUX_CSSL_CPP_ARGCOUNT(...) \
MCUX_CSSL_CPP_ARGCOUNT_IMPL(__VA_ARGS__,MCUX_CSSL_CPP_SEQUENCE_32TO0())
#define MCUX_CSSL_CPP_ARGCOUNT_2N(...) \
MCUX_CSSL_CPP_ARGCOUNT_IMPL(__VA_ARGS__,MCUX_CSSL_CPP_SEQUENCE_N_UNTIL_2TO0())
#define MCUX_CSSL_CPP_ARGCOUNT_3N(...) \
MCUX_CSSL_CPP_ARGCOUNT_IMPL(__VA_ARGS__,MCUX_CSSL_CPP_SEQUENCE_N_UNTIL_3TO0())
#define MCUX_CSSL_CPP_ARGCOUNT_4N(...) \
MCUX_CSSL_CPP_ARGCOUNT_IMPL(__VA_ARGS__,MCUX_CSSL_CPP_SEQUENCE_N_UNTIL_4TO0())
#define MCUX_CSSL_CPP_ARGCOUNT_5N(...) \
MCUX_CSSL_CPP_ARGCOUNT_IMPL(__VA_ARGS__,MCUX_CSSL_CPP_SEQUENCE_N_UNTIL_5TO0())
#define MCUX_CSSL_CPP_OVERLOADED_IMPL(name, n) MCUX_CSSL_CPP_CAT_IMPL(name, n)
#define MCUX_CSSL_CPP_OVERLOADED(name, ...) \
MCUX_CSSL_CPP_DEFER2(MCUX_CSSL_CPP_OVERLOADED_IMPL)()(name, MCUX_CSSL_CPP_ARGCOUNT(__VA_ARGS__))
#define MCUX_CSSL_CPP_OVERLOADED1(name, ...) \
MCUX_CSSL_CPP_IF_ELSE(MCUX_CSSL_CPP_HAS_ONE_ARG(__VA_ARGS__))( \
/* If only one arg, use the 1 version */ \
MCUX_CSSL_CPP_CAT(name,1)(MCUX_CSSL_CPP_FIRST(__VA_ARGS__, /* ensure extra argument: */ 0)) \
)( \
/* Otherwise the n version */ \
MCUX_CSSL_CPP_CAT(name,n)(__VA_ARGS__) \
)
#define MCUX_CSSL_CPP_OVERLOADED2(name, ...) \
MCUX_CSSL_CPP_OVERLOADED_IMPL(name, MCUX_CSSL_CPP_ARGCOUNT_2N(__VA_ARGS__))(__VA_ARGS__)
#define MCUX_CSSL_CPP_OVERLOADED3(name, ...) \
MCUX_CSSL_CPP_OVERLOADED_IMPL(name, MCUX_CSSL_CPP_ARGCOUNT_3N(__VA_ARGS__))(__VA_ARGS__)
#define MCUX_CSSL_CPP_OVERLOADED4(name, ...) \
MCUX_CSSL_CPP_OVERLOADED_IMPL(name, MCUX_CSSL_CPP_ARGCOUNT_4N(__VA_ARGS__))(__VA_ARGS__)
#define MCUX_CSSL_CPP_OVERLOADED5(name, ...) \
MCUX_CSSL_CPP_OVERLOADED_IMPL(name, MCUX_CSSL_CPP_ARGCOUNT_5N(__VA_ARGS__))(__VA_ARGS__)
/*****************************************************************************
* Helper macros *
*****************************************************************************/
/* Apply a macro to all arguments */
#define MCUX_CSSL_CPP_MAP(__macro, ...) \
MCUX_CSSL_CPP_EVAL(MCUX_CSSL_CPP_MAP_IMPL(__macro, __VA_ARGS__))
/* Evaluate a complex macro (which needs multiple expansions to be processed) */
#define MCUX_CSSL_CPP_EVAL(...) MCUX_CSSL_CPP_EVAL1024(__VA_ARGS__)
#define MCUX_CSSL_CPP_EVAL1024(...) MCUX_CSSL_CPP_EVAL512(MCUX_CSSL_CPP_EVAL512(__VA_ARGS__))
#define MCUX_CSSL_CPP_EVAL512(...) MCUX_CSSL_CPP_EVAL256(MCUX_CSSL_CPP_EVAL256(__VA_ARGS__))
#define MCUX_CSSL_CPP_EVAL256(...) MCUX_CSSL_CPP_EVAL128(MCUX_CSSL_CPP_EVAL128(__VA_ARGS__))
#define MCUX_CSSL_CPP_EVAL128(...) MCUX_CSSL_CPP_EVAL64( MCUX_CSSL_CPP_EVAL64( __VA_ARGS__))
#define MCUX_CSSL_CPP_EVAL64(...) MCUX_CSSL_CPP_EVAL32( MCUX_CSSL_CPP_EVAL32( __VA_ARGS__))
#define MCUX_CSSL_CPP_EVAL32(...) MCUX_CSSL_CPP_EVAL16( MCUX_CSSL_CPP_EVAL16( __VA_ARGS__))
#define MCUX_CSSL_CPP_EVAL16(...) MCUX_CSSL_CPP_EVAL8( MCUX_CSSL_CPP_EVAL8( __VA_ARGS__))
#define MCUX_CSSL_CPP_EVAL8(...) MCUX_CSSL_CPP_EVAL4( MCUX_CSSL_CPP_EVAL4( __VA_ARGS__))
#define MCUX_CSSL_CPP_EVAL4(...) MCUX_CSSL_CPP_EVAL2( MCUX_CSSL_CPP_EVAL2( __VA_ARGS__))
#define MCUX_CSSL_CPP_EVAL2(...) MCUX_CSSL_CPP_EVAL1( MCUX_CSSL_CPP_EVAL1( __VA_ARGS__))
#define MCUX_CSSL_CPP_EVAL1(...) __VA_ARGS__
/* Recursive definition of map macro, assumes at least one argument */
#define MCUX_CSSL_CPP_MAP_IMPL(__macro, ...) \
/* Apply the macro to the first argument from the list */\
__macro(MCUX_CSSL_CPP_FIRST(__VA_ARGS__, /* ensure second argument: */ 0)) \
/* Only proceed if there are additional arguments */\
MCUX_CSSL_CPP_IF(MCUX_CSSL_CPP_HAS_MORE_ARGS(__VA_ARGS__))( \
/* Recursive call for remaining arguments */\
MCUX_CSSL_CPP_DEFER2(MCUX_CSSL_CPP_MAP_IMPL_)()(__macro, \
MCUX_CSSL_CPP_NEXT(__VA_ARGS__)) \
)
#define MCUX_CSSL_CPP_MAP_IMPL_() MCUX_CSSL_CPP_MAP_IMPL
/* Extract first argument (requires at least two arguments to be present) */
#define MCUX_CSSL_CPP_FIRST(a, ...) a
/* Extract second argument (requires at least three arguments to be present) */
#define MCUX_CSSL_CPP_SECOND(a, b, ...) b
/* Extract third argument (requires at least four arguments to be present) */
#define MCUX_CSSL_CPP_THIRD(a, b, c, ...) c
/* Extract fourth argument (requires at least five arguments to be present) */
#define MCUX_CSSL_CPP_FOURTH(a, b, c, d, ...) d
/* Remove the first argument from the list (requires at least two arguments to be present) */
#define MCUX_CSSL_CPP_NEXT(...) MCUX_CSSL_CPP_NEXT_()(__VA_ARGS__)
#define MCUX_CSSL_CPP_NEXT_() MCUX_CSSL_CPP_NEXT__
#define MCUX_CSSL_CPP_NEXT__(x, ...) __VA_ARGS__
/* Check whether there is more then one argument */
#define MCUX_CSSL_CPP_HAS_MORE_ARGS(...) \
MCUX_CSSL_CPP_NOT(MCUX_CSSL_CPP_IS_MARKER(MCUX_CSSL_CPP_SECOND(__VA_ARGS__, MCUX_CSSL_CPP_MARKER(), MCUX_CSSL_CPP_MARKER())))
#define MCUX_CSSL_CPP_HAS_ONE_ARG(...) \
MCUX_CSSL_CPP_IS_MARKER(MCUX_CSSL_CPP_SECOND(__VA_ARGS__, MCUX_CSSL_CPP_MARKER(), MCUX_CSSL_CPP_MARKER()))
#define MCUX_CSSL_CPP_HAS_TWO_ARGS(...) \
MCUX_CSSL_CPP_IS_MARKER(MCUX_CSSL_CPP_THIRD(__VA_ARGS__, MCUX_CSSL_CPP_MARKER(), MCUX_CSSL_CPP_MARKER(), MCUX_CSSL_CPP_MARKER()))
#define MCUX_CSSL_CPP_HAS_THREE_ARGS(...) \
MCUX_CSSL_CPP_IS_MARKER(MCUX_CSSL_CPP_FOURTH(__VA_ARGS__, MCUX_CSSL_CPP_MARKER(), MCUX_CSSL_CPP_MARKER(), MCUX_CSSL_CPP_MARKER(), MCUX_CSSL_CPP_MARKER()))
/* Check whether the argument is MCUX_CSSL_CPP_MARKER(), return 1 if it is */
#define MCUX_CSSL_CPP_IS_MARKER(...) \
MCUX_CSSL_CPP_SECOND(__VA_ARGS__, 0, 0)
#define MCUX_CSSL_CPP_MARKER() \
~, 1
/* Convert any argument into a bool (either 0 or 1), by double negation */
#define MCUX_CSSL_CPP_BOOL(x) MCUX_CSSL_CPP_NOT(MCUX_CSSL_CPP_NOT(x))
/* Boolean negation (map value 0 to the marker, and check if we have the marker) */
#define MCUX_CSSL_CPP_NOT(x) MCUX_CSSL_CPP_IS_MARKER(MCUX_CSSL_CPP_CAT(MCUX_CSSL_CPP_NOT_BOOL_, x))
#define MCUX_CSSL_CPP_NOT_BOOL_0 MCUX_CSSL_CPP_MARKER()
/* Convert condition to bool */
#define MCUX_CSSL_CPP_IF(condition) MCUX_CSSL_CPP_IF_(MCUX_CSSL_CPP_BOOL(condition))
/* Convert bool to decision defines */
#define MCUX_CSSL_CPP_IF_(condition) MCUX_CSSL_CPP_CAT(MCUX_CSSL_CPP_IF_BOOL_, condition)
/* If 0, do nothing*/
#define MCUX_CSSL_CPP_IF_BOOL_0(...)
/* If 1, perform action */
#define MCUX_CSSL_CPP_IF_BOOL_1(...) __VA_ARGS__
/* Convert condition to bool */
#define MCUX_CSSL_CPP_IF_ELSE(condition) MCUX_CSSL_CPP_IF_ELSE_IMPL(MCUX_CSSL_CPP_BOOL(condition))
/* Convert bool to decision defines */
#define MCUX_CSSL_CPP_IF_ELSE_IMPL(condition) MCUX_CSSL_CPP_CAT(MCUX_CSSL_CPP_IFE_BOOL_, condition)
/* If 0, ignore action */
#define MCUX_CSSL_CPP_IFE_BOOL_0(...) MCUX_CSSL_CPP_IFE_BOOL_0_ELSE
/* Else 0, perform action */
#define MCUX_CSSL_CPP_IFE_BOOL_0_ELSE(...) __VA_ARGS__
/* If 1, perform action */
#define MCUX_CSSL_CPP_IFE_BOOL_1(...) __VA_ARGS__ MCUX_CSSL_CPP_IFE_BOOL_1_ELSE
/* Else 1, ignore action */
#define MCUX_CSSL_CPP_IFE_BOOL_1_ELSE(...)
/* Defer macro expansion */
#define MCUX_CSSL_CPP_EMPTY()
#define MCUX_CSSL_CPP_DEFER1(macro) macro MCUX_CSSL_CPP_EMPTY()
#define MCUX_CSSL_CPP_DEFER2(macro) macro MCUX_CSSL_CPP_EMPTY MCUX_CSSL_CPP_EMPTY()()
#endif /* MCUX_CSSL_C_PRE_PROCESSOR_H_ */
@@ -0,0 +1,151 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2023 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/**
* @file mcuxCsslDataIntegrity.h
* @brief Provides the API for the CSSL data integrity mechanism.
*/
#ifndef MCUXCSSLDATAINTEGRITY_H_
#define MCUXCSSLDATAINTEGRITY_H_
/* Include the Secure Counter definitions */
#include <mcuxCsslSecureCounter.h>
/* Include the actual implementation of the data integrity mechanism. */
#include <mcuxCsslDataIntegrity_Impl.h>
/**
* @addtogroup mcuxCsslAPI MCUX CSSL -- API
*
* @defgroup mcuxCsslDataIntegrity Data Integrity API
* @brief Data integrity mechanism.
* @ingroup mcuxCsslAPI
*/
/**
* @defgroup diCore Data integrity core functionality
* @brief Data integrity handling core functionality.
* @ingroup mcuxCsslDataIntegrity
*/
/****************************************************************************/
/* Constants */
/****************************************************************************/
/**
* @def MCUX_CSSL_DI_CHECK_PASSED
* @brief Positive comparison result value.
* @api
* @ingroup diCore
*/
#define MCUX_CSSL_DI_CHECK_PASSED \
MCUX_CSSL_DI_CHECK_PASSED_IMPL
/**
* @def MCUX_CSSL_DI_CHECK_FAILED
* @brief Negative comparison result value.
* @api
* @ingroup diCore
*/
#define MCUX_CSSL_DI_CHECK_FAILED \
MCUX_CSSL_DI_CHECK_FAILED_IMPL
/****************************************************************************/
/* Initialization */
/****************************************************************************/
/**
* @def MCUX_CSSL_DI_INIT
* @brief Backup of the current data integrity value, that will be checked later
* on with MCUX_CSSL_SC_CHECK.
* Note that in case the Security Counter back-end requires allocation, it
* is expected that this will be handled by the Flow Protection mechanism
* before the initialization of the Data Integrity.
* @api
* @ingroup diCore
*
* @param backupValue Fresh variable name to store the current DI value.
*/
#define MCUX_CSSL_DI_INIT(backupValue) \
MCUX_CSSL_DI_INIT_IMPL(backupValue)
/****************************************************************************/
/* Check */
/****************************************************************************/
/**
* @def MCUX_CSSL_DI_CHECK
* @brief Comparison operation for the data integrity.
* @api
* @ingroup diCore
*
* @param reference Reference value to compare the data integrity value against.
* @return Either #MCUX_CSSL_DI_CHECK_PASSED, if the value matches, or
* #MCUX_CSSL_DI_CHECK_FAILED if the value is different.
*/
#define MCUX_CSSL_DI_CHECK(reference) \
MCUX_CSSL_DI_CHECK_IMPL(reference)
/**
* @def MCUX_CSSL_DI_CHECK_EXIT
* @brief Comparison operation for the data integrity.
* It compares the data integrity value to reference value, and exits
* with the given fault status code if the comparison fails.
* If the comparison succeeds, the normal execution will continue.
* @api
* @ingroup diCore
*
* @param id Identifier of the function from which we will exit.
* @param reference Reference value to compare the data integrity value against.
* @param fail Result that should be returned if the data integrity check failed.
*/
#define MCUX_CSSL_DI_CHECK_EXIT(id, reference, fail) \
MCUX_CSSL_DI_CHECK_EXIT_IMPL(id, reference, fail)
/****************************************************************************/
/* Updates */
/****************************************************************************/
/**
* @defgroup diUpdate Data integrity record
* @brief Support for recording a value in the data integrity register
* @ingroup mcuxCsslDataIntegrity
*/
/**
* @def MCUX_CSSL_DI_RECORD
* @brief Record the @p value for data integrity checking.
* @api
* @ingroup diUpdate
*
* @param identifier Identifier for the @p value that will be recorded.
* @param value Value which needs to be recorded for the given @p identifier.
*/
#define MCUX_CSSL_DI_RECORD(identifier, value) \
MCUX_CSSL_DI_RECORD_IMPL(identifier, value)
/**
* @def MCUX_CSSL_DI_EXPUNGE
* @brief Expunge the record for @p value.
* @api
* @ingroup diUpdate
*
* @param identifier Identifier for the @p value that will be expunged.
* @param value Expected value that was recorded for the given @p identifier.
*/
#define MCUX_CSSL_DI_EXPUNGE(identifier, value) \
MCUX_CSSL_DI_EXPUNGE_IMPL(identifier, value)
#endif /* MCUXCSSLDATAINTEGRITY_H_ */
@@ -0,0 +1,47 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2023 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/**
* \file mcuxCsslDataIntegrity_Cfg.h
* \brief Configuration of the implementation for the data integrity mechanism.
*/
#ifndef MCUXCSSLDATAINTEGRITY_CFG_H_
#define MCUXCSSLDATAINTEGRITY_CFG_H_
/**
* \addtogroup mcuxCsslCFG MCUX CSSL -- Configurations
*
* \defgroup mcuxCsslDataIntegrity_CFG Data Integrity Configuration
* \brief Configuration options for the data integrity mechanism.
* \ingroup mcuxCsslCFG
*/
/**
* \def MCUX_CSSL_DI_USE_SECURE_COUNTER
* \brief If set to 1, use the data integrity mechanism implementation based on
* the CSSL secure counter mechanism.
* \ingroup mcuxCsslDataIntegrity_CFG
*/
#define MCUX_CSSL_DI_USE_SECURE_COUNTER 0
/**
* \def MCUX_CSSL_DI_USE_NONE
* \brief If set to 1, do not use the data integrity mechanism.
* \ingroup mcuxCsslDataIntegrity_CFG
*/
#define MCUX_CSSL_DI_USE_NONE 1
/* Basic configuration sanity check */
#endif /* MCUXCSSLDATAINTEGRITY_CFG_H_ */
@@ -0,0 +1,34 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2023 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/**
* \file mcuxCsslDataIntegrity_Impl.h
* \brief Selection of the implementation for the data integrity mechanism.
*/
#ifndef MCUXCSSLDATAINTEGRITY_IMPL_H_
#define MCUXCSSLDATAINTEGRITY_IMPL_H_
/* Include the configuration for the data integrity mechanism. */
#include <mcuxCsslDataIntegrity_Cfg.h>
/* Include the selected implementation of the data integrity mechanism. */
#if defined(MCUX_CSSL_DI_USE_SECURE_COUNTER) && (1 == MCUX_CSSL_DI_USE_SECURE_COUNTER)
# include <mcuxCsslDataIntegrity_SecureCounter.h>
#elif defined(MCUX_CSSL_DI_USE_NONE) && (1 == MCUX_CSSL_DI_USE_NONE)
# include <mcuxCsslDataIntegrity_None.h>
#else
#error "No data integrity implementation found/configured."
#endif
#endif /* MCUXCSSLDATAINTEGRITY_IMPL_H_ */
@@ -0,0 +1,130 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2023 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/**
* \file mcuxCsslDataIntegrity_None.h
* \brief Implementation that disables the CSSL data integrity mechanism.
*/
#ifndef MCUXCSSLDATAINTEGRITY_NONE_H_
#define MCUXCSSLDATAINTEGRITY_NONE_H_
/**
* \addtogroup mcuxCsslIMPL MCUX CSSL -- Implementations
*
* \defgroup mcuxCsslDataIntegrity_None Data Integrity: Disabled
* \brief Disable the data integrity mechanism.
* \ingroup mcuxCsslIMPL
*/
/**
* \defgroup diNoneCore Data integrity core functionality
* \brief Data integrity handling core functionality, when data integrity is disabled.
* \ingroup mcuxCsslDataIntegrity_None
*/
/****************************************************************************/
/* Constants */
/****************************************************************************/
/**
* \def MCUX_CSSL_DI_CHECK_PASSED_IMPL
* \brief Positive comparison result value.
* \ingroup diNoneCore
*/
#define MCUX_CSSL_DI_CHECK_PASSED_IMPL (MCUX_CSSL_SC_CHECK_PASSED)
/**
* \def MCUX_CSSL_DI_CHECK_FAILED_IMPL
* \brief Negative comparison result value.
* \ingroup diNoneCore
*/
#define MCUX_CSSL_DI_CHECK_FAILED_IMPL (MCUX_CSSL_SC_CHECK_FAILED)
/****************************************************************************/
/* Initialization */
/****************************************************************************/
/**
* \def MCUX_CSSL_DI_INIT_IMPL
* \brief Initialize the backup of the data integrity value to zero.
* \ingroup diNoneCore
*
* @param backupValue Fresh variable name to store the current DI value.
*/
#define MCUX_CSSL_DI_INIT_IMPL(backupValue) \
uint32_t backupValue = 0u
/****************************************************************************/
/* Check */
/****************************************************************************/
/**
* \def MCUX_CSSL_DI_CHECK_IMPL
* \brief Comparison operation implementation for the data integrity.
* \ingroup diNoneCore
*
* \param reference Reference value to compare the data integrity value against.
* \return Always #MCUX_CSSL_DI_CHECK_PASSED.
*/
#define MCUX_CSSL_DI_CHECK_IMPL(reference) \
(MCUX_CSSL_DI_CHECK_PASSED_IMPL)
/**
* \def MCUX_CSSL_DI_CHECK_EXIT_IMPL
* \brief Comparison operation implementation for the data integrity.
* It has no impact on the normal execution of the calling function.
* \ingroup diNoneCore
*
* \param id Identifier of the function from which we will exit (ignored).
* \param reference Reference value to compare the data integrity value against.
* \param fail Result that should be returned if the data integrity check failed (ignored).
*/
#define MCUX_CSSL_DI_CHECK_EXIT_IMPL(id, reference, fail) \
(void)(reference)
/****************************************************************************/
/* Updates */
/****************************************************************************/
/**
* \defgroup diNoneUpdate Data integrity record
* \brief Support for recording a value in the data integrity register, when data integrity is disabled.
* \ingroup mcuxCsslDataIntegrity_None
*/
/**
* \def MCUX_CSSL_DI_RECORD_IMPL
* \brief Implementation: Record the value for data integrity checking.
* \ingroup diNoneUpdate
*
* \param identifier Identifier for the value that will be recorded.
* \param value Value which needs to be recorded for the given identifier.
*/
#define MCUX_CSSL_DI_RECORD_IMPL(identifier, value) \
/* intentionally empty */
/**
* \def MCUX_CSSL_DI_EXPUNGE_IMPL
* \brief Implementation: Expunge the record for value.
* \ingroup diNoneUpdate
*
* \param identifier Identifier for the value that will be expunged.
* \param value Expected value that was recorded for the given identifier.
*/
#define MCUX_CSSL_DI_EXPUNGE_IMPL(identifier, value) \
/* intentionally empty */
#endif /* MCUXCSSLDATAINTEGRITY_NONE_H_ */
@@ -0,0 +1,55 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2020 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/**
* \file mcuxCsslFlowProtection_Cfg.h
* \brief Configuration of the implementation for the flow protection mechanism.
*/
#ifndef MCUX_CSSL_FLOW_PROTECTION_CFG_H_
#define MCUX_CSSL_FLOW_PROTECTION_CFG_H_
/**
* \addtogroup mcuxCsslCFG MCUX CSSL -- Configurations
*
* \defgroup mcuxCsslFlowProtection_CFG Flow Protection Configuration
* \brief Configuration options for the flow protection mechanism.
* \ingroup mcuxCsslCFG
*/
/**
* \def MCUX_CSSL_FP_USE_CODE_SIGNATURE
* \brief If set to 1, use the flow protection mechanism implementation based on
* the Zen-V code signature HW mechanism.
* \ingroup mcuxCsslFlowProtection_CFG
*/
#define MCUX_CSSL_FP_USE_CODE_SIGNATURE 0
/**
* \def MCUX_CSSL_FP_USE_SECURE_COUNTER
* \brief If set to 1, use the flow protection mechanism implementation based on
* the CSSL secure counter mechanism.
* \ingroup mcuxCsslFlowProtection_CFG
*/
#define MCUX_CSSL_FP_USE_SECURE_COUNTER 1
/**
* \def MCUX_CSSL_FP_USE_NONE
* \brief If set to 1, do not use the flow protection mechanism.
* \ingroup mcuxCsslFlowProtection_CFG
*/
#define MCUX_CSSL_FP_USE_NONE 0
/* Basic configuration sanity check */
#endif /* MCUX_CSSL_FLOW_PROTECTION_CFG_H_ */
@@ -0,0 +1,129 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2020-2023 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/**
* @file mcuxCsslFlowProtection_FunctionIdentifiers.h
* @brief Definition of function identifiers for the flow protection mechanism.
*
* @note This file might be post-processed to update the identifier values to
* proper/secure values.
*/
#ifndef MCUX_CSSL_FLOW_PROTECTION_FUNCTION_IDENTIFIERS_H_
#define MCUX_CSSL_FLOW_PROTECTION_FUNCTION_IDENTIFIERS_H_
/* Flow Protection example values: */
#define MCUX_CSSL_FP_FUNCID_functionOnly0 (0x50DDu)
#define MCUX_CSSL_FP_FUNCID_functionOnly1 (0x5595u)
#define MCUX_CSSL_FP_FUNCID_functionOnly2 (0x6B52u)
#define MCUX_CSSL_FP_FUNCID_functionCall (0x50BBu)
#define MCUX_CSSL_FP_FUNCID_functionCalls (0x4E71u)
#define MCUX_CSSL_FP_FUNCID_functionLoop (0x4AF2u)
#define MCUX_CSSL_FP_FUNCID_functionBranch (0x0D3Bu)
#define MCUX_CSSL_FP_FUNCID_functionSwitch (0x22AFu)
#define MCUX_CSSL_FP_FUNCID_functionComplex (0x781Bu)
#define MCUX_CSSL_FP_FUNCID_data_invariant_memory_compare (0x562Bu)
#define MCUX_CSSL_FP_FUNCID_data_invariant_memory_copy (0x4AA7u)
#define MCUX_CSSL_FP_FUNCID_functionAssert (0x21DEu)
/* Values for production use: */
#define MCUX_CSSL_FP_FUNCID_mcuxCsslParamIntegrity_Validate (0x1AA7u)
#define MCUX_CSSL_FP_FUNCID_mcuxCsslMemory_Compare (0x696Cu)
#define MCUX_CSSL_FP_FUNCID_mcuxCsslMemory_Copy (0x7D21u)
#define MCUX_CSSL_FP_FUNCID_mcuxCsslMemory_Clear (0x42D7u)
#define MCUX_CSSL_FP_FUNCID_mcuxCsslMemory_Set (0x44F9u)
#define MCUX_CSSL_FP_FUNCID_mcuxCsslMemory_SecureClear (0x29BCu)
#define MCUX_CSSL_FP_FUNCID_mcuxCsslMemory_SecureCopy (0x27AAu)
#define MCUX_CSSL_FP_FUNCID_mcuxCsslMemory_SecureSet (0x5B58u)
#define MCUX_CSSL_FP_FUNCID_mcuxCsslMemory_SecureCompare (0x79C2u)
#define MCUX_CSSL_FP_FUNCID_mcuxCsslMemory_DPASecureCompare (0x5AF0u)
#define MCUX_CSSL_FP_FUNCID_mcuxCsslMemory_Int_DPASecComp (0x629Du)
#define MCUX_CSSL_FP_FUNCID_mcuxCsslMemory_Int_CopyPow2 (0x53C3u)
#define MCUX_CSSL_FP_FUNCID_mcuxCsslMemory_Int_CopyWords (0x3761u)
#define MCUX_CSSL_FP_FUNCID_mcuxCsslMemory_Int_SecCopyPow2 (0x4A5Du)
#define MCUX_CSSL_FP_FUNCID_mcuxCsslMemory_Int_SecComp (0x187Eu)
#define MCUX_CSSL_FP_FUNCID_mcuxCsslMemory_Int_SecClear (0x2C3Bu)
#define MCUX_CSSL_FP_FUNCID_mcuxCsslMemory_Int_SecSet (0x6655u)
#define MCUX_CSSL_FP_FUNCID_mcuxCsslMemory_SecureXOR (0x3366u)
#define MCUX_CSSL_FP_FUNCID_mcuxCsslMemory_SecureXORWithConst (0x4A97u)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_14 (0x17C5u)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_15 (0x1E8Eu)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_16 (0x26A7u)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_17 (0x14F9u)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_18 (0x43E9u)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_19 (0x533Cu)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_20 (0x2EC5u)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_21 (0x7D44u)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_22 (0x2AE3u)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_23 (0x7274u)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_24 (0x7CE0u)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_25 (0x4DC5u)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_26 (0x3E94u)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_27 (0x75A4u)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_28 (0x35E4u)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_29 (0x63F0u)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_30 (0x62BAu)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_31 (0x7549u)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_32 (0x77C0u)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_33 (0x662Eu)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_34 (0x521Fu)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_35 (0x6671u)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_36 (0x711Du)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_37 (0x684Fu)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_38 (0x52EAu)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_39 (0x1EACu)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_40 (0x4D66u)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_41 (0x4557u)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_42 (0x25F2u)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_43 (0x278Bu)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_44 (0x3C55u)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_45 (0x1796u)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_46 (0x6732u)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_47 (0x67D0u)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_48 (0x5627u)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_49 (0x6AB1u)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_50 (0x5927u)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_51 (0x51CEu)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_52 (0x7585u)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_53 (0x78B1u)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_54 (0x0B5Du)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_55 (0x6A87u)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_56 (0x19ABu)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_57 (0x57C1u)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_58 (0x589Du)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_59 (0x61E3u)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_60 (0x0D2Fu)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_61 (0x5B1Cu)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_62 (0x3CD4u)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_63 (0x0C6Fu)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_64 (0x21BDu)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_65 (0x1D9Cu)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_66 (0x5674u)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_67 (0x60DDu)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_68 (0x78AAu)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_69 (0x0F36u)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_70 (0x6B2Au)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_71 (0x2D63u)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_72 (0x2F16u)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_73 (0x4F1Cu)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_74 (0x5B83u)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_75 (0x7833u)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_76 (0x3B26u)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_77 (0x34DCu)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_78 (0x6E46u)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_79 (0x6F21u)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_80 (0x2937u)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_81 (0x1BE2u)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_82 (0x2A9Bu)
#define MCUX_CSSL_FP_FUNCID_mcuxCssl_unused_83 (0x78A3u)
#endif /* MCUX_CSSL_FLOW_PROTECTION_FUNCTION_IDENTIFIERS_H_ */
@@ -0,0 +1,43 @@
/*--------------------------------------------------------------------------*/
/* Copyright 2020-2022 NXP */
/* */
/* NXP Confidential. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable license */
/* terms, then you may not retain, install, activate or otherwise use the */
/* software. */
/*--------------------------------------------------------------------------*/
/**
* \file mcuxCsslFlowProtection_Impl.h
* \brief Selection of the implementation for the flow protection mechanism.
*/
#ifndef MCUX_CSSL_FLOW_PROTECTION_IMPL_H_
#define MCUX_CSSL_FLOW_PROTECTION_IMPL_H_
/* Include the configuration for the flow protection mechanism. */
#include <mcuxCsslFlowProtection_Cfg.h>
/* Include the selected implementation of the flow protection mechanism. */
#if defined(MCUX_CSSL_FP_USE_CODE_SIGNATURE) && (1 == MCUX_CSSL_FP_USE_CODE_SIGNATURE)
# include <mcuxCsslFlowProtection_CodeSignature.h>
#elif defined(MCUX_CSSL_FP_USE_SECURE_COUNTER) \
&& (1 == MCUX_CSSL_FP_USE_SECURE_COUNTER)
# include <mcuxCsslSecureCounter_Cfg.h>
# include <mcuxCsslFlowProtection_SecureCounter_Common.h>
# if defined(MCUX_CSSL_SC_USE_SW_LOCAL) && (1 == MCUX_CSSL_SC_USE_SW_LOCAL)
# include <mcuxCsslFlowProtection_SecureCounter_Local.h>
# else
# include <mcuxCsslFlowProtection_SecureCounter_Global.h>
# endif
#elif defined(MCUX_CSSL_FP_USE_NONE) && (1 == MCUX_CSSL_FP_USE_NONE)
# include <mcuxCsslFlowProtection_None.h>
#else
#error "No flow protection implementation found/configured."
#endif
#endif /* MCUX_CSSL_FLOW_PROTECTION_IMPL_H_ */
Loaded 100 of 620 files, more files were not shown because too many files have changed in this diff. Show more