-
Notifications
You must be signed in to change notification settings - Fork 850
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce wolfssl_AES_CTR ARduino example
- Loading branch information
Showing
7 changed files
with
610 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Arduino AES CTR Example | ||
|
||
Open the [wolfssl_AES_CTR.ino](./wolfssl_AES_CTR.ino) file in the Arduino IDE. | ||
|
||
Other IDE products are also supported, such as: | ||
|
||
- [PlatformIO in VS Code](https://docs.platformio.org/en/latest/frameworks/arduino.html) | ||
- [VisualGDB](https://visualgdb.com/tutorials/arduino/) | ||
- [VisualMicro](https://www.visualmicro.com/) | ||
|
||
For examples on other platforms, see the [IDE directory](https://github.com/wolfssl/wolfssl/tree/master/IDE). | ||
Additional examples can be found on [wolfSSL/wolfssl-examples](https://github.com/wolfSSL/wolfssl-examples/). | ||
|
||
|
||
### Troubleshooting | ||
|
||
When encountering odd errors such as `undefined reference to ``_impure_ptr'`, such as this: | ||
|
||
```text | ||
c:/users/gojimmypi/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\gojimmypi\AppData\Local\Temp\arduino\sketches\EAB8D79A02D1ECF107884802D893914E\libraries\wolfSSL\wolfcrypt\src\logging.c.o:(.literal.wolfssl_log+0x8): undefined reference to `_impure_ptr' | ||
collect2.exe: error: ld returned 1 exit status | ||
exit status 1 | ||
Compilation error: exit status 1 | ||
``` | ||
|
||
Try cleaning the Arduino cache directories. For Windows, that's typically in: | ||
|
||
```text | ||
C:\Users\%USERNAME%\AppData\Local\Temp\arduino\sketches | ||
``` | ||
|
||
Remove all other boards from other serial ports, leaving one the one being programmed. |
21 changes: 21 additions & 0 deletions
21
IDE/ARDUINO/sketches/wolfssl_AES_CTR/wolfssl_AES_CTR.adeps
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!-- Add this file to source control in order to automatically restore library dependencies when opening the project on another machine --> | ||
<ArduinoDependencyCollection xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
<Dependencies> | ||
<Dependency> | ||
<Type>Platform</Type> | ||
<Key> | ||
<Packager>teensy</Packager> | ||
<Name>avr</Name> | ||
<Version>1.59.0</Version> | ||
</Key> | ||
</Dependency> | ||
<Dependency> | ||
<Type>Library</Type> | ||
<Key> | ||
<Packager>wolfSSL Inc.</Packager> | ||
<Name>wolfssl</Name> | ||
<Version>5.7.6</Version> | ||
</Key> | ||
</Dependency> | ||
</Dependencies> | ||
</ArduinoDependencyCollection> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.12.35728.132 d17.12 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{803FD0C6-D64E-4E16-9DC3-1DAEC859A3D2}") = "wolfssl_AES_CTR", "wolfssl_AES_CTR.vgdbproj", "{86FF6ABD-3C7F-446C-B2CE-93E488EA77D9}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Teensy_4 1 = Debug|Teensy_4 1 | ||
Release|Teensy_4 1 = Release|Teensy_4 1 | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{86FF6ABD-3C7F-446C-B2CE-93E488EA77D9}.Debug|Teensy_4 1.ActiveCfg = Debug|Teensy_4 1 | ||
{86FF6ABD-3C7F-446C-B2CE-93E488EA77D9}.Debug|Teensy_4 1.Build.0 = Debug|Teensy_4 1 | ||
{86FF6ABD-3C7F-446C-B2CE-93E488EA77D9}.Release|Teensy_4 1.ActiveCfg = Release|Teensy_4 1 | ||
{86FF6ABD-3C7F-446C-B2CE-93E488EA77D9}.Release|Teensy_4 1.Build.0 = Release|Teensy_4 1 | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
EndGlobal |
249 changes: 249 additions & 0 deletions
249
IDE/ARDUINO/sketches/wolfssl_AES_CTR/wolfssl_AES_CTR.vgdbproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,249 @@ | ||
<?xml version="1.0"?> | ||
<VisualGDBProjectSettings2 xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
<Project xsi:type="com.visualgdb.project.external.arduino"> | ||
<CustomSourceDirectories> | ||
<Directories /> | ||
<PathStyle>Unknown</PathStyle> | ||
</CustomSourceDirectories> | ||
<AutoProgramSPIFFSPartition>true</AutoProgramSPIFFSPartition> | ||
<ProjectModeSettings> | ||
<ProjectGUID>86ff6abd-3c7f-446c-b2ce-93e488ea77d9</ProjectGUID> | ||
<GroupSourcesByTypes>true</GroupSourcesByTypes> | ||
<GroupSourcesByPaths>true</GroupSourcesByPaths> | ||
<SketchSubdirectory>wolfssl_AES_CTR</SketchSubdirectory> | ||
<MainSketchFile>wolfssl_AES_CTR.ino</MainSketchFile> | ||
<RootSketchFolder> | ||
<Subfolders /> | ||
<Files> | ||
<string>wolfssl_AES_CTR.ino</string> | ||
</Files> | ||
</RootSketchFolder> | ||
<OtherFiles /> | ||
</ProjectModeSettings> | ||
</Project> | ||
<Build xsi:type="com.visualgdb.build.external.arduino"> | ||
<BuildLogMode xsi:nil="true" /> | ||
<IgnoreNormalLibraryDirectories>false</IgnoreNormalLibraryDirectories> | ||
<OutputSubdirectory>Output\$(PlatformName.defuse)\$(ConfigurationName.defuse)</OutputSubdirectory> | ||
<EnableVerboseBuild>false</EnableVerboseBuild> | ||
<PreprocessorMacros /> | ||
<ExtraLinkerFlags> | ||
<string>-Wl,-q</string> | ||
</ExtraLinkerFlags> | ||
<AutoBuildSPIFFSPartition>true</AutoBuildSPIFFSPartition> | ||
</Build> | ||
<CustomBuild> | ||
<PreSyncActions /> | ||
<PreBuildActions /> | ||
<PostBuildActions /> | ||
<PreCleanActions /> | ||
<PostCleanActions /> | ||
</CustomBuild> | ||
<CustomDebug> | ||
<PreDebugActions /> | ||
<PostDebugActions /> | ||
<DebugStopActions /> | ||
<BreakMode>Default</BreakMode> | ||
</CustomDebug> | ||
<DeviceTerminalSettings> | ||
<Connection xsi:type="com.sysprogs.terminal.connection.serial"> | ||
<ComPortName>COM102</ComPortName> | ||
<AdvancedSettings> | ||
<BaudRate>115200</BaudRate> | ||
<DataBits>8</DataBits> | ||
<Parity>None</Parity> | ||
<StopBits>One</StopBits> | ||
<FlowControl>None</FlowControl> | ||
</AdvancedSettings> | ||
</Connection> | ||
<LastConnectionTime>0</LastConnectionTime> | ||
<EchoTypedCharacters>false</EchoTypedCharacters> | ||
<ClearContentsWhenReconnecting>false</ClearContentsWhenReconnecting> | ||
<ReconnectAutomatically>false</ReconnectAutomatically> | ||
<DisplayMode>ASCII</DisplayMode> | ||
<Colors> | ||
<Background> | ||
<Alpha>255</Alpha> | ||
<Red>0</Red> | ||
<Green>0</Green> | ||
<Blue>0</Blue> | ||
</Background> | ||
<Disconnected> | ||
<Alpha>255</Alpha> | ||
<Red>169</Red> | ||
<Green>169</Green> | ||
<Blue>169</Blue> | ||
</Disconnected> | ||
<Text> | ||
<Alpha>255</Alpha> | ||
<Red>211</Red> | ||
<Green>211</Green> | ||
<Blue>211</Blue> | ||
</Text> | ||
<Echo> | ||
<Alpha>255</Alpha> | ||
<Red>144</Red> | ||
<Green>238</Green> | ||
<Blue>144</Blue> | ||
</Echo> | ||
<Inactive> | ||
<Alpha>255</Alpha> | ||
<Red>169</Red> | ||
<Green>169</Green> | ||
<Blue>169</Blue> | ||
</Inactive> | ||
</Colors> | ||
<HexSettings> | ||
<MaximumBytesPerLine>16</MaximumBytesPerLine> | ||
<ShowTextView>true</ShowTextView> | ||
<BreaksAroundEcho>true</BreaksAroundEcho> | ||
<AutoSend>true</AutoSend> | ||
<SendAsHex>true</SendAsHex> | ||
<TimeoutForAutoBreak>0</TimeoutForAutoBreak> | ||
</HexSettings> | ||
<LineEnding>LF</LineEnding> | ||
<TreatLFAsCRLF>false</TreatLFAsCRLF> | ||
<KeepOpenAfterExit>true</KeepOpenAfterExit> | ||
<ShowAfterProgramming>true</ShowAfterProgramming> | ||
</DeviceTerminalSettings> | ||
<CustomShortcuts> | ||
<Shortcuts /> | ||
<ShowMessageAfterExecuting>true</ShowMessageAfterExecuting> | ||
</CustomShortcuts> | ||
<UserDefinedVariables /> | ||
<ImportedPropertySheets /> | ||
<CodeSense> | ||
<Enabled>Unknown</Enabled> | ||
<ExtraSettings> | ||
<HideErrorsInSystemHeaders>true</HideErrorsInSystemHeaders> | ||
<SupportLightweightReferenceAnalysis>true</SupportLightweightReferenceAnalysis> | ||
<CheckForClangFormatFiles>true</CheckForClangFormatFiles> | ||
<FormattingEngine xsi:nil="true" /> | ||
</ExtraSettings> | ||
<CodeAnalyzerSettings> | ||
<Enabled>false</Enabled> | ||
</CodeAnalyzerSettings> | ||
</CodeSense> | ||
<Configurations> | ||
<VisualGDBConfiguration> | ||
<PlatformName>Teensy_4 1</PlatformName> | ||
<DebugSettingsOverride xsi:type="com.visualgdb.debug.embedded"> | ||
<AdditionalStartupCommands /> | ||
<AdditionalGDBSettings> | ||
<Features> | ||
<DisableAutoDetection>false</DisableAutoDetection> | ||
<UseFrameParameter>false</UseFrameParameter> | ||
<SimpleValuesFlagSupported>false</SimpleValuesFlagSupported> | ||
<ListLocalsSupported>false</ListLocalsSupported> | ||
<ByteLevelMemoryCommandsAvailable>false</ByteLevelMemoryCommandsAvailable> | ||
<ThreadInfoSupported>false</ThreadInfoSupported> | ||
<PendingBreakpointsSupported>false</PendingBreakpointsSupported> | ||
<SupportTargetCommand>false</SupportTargetCommand> | ||
<ReliableBreakpointNotifications>false</ReliableBreakpointNotifications> | ||
</Features> | ||
<EnableSmartStepping>false</EnableSmartStepping> | ||
<FilterSpuriousStoppedNotifications>false</FilterSpuriousStoppedNotifications> | ||
<ForceSingleThreadedMode>false</ForceSingleThreadedMode> | ||
<UseAppleExtensions>false</UseAppleExtensions> | ||
<CanAcceptCommandsWhileRunning>false</CanAcceptCommandsWhileRunning> | ||
<MakeLogFile>false</MakeLogFile> | ||
<IgnoreModuleEventsWhileStepping>true</IgnoreModuleEventsWhileStepping> | ||
<UseRelativePathsOnly>false</UseRelativePathsOnly> | ||
<ExitAction>None</ExitAction> | ||
<DisableDisassembly>false</DisableDisassembly> | ||
<ExamineMemoryWithXCommand>false</ExamineMemoryWithXCommand> | ||
<StepIntoNewInstanceEntry>main</StepIntoNewInstanceEntry> | ||
<ExamineRegistersInRawFormat>true</ExamineRegistersInRawFormat> | ||
<DisableSignals>false</DisableSignals> | ||
<EnableAsyncExecutionMode>false</EnableAsyncExecutionMode> | ||
<AsyncModeSupportsBreakpoints>true</AsyncModeSupportsBreakpoints> | ||
<TemporaryBreakConsolidationTimeout>0</TemporaryBreakConsolidationTimeout> | ||
<EnableNonStopMode>false</EnableNonStopMode> | ||
<MaxBreakpointLimit>0</MaxBreakpointLimit> | ||
<EnableVerboseMode>true</EnableVerboseMode> | ||
<EnablePrettyPrinters>false</EnablePrettyPrinters> | ||
<EnableAbsolutePathReporting>true</EnableAbsolutePathReporting> | ||
</AdditionalGDBSettings> | ||
<DebugMethod> | ||
<ID>com.sysprogs.arm.openocd</ID> | ||
<Configuration xsi:type="com.visualgdb.edp.openocd.settings"> | ||
<CommandLine>-f interface/ftdi/tigard.cfg -f target/imxrt.cfg -c "adapter speed 3000"</CommandLine> | ||
<ExtraParameters> | ||
<Frequency xsi:nil="true" /> | ||
<BoostedFrequency xsi:nil="true" /> | ||
<ConnectUnderReset>false</ConnectUnderReset> | ||
</ExtraParameters> | ||
<LoadProgressGUIThreshold>131072</LoadProgressGUIThreshold> | ||
<ProgramMode>Enabled</ProgramMode> | ||
<StartupCommands> | ||
<string>set remotetimeout 60</string> | ||
<string>target extended-remote :$$SYS:GDB_PORT$$</string> | ||
<string>load</string> | ||
</StartupCommands> | ||
<ProgramFLASHUsingExternalTool>false</ProgramFLASHUsingExternalTool> | ||
<PreferredGDBPort>0</PreferredGDBPort> | ||
<PreferredTelnetPort>0</PreferredTelnetPort> | ||
<AlwaysPassSerialNumber>false</AlwaysPassSerialNumber> | ||
<SelectedCoreIndex xsi:nil="true" /> | ||
<LiveMemoryTimeout>5000</LiveMemoryTimeout> | ||
</Configuration> | ||
</DebugMethod> | ||
<AutoDetectRTOS>true</AutoDetectRTOS> | ||
<SemihostingSupport>Auto</SemihostingSupport> | ||
<SemihostingPollingDelay>0</SemihostingPollingDelay> | ||
<StepIntoEntryPoint>false</StepIntoEntryPoint> | ||
<ReloadFirmwareOnReset>false</ReloadFirmwareOnReset> | ||
<ValidateEndOfStackAddress>true</ValidateEndOfStackAddress> | ||
<StopAtEntryPoint>false</StopAtEntryPoint> | ||
<EnableVirtualHalts>false</EnableVirtualHalts> | ||
<DynamicAnalysisSettings /> | ||
<EndOfStackSymbol>_estack</EndOfStackSymbol> | ||
<TimestampProviderTicksPerSecond>0</TimestampProviderTicksPerSecond> | ||
<KeepConsoleAfterExit>false</KeepConsoleAfterExit> | ||
<UnusedStackFillPattern xsi:nil="true" /> | ||
<SoftwareTracingSettings> | ||
<TraceWhileDebugging>true</TraceWhileDebugging> | ||
<AutoStart>false</AutoStart> | ||
<DynamicProgramAreaSize>0</DynamicProgramAreaSize> | ||
<SkipInitiallyDisabledTracepoints>false</SkipInitiallyDisabledTracepoints> | ||
<TraceProgramOptimization>Size</TraceProgramOptimization> | ||
<OutputMode>NonBlocking</OutputMode> | ||
<AssumeFramePointerIsValid>true</AssumeFramePointerIsValid> | ||
<InstrumentWithNoFeasibleTracepoints>false</InstrumentWithNoFeasibleTracepoints> | ||
<MaximumStringLength>255</MaximumStringLength> | ||
<DeferVectorTablePatching>true</DeferVectorTablePatching> | ||
<ShowAdvancedConfiguration>false</ShowAdvancedConfiguration> | ||
<WorkAreaSize>4096</WorkAreaSize> | ||
<DisableLiveCodePatching>false</DisableLiveCodePatching> | ||
</SoftwareTracingSettings> | ||
<CheckInterfaceDrivers>true</CheckInterfaceDrivers> | ||
</DebugSettingsOverride> | ||
<BuildSettingsExtension xsi:type="com.visualgdb.build.external.arduino.extension"> | ||
<BoardID>teensy:avr:teensy41</BoardID> | ||
<COMPort>COM102</COMPort> | ||
<Properties> | ||
<Entries> | ||
<KeyValue> | ||
<Key>usb</Key> | ||
<Value>serial</Value> | ||
</KeyValue> | ||
<KeyValue> | ||
<Key>speed</Key> | ||
<Value>600</Value> | ||
</KeyValue> | ||
<KeyValue> | ||
<Key>opt</Key> | ||
<Value>o2std</Value> | ||
</KeyValue> | ||
<KeyValue> | ||
<Key>keys</Key> | ||
<Value>en-us</Value> | ||
</KeyValue> | ||
</Entries> | ||
</Properties> | ||
<DebugUnoptimizedComponentTypes>Sketch</DebugUnoptimizedComponentTypes> | ||
</BuildSettingsExtension> | ||
</VisualGDBConfiguration> | ||
</Configurations> | ||
<ProgramArgumentsSuggestions /> | ||
</VisualGDBProjectSettings2> |
Oops, something went wrong.