DeepCover Embedded Security in IoT: Public-key Secured Data Paths

Dependencies:   MaximInterface

The MAXREFDES155# is an internet-of-things (IoT) embedded-security reference design, built to authenticate and control a sensing node using elliptic-curve-based public-key cryptography with control and notification from a web server.

The hardware includes an ARM® mbed™ shield and attached sensor endpoint. The shield contains a DS2476 DeepCover® ECDSA/SHA-2 coprocessor, Wifi communication, LCD push-button controls, and status LEDs. The sensor endpoint is attached to the shield using a 300mm cable and contains a DS28C36 DeepCover ECDSA/SHA-2 authenticator, IR-thermal sensor, and aiming laser for the IR sensor. The MAXREFDES155# is equipped with a standard Arduino® form-factor shield connector for immediate testing using an mbed board such as the MAX32600MBED#. The combination of these two devices represent an IoT device. Communication to the web server is accomplished with the shield Wifi circuitry. Communication from the shield to the attached sensor module is accomplished over I2C . The sensor module represents an IoT endpoint that generates small data with a requirement for message authenticity/integrity and secure on/off operational control.

The design is hierarchical with each mbed platform and shield communicating data from the sensor node to a web server that maintains a centralized log and dispatches notifications as necessary. The simplicity of this design enables rapid integration into any star-topology IoT network to provide security with the low overhead and cost provided by the ECDSA-P256 asymmetric-key and SHA-256 symmetric-key algorithms.

More information about the MAXREFDES155# is available on the Maxim Integrated website.

Committer:
IanBenzMaxim
Date:
Fri Feb 24 11:23:12 2017 -0600
Revision:
0:33d4e66780c0
Child:
8:a0d75dff3c9b
Initial commit.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
IanBenzMaxim 0:33d4e66780c0 1 /*******************************************************************************
IanBenzMaxim 0:33d4e66780c0 2 * Copyright (C) 2017 Maxim Integrated Products, Inc., All Rights Reserved.
IanBenzMaxim 0:33d4e66780c0 3 *
IanBenzMaxim 0:33d4e66780c0 4 * Permission is hereby granted, free of charge, to any person obtaining a
IanBenzMaxim 0:33d4e66780c0 5 * copy of this software and associated documentation files (the "Software"),
IanBenzMaxim 0:33d4e66780c0 6 * to deal in the Software without restriction, including without limitation
IanBenzMaxim 0:33d4e66780c0 7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
IanBenzMaxim 0:33d4e66780c0 8 * and/or sell copies of the Software, and to permit persons to whom the
IanBenzMaxim 0:33d4e66780c0 9 * Software is furnished to do so, subject to the following conditions:
IanBenzMaxim 0:33d4e66780c0 10 *
IanBenzMaxim 0:33d4e66780c0 11 * The above copyright notice and this permission notice shall be included
IanBenzMaxim 0:33d4e66780c0 12 * in all copies or substantial portions of the Software.
IanBenzMaxim 0:33d4e66780c0 13 *
IanBenzMaxim 0:33d4e66780c0 14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
IanBenzMaxim 0:33d4e66780c0 15 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
IanBenzMaxim 0:33d4e66780c0 16 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IanBenzMaxim 0:33d4e66780c0 17 * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
IanBenzMaxim 0:33d4e66780c0 18 * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
IanBenzMaxim 0:33d4e66780c0 19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
IanBenzMaxim 0:33d4e66780c0 20 * OTHER DEALINGS IN THE SOFTWARE.
IanBenzMaxim 0:33d4e66780c0 21 *
IanBenzMaxim 0:33d4e66780c0 22 * Except as contained in this notice, the name of Maxim Integrated
IanBenzMaxim 0:33d4e66780c0 23 * Products, Inc. shall not be used except as stated in the Maxim Integrated
IanBenzMaxim 0:33d4e66780c0 24 * Products, Inc. Branding Policy.
IanBenzMaxim 0:33d4e66780c0 25 *
IanBenzMaxim 0:33d4e66780c0 26 * The mere transfer of this software does not imply any licenses
IanBenzMaxim 0:33d4e66780c0 27 * of trade secrets, proprietary technology, copyrights, patents,
IanBenzMaxim 0:33d4e66780c0 28 * trademarks, maskwork rights, or any other form of intellectual
IanBenzMaxim 0:33d4e66780c0 29 * property whatsoever. Maxim Integrated Products, Inc. retains all
IanBenzMaxim 0:33d4e66780c0 30 * ownership rights.
IanBenzMaxim 0:33d4e66780c0 31 *******************************************************************************/
IanBenzMaxim 0:33d4e66780c0 32
IanBenzMaxim 0:33d4e66780c0 33 #ifndef GRAPHIC_HPP
IanBenzMaxim 0:33d4e66780c0 34 #define GRAPHIC_HPP
IanBenzMaxim 0:33d4e66780c0 35
IanBenzMaxim 0:33d4e66780c0 36 #include <stddef.h>
IanBenzMaxim 0:33d4e66780c0 37 #include <vector>
IanBenzMaxim 0:33d4e66780c0 38 #include "Bitmap.hpp"
IanBenzMaxim 0:33d4e66780c0 39 #include "Keys.hpp"
IanBenzMaxim 0:33d4e66780c0 40
IanBenzMaxim 0:33d4e66780c0 41 /// Base class for all graphical elements.
IanBenzMaxim 0:33d4e66780c0 42 /// @details Includes unique parent-child relationships for creating trees of graphical objects.
IanBenzMaxim 0:33d4e66780c0 43 class Graphic
IanBenzMaxim 0:33d4e66780c0 44 {
IanBenzMaxim 0:33d4e66780c0 45 public:
IanBenzMaxim 0:33d4e66780c0 46 typedef std::vector<Graphic *> ChildContainer;
IanBenzMaxim 0:33d4e66780c0 47
IanBenzMaxim 0:33d4e66780c0 48 explicit Graphic(Graphic * parent = NULL);
IanBenzMaxim 0:33d4e66780c0 49 virtual ~Graphic();
IanBenzMaxim 0:33d4e66780c0 50
IanBenzMaxim 0:33d4e66780c0 51 /// @{
IanBenzMaxim 0:33d4e66780c0 52 /// Get or set the parent graphic of this graphic. Set to NULL if this graphic has not parent.
IanBenzMaxim 0:33d4e66780c0 53 Graphic * parent() { return m_parent; }
IanBenzMaxim 0:33d4e66780c0 54 const Graphic * parent() const { return m_parent; }
IanBenzMaxim 0:33d4e66780c0 55 /// @note Adds this graphic to the parent's list of children.
IanBenzMaxim 0:33d4e66780c0 56 void setParent(Graphic * parent);
IanBenzMaxim 0:33d4e66780c0 57 /// @}
IanBenzMaxim 0:33d4e66780c0 58 /// List of child graphics for this parent.
IanBenzMaxim 0:33d4e66780c0 59 /// @note Children should be added and removed by calling setParent. Children will be removed
IanBenzMaxim 0:33d4e66780c0 60 /// automatically when they are destroyed.
IanBenzMaxim 0:33d4e66780c0 61 const ChildContainer & children() const { return m_children; }
IanBenzMaxim 0:33d4e66780c0 62
IanBenzMaxim 0:33d4e66780c0 63 /// @brief Check if this graphic is focused.
IanBenzMaxim 0:33d4e66780c0 64 /// @returns True if focused.
IanBenzMaxim 0:33d4e66780c0 65 bool focused() const;
IanBenzMaxim 0:33d4e66780c0 66 /// @brief Set this graphic as the focused graphic.
IanBenzMaxim 0:33d4e66780c0 67 /// @details The focused graphic is the first to receive input events such as key presses.
IanBenzMaxim 0:33d4e66780c0 68 void setFocused();
IanBenzMaxim 0:33d4e66780c0 69
IanBenzMaxim 0:33d4e66780c0 70 /// @{
IanBenzMaxim 0:33d4e66780c0 71 /// Set the coordinates of this graphic in pixels.
IanBenzMaxim 0:33d4e66780c0 72 /// @details Coordinates are relative to the top-left corner of the parent graphic.
IanBenzMaxim 0:33d4e66780c0 73 int x() const { return m_x; }
IanBenzMaxim 0:33d4e66780c0 74 void setX(int x);
IanBenzMaxim 0:33d4e66780c0 75 int y() const { return m_y; }
IanBenzMaxim 0:33d4e66780c0 76 void setY(int y);
IanBenzMaxim 0:33d4e66780c0 77 /// @}
IanBenzMaxim 0:33d4e66780c0 78
IanBenzMaxim 0:33d4e66780c0 79 /// @{
IanBenzMaxim 0:33d4e66780c0 80 /// Set the displayed dimensions of this graphic in pixels. Minimum width and height is 1.
IanBenzMaxim 0:33d4e66780c0 81 int width() const { return m_width; }
IanBenzMaxim 0:33d4e66780c0 82 void setWidth(int width);
IanBenzMaxim 0:33d4e66780c0 83 int height() const { return m_height; }
IanBenzMaxim 0:33d4e66780c0 84 void setHeight(int height);
IanBenzMaxim 0:33d4e66780c0 85 /// @}
IanBenzMaxim 0:33d4e66780c0 86
IanBenzMaxim 0:33d4e66780c0 87 /// @{
IanBenzMaxim 0:33d4e66780c0 88 /// Preferred (autoscaled) dimensions of this graphic.
IanBenzMaxim 0:33d4e66780c0 89 virtual int preferredWidth() const { return width(); }
IanBenzMaxim 0:33d4e66780c0 90 virtual int preferredHeight() const { return height(); }
IanBenzMaxim 0:33d4e66780c0 91 /// @}
IanBenzMaxim 0:33d4e66780c0 92
IanBenzMaxim 0:33d4e66780c0 93 /// Render this graphic as a bitmap.
IanBenzMaxim 0:33d4e66780c0 94 /// @details The default implementation renders each child in order.
IanBenzMaxim 0:33d4e66780c0 95 virtual Bitmap render() const;
IanBenzMaxim 0:33d4e66780c0 96
IanBenzMaxim 0:33d4e66780c0 97 /// Update this graphic and all child graphics.
IanBenzMaxim 0:33d4e66780c0 98 /// @details
IanBenzMaxim 0:33d4e66780c0 99 /// Updating consists of two stages: layout and post-layout. Layout is only performed on a
IanBenzMaxim 0:33d4e66780c0 100 /// graphic if the current layout has been invalidated. Post-layout is always performed. Each
IanBenzMaxim 0:33d4e66780c0 101 /// stage first performed on this graphic and then progresses through each sub-tree in child order.
IanBenzMaxim 0:33d4e66780c0 102 /// All graphic properties should be valid when this function returns. The regionValid and
IanBenzMaxim 0:33d4e66780c0 103 /// layoutValid properties will automatically be reset to true.
IanBenzMaxim 0:33d4e66780c0 104 /// @sa doLayout doPostLayout
IanBenzMaxim 0:33d4e66780c0 105 /// @returns True if the screen should be redrawn or false if it does not need to be redrawn.
IanBenzMaxim 0:33d4e66780c0 106 bool update();
IanBenzMaxim 0:33d4e66780c0 107
IanBenzMaxim 0:33d4e66780c0 108 /// Process a key-press input event.
IanBenzMaxim 0:33d4e66780c0 109 /// @details
IanBenzMaxim 0:33d4e66780c0 110 /// The event will first be directed to the focused graphic. Processing will proceed to each
IanBenzMaxim 0:33d4e66780c0 111 /// parent graphic until it has been handled.
IanBenzMaxim 0:33d4e66780c0 112 /// @sa doProcessKey
IanBenzMaxim 0:33d4e66780c0 113 /// @returns True if the key event was handled.
IanBenzMaxim 0:33d4e66780c0 114 bool processKey(Key key);
IanBenzMaxim 0:33d4e66780c0 115
IanBenzMaxim 0:33d4e66780c0 116 protected:
IanBenzMaxim 0:33d4e66780c0 117 /// Visual region valid property.
IanBenzMaxim 0:33d4e66780c0 118 /// @returns True if valid, false if an update may be required.
IanBenzMaxim 0:33d4e66780c0 119 bool regionValid() const { return m_regionValid; }
IanBenzMaxim 0:33d4e66780c0 120
IanBenzMaxim 0:33d4e66780c0 121 /// Invalidate the region valid property.
IanBenzMaxim 0:33d4e66780c0 122 void invalidateRegion() { m_regionValid = false; }
IanBenzMaxim 0:33d4e66780c0 123
IanBenzMaxim 0:33d4e66780c0 124 /// Layout valid property.
IanBenzMaxim 0:33d4e66780c0 125 /// @returns True if valid, false if a layout update is required.
IanBenzMaxim 0:33d4e66780c0 126 bool layoutValid() const { return m_layoutValid; }
IanBenzMaxim 0:33d4e66780c0 127
IanBenzMaxim 0:33d4e66780c0 128 /// Invalidate the layout valid property.
IanBenzMaxim 0:33d4e66780c0 129 void invalidateLayout() { m_layoutValid = false; }
IanBenzMaxim 0:33d4e66780c0 130
IanBenzMaxim 0:33d4e66780c0 131 /// Perform the layout of all child objects.
IanBenzMaxim 0:33d4e66780c0 132 virtual void doLayout() { }
IanBenzMaxim 0:33d4e66780c0 133
IanBenzMaxim 0:33d4e66780c0 134 /// Perform post-layout property updates and/or periodic tasks.
IanBenzMaxim 0:33d4e66780c0 135 virtual void doPostLayout() { }
IanBenzMaxim 0:33d4e66780c0 136
IanBenzMaxim 0:33d4e66780c0 137 /// Process a key-press input event.
IanBenzMaxim 0:33d4e66780c0 138 /// @returns True if the key event was handled. False if the key event should be propagated.
IanBenzMaxim 0:33d4e66780c0 139 virtual bool doProcessKey(Key) { return false; }
IanBenzMaxim 0:33d4e66780c0 140
IanBenzMaxim 0:33d4e66780c0 141 private:
IanBenzMaxim 0:33d4e66780c0 142 Graphic * m_parent;
IanBenzMaxim 0:33d4e66780c0 143 ChildContainer m_children;
IanBenzMaxim 0:33d4e66780c0 144 Graphic * m_focusedChild;
IanBenzMaxim 0:33d4e66780c0 145 int m_x;
IanBenzMaxim 0:33d4e66780c0 146 int m_y;
IanBenzMaxim 0:33d4e66780c0 147 int m_width;
IanBenzMaxim 0:33d4e66780c0 148 int m_height;
IanBenzMaxim 0:33d4e66780c0 149 bool m_regionValid;
IanBenzMaxim 0:33d4e66780c0 150 bool m_layoutValid;
IanBenzMaxim 0:33d4e66780c0 151
IanBenzMaxim 0:33d4e66780c0 152 bool doLayoutAll();
IanBenzMaxim 0:33d4e66780c0 153 bool doPostLayoutAll();
IanBenzMaxim 0:33d4e66780c0 154
IanBenzMaxim 0:33d4e66780c0 155 // Uncopyable
IanBenzMaxim 0:33d4e66780c0 156 Graphic(const Graphic &);
IanBenzMaxim 0:33d4e66780c0 157 const Graphic & operator=(const Graphic &);
IanBenzMaxim 0:33d4e66780c0 158 };
IanBenzMaxim 0:33d4e66780c0 159
IanBenzMaxim 0:33d4e66780c0 160 #endif