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:
Thu Apr 06 15:16:30 2017 -0500
Revision:
8:a0d75dff3c9b
Parent:
0:33d4e66780c0
Child:
10:71359af61af8
Simplified graphics system for better clarity and expandability.

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 8:a0d75dff3c9b 41 class Display;
IanBenzMaxim 8:a0d75dff3c9b 42
IanBenzMaxim 0:33d4e66780c0 43 /// Base class for all graphical elements.
IanBenzMaxim 0:33d4e66780c0 44 /// @details Includes unique parent-child relationships for creating trees of graphical objects.
IanBenzMaxim 0:33d4e66780c0 45 class Graphic
IanBenzMaxim 0:33d4e66780c0 46 {
IanBenzMaxim 0:33d4e66780c0 47 public:
IanBenzMaxim 0:33d4e66780c0 48 typedef std::vector<Graphic *> ChildContainer;
IanBenzMaxim 0:33d4e66780c0 49
IanBenzMaxim 8:a0d75dff3c9b 50 Graphic();
IanBenzMaxim 0:33d4e66780c0 51 virtual ~Graphic();
IanBenzMaxim 0:33d4e66780c0 52
IanBenzMaxim 0:33d4e66780c0 53 /// @{
IanBenzMaxim 0:33d4e66780c0 54 /// Get or set the parent graphic of this graphic. Set to NULL if this graphic has not parent.
IanBenzMaxim 0:33d4e66780c0 55 Graphic * parent() { return m_parent; }
IanBenzMaxim 0:33d4e66780c0 56 const Graphic * parent() const { return m_parent; }
IanBenzMaxim 0:33d4e66780c0 57 /// @note Adds this graphic to the parent's list of children.
IanBenzMaxim 8:a0d75dff3c9b 58 /// @sa childrenChanged
IanBenzMaxim 0:33d4e66780c0 59 void setParent(Graphic * parent);
IanBenzMaxim 0:33d4e66780c0 60 /// @}
IanBenzMaxim 0:33d4e66780c0 61 /// List of child graphics for this parent.
IanBenzMaxim 0:33d4e66780c0 62 /// @note Children should be added and removed by calling setParent. Children will be removed
IanBenzMaxim 0:33d4e66780c0 63 /// automatically when they are destroyed.
IanBenzMaxim 0:33d4e66780c0 64 const ChildContainer & children() const { return m_children; }
IanBenzMaxim 0:33d4e66780c0 65
IanBenzMaxim 0:33d4e66780c0 66 /// @brief Check if this graphic is focused.
IanBenzMaxim 0:33d4e66780c0 67 /// @returns True if focused.
IanBenzMaxim 0:33d4e66780c0 68 bool focused() const;
IanBenzMaxim 0:33d4e66780c0 69 /// @brief Set this graphic as the focused graphic.
IanBenzMaxim 0:33d4e66780c0 70 /// @details The focused graphic is the first to receive input events such as key presses.
IanBenzMaxim 8:a0d75dff3c9b 71 /// @sa focusChanged
IanBenzMaxim 0:33d4e66780c0 72 void setFocused();
IanBenzMaxim 0:33d4e66780c0 73
IanBenzMaxim 0:33d4e66780c0 74 /// @{
IanBenzMaxim 8:a0d75dff3c9b 75 /// Coordinates of this graphic in pixels.
IanBenzMaxim 0:33d4e66780c0 76 /// @details Coordinates are relative to the top-left corner of the parent graphic.
IanBenzMaxim 0:33d4e66780c0 77 int x() const { return m_x; }
IanBenzMaxim 0:33d4e66780c0 78 int y() const { return m_y; }
IanBenzMaxim 0:33d4e66780c0 79 /// @}
IanBenzMaxim 0:33d4e66780c0 80
IanBenzMaxim 0:33d4e66780c0 81 /// @{
IanBenzMaxim 8:a0d75dff3c9b 82 /// Displayed dimensions of this graphic in pixels.
IanBenzMaxim 8:a0d75dff3c9b 83 int width() const { return m_width; }
IanBenzMaxim 8:a0d75dff3c9b 84 int height() const { return m_height; }
IanBenzMaxim 0:33d4e66780c0 85 /// @}
IanBenzMaxim 0:33d4e66780c0 86
IanBenzMaxim 8:a0d75dff3c9b 87 /// Move graphic to a new location measured in pixels.
IanBenzMaxim 8:a0d75dff3c9b 88 /// @details Coordinates are relative to the top-left corner of the parent graphic.
IanBenzMaxim 8:a0d75dff3c9b 89 /// @sa moved
IanBenzMaxim 8:a0d75dff3c9b 90 void move(int x, int y);
IanBenzMaxim 8:a0d75dff3c9b 91
IanBenzMaxim 8:a0d75dff3c9b 92 /// Resize graphic to a new size measure in pixels. Minimum width and height is 1.
IanBenzMaxim 8:a0d75dff3c9b 93 /// @sa resized
IanBenzMaxim 8:a0d75dff3c9b 94 void resize(int width, int height);
IanBenzMaxim 8:a0d75dff3c9b 95
IanBenzMaxim 0:33d4e66780c0 96 /// Render this graphic as a bitmap.
IanBenzMaxim 8:a0d75dff3c9b 97 /// @sa doRender
IanBenzMaxim 8:a0d75dff3c9b 98 Bitmap render() const;
IanBenzMaxim 8:a0d75dff3c9b 99
IanBenzMaxim 8:a0d75dff3c9b 100 /// Update this graphic and all child graphics. Checks if graphic has been invalidated and
IanBenzMaxim 8:a0d75dff3c9b 101 /// should be redrawn on the screen.
IanBenzMaxim 8:a0d75dff3c9b 102 /// @param display Display used for rendering. May be set to NULL to defer redraw.
IanBenzMaxim 8:a0d75dff3c9b 103 /// @sa updated
IanBenzMaxim 8:a0d75dff3c9b 104 void update(Display * display);
IanBenzMaxim 0:33d4e66780c0 105
IanBenzMaxim 0:33d4e66780c0 106 /// Process a key-press input event.
IanBenzMaxim 0:33d4e66780c0 107 /// @details
IanBenzMaxim 0:33d4e66780c0 108 /// The event will first be directed to the focused graphic. Processing will proceed to each
IanBenzMaxim 0:33d4e66780c0 109 /// parent graphic until it has been handled.
IanBenzMaxim 0:33d4e66780c0 110 /// @sa doProcessKey
IanBenzMaxim 0:33d4e66780c0 111 /// @returns True if the key event was handled.
IanBenzMaxim 0:33d4e66780c0 112 bool processKey(Key key);
IanBenzMaxim 0:33d4e66780c0 113
IanBenzMaxim 8:a0d75dff3c9b 114 protected:
IanBenzMaxim 8:a0d75dff3c9b 115 /// Mark the visual region as invalid.
IanBenzMaxim 8:a0d75dff3c9b 116 /// @note Indicates a redraw is necessary during next update.
IanBenzMaxim 8:a0d75dff3c9b 117 void invalidate() { m_valid = false; }
IanBenzMaxim 0:33d4e66780c0 118
IanBenzMaxim 8:a0d75dff3c9b 119 /// Event handler for when a child is added or removed.
IanBenzMaxim 8:a0d75dff3c9b 120 virtual void childrenChanged();
IanBenzMaxim 8:a0d75dff3c9b 121
IanBenzMaxim 8:a0d75dff3c9b 122 /// Event handler for when this graphic has been focused or unfocused.
IanBenzMaxim 8:a0d75dff3c9b 123 /// @param focused True if focused or false if unfocused.
IanBenzMaxim 8:a0d75dff3c9b 124 virtual void focusChanged(bool focused);
IanBenzMaxim 0:33d4e66780c0 125
IanBenzMaxim 8:a0d75dff3c9b 126 /// Event handler for when this graphic has been moved.
IanBenzMaxim 8:a0d75dff3c9b 127 virtual void moved();
IanBenzMaxim 8:a0d75dff3c9b 128
IanBenzMaxim 8:a0d75dff3c9b 129 /// Event handler for when this graphic has been resized.
IanBenzMaxim 8:a0d75dff3c9b 130 virtual void resized();
IanBenzMaxim 0:33d4e66780c0 131
IanBenzMaxim 8:a0d75dff3c9b 132 /// Event handler for when this graphic has been updated.
IanBenzMaxim 8:a0d75dff3c9b 133 virtual void updated();
IanBenzMaxim 0:33d4e66780c0 134
IanBenzMaxim 8:a0d75dff3c9b 135 /// Render this graphic as a bitmap.
IanBenzMaxim 8:a0d75dff3c9b 136 /// @details The default implementation renders each child in order.
IanBenzMaxim 8:a0d75dff3c9b 137 virtual void doRender(Bitmap & bitmap) const;
IanBenzMaxim 0:33d4e66780c0 138
IanBenzMaxim 0:33d4e66780c0 139 /// Process a key-press input event.
IanBenzMaxim 0:33d4e66780c0 140 /// @returns True if the key event was handled. False if the key event should be propagated.
IanBenzMaxim 8:a0d75dff3c9b 141 virtual bool doProcessKey(Key);
IanBenzMaxim 0:33d4e66780c0 142
IanBenzMaxim 0:33d4e66780c0 143 private:
IanBenzMaxim 0:33d4e66780c0 144 Graphic * m_parent;
IanBenzMaxim 0:33d4e66780c0 145 ChildContainer m_children;
IanBenzMaxim 0:33d4e66780c0 146 Graphic * m_focusedChild;
IanBenzMaxim 0:33d4e66780c0 147 int m_x;
IanBenzMaxim 0:33d4e66780c0 148 int m_y;
IanBenzMaxim 0:33d4e66780c0 149 int m_width;
IanBenzMaxim 0:33d4e66780c0 150 int m_height;
IanBenzMaxim 8:a0d75dff3c9b 151 bool m_valid;
IanBenzMaxim 0:33d4e66780c0 152
IanBenzMaxim 8:a0d75dff3c9b 153 /// @param setValid True to mark this graphic as valid again.
IanBenzMaxim 8:a0d75dff3c9b 154 /// @returns True if this graphic should be redrawn.
IanBenzMaxim 8:a0d75dff3c9b 155 bool doUpdate(bool setValid);
IanBenzMaxim 0:33d4e66780c0 156
IanBenzMaxim 0:33d4e66780c0 157 // Uncopyable
IanBenzMaxim 0:33d4e66780c0 158 Graphic(const Graphic &);
IanBenzMaxim 0:33d4e66780c0 159 const Graphic & operator=(const Graphic &);
IanBenzMaxim 0:33d4e66780c0 160 };
IanBenzMaxim 0:33d4e66780c0 161
IanBenzMaxim 0:33d4e66780c0 162 #endif