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 Oct 03 11:40:13 2019 -0500
Revision:
16:a004191a79ab
Parent:
Graphic.hpp@13:6a6225690c2e
Updated MaximInterface to version 2.0. Updated mbed-os to version 5.5.7. Cleaned up code styling.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
IanBenzMaxim 0:33d4e66780c0 1 /*******************************************************************************
IanBenzMaxim 16:a004191a79ab 2 * Copyright (C) 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 "Keys.hpp"
IanBenzMaxim 0:33d4e66780c0 39
IanBenzMaxim 10:71359af61af8 40 class Bitmap;
IanBenzMaxim 8:a0d75dff3c9b 41
IanBenzMaxim 16:a004191a79ab 42 /// @brief Base class for all graphical elements.
IanBenzMaxim 16:a004191a79ab 43 /// @details
IanBenzMaxim 16:a004191a79ab 44 /// Includes unique parent-child relationships for creating trees of graphical
IanBenzMaxim 16:a004191a79ab 45 /// objects.
IanBenzMaxim 13:6a6225690c2e 46 class Graphic {
IanBenzMaxim 0:33d4e66780c0 47 public:
IanBenzMaxim 13:6a6225690c2e 48 typedef std::vector<Graphic *> ChildContainer;
IanBenzMaxim 13:6a6225690c2e 49
IanBenzMaxim 13:6a6225690c2e 50 Graphic();
IanBenzMaxim 13:6a6225690c2e 51 virtual ~Graphic();
IanBenzMaxim 13:6a6225690c2e 52
IanBenzMaxim 16:a004191a79ab 53 /// @name Parent
IanBenzMaxim 16:a004191a79ab 54 /// @brief
IanBenzMaxim 13:6a6225690c2e 55 /// Get or set the parent graphic of this graphic. Set to NULL if this graphic
IanBenzMaxim 13:6a6225690c2e 56 /// has no parent.
IanBenzMaxim 16:a004191a79ab 57 /// @{
IanBenzMaxim 16:a004191a79ab 58
IanBenzMaxim 16:a004191a79ab 59 Graphic * parent() { return parent_; }
IanBenzMaxim 16:a004191a79ab 60
IanBenzMaxim 16:a004191a79ab 61 const Graphic * parent() const { return parent_; }
IanBenzMaxim 16:a004191a79ab 62
IanBenzMaxim 13:6a6225690c2e 63 /// @note Adds this graphic to the parent's list of children.
IanBenzMaxim 13:6a6225690c2e 64 /// @sa childrenChanged
IanBenzMaxim 13:6a6225690c2e 65 void setParent(Graphic * parent);
IanBenzMaxim 16:a004191a79ab 66
IanBenzMaxim 13:6a6225690c2e 67 /// @}
IanBenzMaxim 16:a004191a79ab 68
IanBenzMaxim 16:a004191a79ab 69 /// @brief List of child graphics for this parent.
IanBenzMaxim 16:a004191a79ab 70 /// @note
IanBenzMaxim 16:a004191a79ab 71 /// Children should be added and removed by calling setParent. Children will
IanBenzMaxim 16:a004191a79ab 72 /// be removed automatically when they are destroyed.
IanBenzMaxim 16:a004191a79ab 73 const ChildContainer & children() const { return children_; }
IanBenzMaxim 0:33d4e66780c0 74
IanBenzMaxim 13:6a6225690c2e 75 /// @brief Check if this graphic is focused.
IanBenzMaxim 13:6a6225690c2e 76 /// @returns True if focused.
IanBenzMaxim 13:6a6225690c2e 77 bool focused() const;
IanBenzMaxim 16:a004191a79ab 78
IanBenzMaxim 13:6a6225690c2e 79 /// @brief Set this graphic as the focused graphic.
IanBenzMaxim 16:a004191a79ab 80 /// @details
IanBenzMaxim 16:a004191a79ab 81 /// The focused graphic is the first to receive input events such as key
IanBenzMaxim 16:a004191a79ab 82 /// presses.
IanBenzMaxim 13:6a6225690c2e 83 /// @sa focusChanged
IanBenzMaxim 13:6a6225690c2e 84 void setFocused();
IanBenzMaxim 13:6a6225690c2e 85
IanBenzMaxim 16:a004191a79ab 86 /// @brief Coordinates of this graphic in pixels.
IanBenzMaxim 13:6a6225690c2e 87 /// @details
IanBenzMaxim 13:6a6225690c2e 88 /// Coordinates are relative to the top-left corner of the parent graphic.
IanBenzMaxim 16:a004191a79ab 89 /// @{
IanBenzMaxim 16:a004191a79ab 90
IanBenzMaxim 16:a004191a79ab 91 int x() const { return x_; }
IanBenzMaxim 16:a004191a79ab 92 int y() const { return y_; }
IanBenzMaxim 16:a004191a79ab 93
IanBenzMaxim 13:6a6225690c2e 94 /// @}
IanBenzMaxim 13:6a6225690c2e 95
IanBenzMaxim 16:a004191a79ab 96 /// @brief Displayed dimensions of this graphic in pixels.
IanBenzMaxim 13:6a6225690c2e 97 /// @{
IanBenzMaxim 16:a004191a79ab 98
IanBenzMaxim 16:a004191a79ab 99 int width() const { return width_; }
IanBenzMaxim 16:a004191a79ab 100 int height() const { return height_; }
IanBenzMaxim 16:a004191a79ab 101
IanBenzMaxim 13:6a6225690c2e 102 /// @}
IanBenzMaxim 13:6a6225690c2e 103
IanBenzMaxim 16:a004191a79ab 104 /// @brief Move graphic to a new location measured in pixels.
IanBenzMaxim 13:6a6225690c2e 105 /// @details
IanBenzMaxim 13:6a6225690c2e 106 /// Coordinates are relative to the top-left corner of the parent graphic.
IanBenzMaxim 13:6a6225690c2e 107 /// @sa moved
IanBenzMaxim 13:6a6225690c2e 108 void move(int x, int y);
IanBenzMaxim 0:33d4e66780c0 109
IanBenzMaxim 16:a004191a79ab 110 /// @brief
IanBenzMaxim 16:a004191a79ab 111 /// Resize graphic to a new size measure in pixels. Minimum width and height
IanBenzMaxim 16:a004191a79ab 112 /// is 1.
IanBenzMaxim 13:6a6225690c2e 113 /// @sa resized
IanBenzMaxim 13:6a6225690c2e 114 void resize(int width, int height);
IanBenzMaxim 13:6a6225690c2e 115
IanBenzMaxim 16:a004191a79ab 116 /// @brief Render this graphic onto a bitmap.
IanBenzMaxim 13:6a6225690c2e 117 /// @{
IanBenzMaxim 16:a004191a79ab 118
IanBenzMaxim 13:6a6225690c2e 119 void render(Bitmap & bitmap, int xOffset, int yOffset) const;
IanBenzMaxim 13:6a6225690c2e 120 void render(Bitmap & bitmap) const;
IanBenzMaxim 16:a004191a79ab 121
IanBenzMaxim 13:6a6225690c2e 122 /// @}
IanBenzMaxim 13:6a6225690c2e 123
IanBenzMaxim 16:a004191a79ab 124 /// @brief
IanBenzMaxim 13:6a6225690c2e 125 /// Update this graphic and all child graphics. Checks if graphic has been
IanBenzMaxim 13:6a6225690c2e 126 /// invalidated and should be redrawn.
IanBenzMaxim 13:6a6225690c2e 127 /// @param canvas Canvas used for rendering. May be set to NULL to defer redraw.
IanBenzMaxim 13:6a6225690c2e 128 /// @returns True if the canvas has been updated.
IanBenzMaxim 13:6a6225690c2e 129 /// @sa updated
IanBenzMaxim 13:6a6225690c2e 130 bool update(Bitmap * canvas);
IanBenzMaxim 13:6a6225690c2e 131
IanBenzMaxim 16:a004191a79ab 132 /// @brief Process a key-press input event.
IanBenzMaxim 13:6a6225690c2e 133 /// @details
IanBenzMaxim 13:6a6225690c2e 134 /// The event will first be directed to the focused graphic. Processing will
IanBenzMaxim 13:6a6225690c2e 135 /// proceed to each parent graphic until it has been handled.
IanBenzMaxim 13:6a6225690c2e 136 /// @sa doProcessKey
IanBenzMaxim 13:6a6225690c2e 137 /// @returns True if the key event was handled.
IanBenzMaxim 13:6a6225690c2e 138 bool processKey(Key key);
IanBenzMaxim 13:6a6225690c2e 139
IanBenzMaxim 13:6a6225690c2e 140 protected:
IanBenzMaxim 16:a004191a79ab 141 /// @brief Mark the visual region as invalid.
IanBenzMaxim 13:6a6225690c2e 142 /// @note Indicates a redraw is necessary during next update.
IanBenzMaxim 16:a004191a79ab 143 void invalidate() { valid_ = false; }
IanBenzMaxim 13:6a6225690c2e 144
IanBenzMaxim 13:6a6225690c2e 145 /// Event handler for when a child is added or removed.
IanBenzMaxim 13:6a6225690c2e 146 virtual void childrenChanged();
IanBenzMaxim 13:6a6225690c2e 147
IanBenzMaxim 16:a004191a79ab 148 /// @brief Event handler for when this graphic has been focused or unfocused.
IanBenzMaxim 13:6a6225690c2e 149 /// @param focused True if focused or false if unfocused.
IanBenzMaxim 13:6a6225690c2e 150 virtual void focusChanged(bool focused);
IanBenzMaxim 13:6a6225690c2e 151
IanBenzMaxim 13:6a6225690c2e 152 /// Event handler for when this graphic has been moved.
IanBenzMaxim 13:6a6225690c2e 153 virtual void moved();
IanBenzMaxim 13:6a6225690c2e 154
IanBenzMaxim 13:6a6225690c2e 155 /// Event handler for when this graphic has been resized.
IanBenzMaxim 13:6a6225690c2e 156 virtual void resized();
IanBenzMaxim 13:6a6225690c2e 157
IanBenzMaxim 13:6a6225690c2e 158 /// Event handler for when this graphic has been updated.
IanBenzMaxim 13:6a6225690c2e 159 virtual void updated();
IanBenzMaxim 13:6a6225690c2e 160
IanBenzMaxim 16:a004191a79ab 161 /// @brief Render this graphic onto a bitmap.
IanBenzMaxim 13:6a6225690c2e 162 /// @details The default implementation renders each child in order.
IanBenzMaxim 13:6a6225690c2e 163 virtual void doRender(Bitmap & bitmap, int xOffset, int yOffset) const;
IanBenzMaxim 13:6a6225690c2e 164
IanBenzMaxim 16:a004191a79ab 165 /// @brief Process a key-press input event.
IanBenzMaxim 16:a004191a79ab 166 /// @returns
IanBenzMaxim 16:a004191a79ab 167 /// True if the key event was handled. False if the key event should be
IanBenzMaxim 16:a004191a79ab 168 /// propagated.
IanBenzMaxim 13:6a6225690c2e 169 virtual bool doProcessKey(Key);
IanBenzMaxim 0:33d4e66780c0 170
IanBenzMaxim 0:33d4e66780c0 171 private:
IanBenzMaxim 16:a004191a79ab 172 Graphic * parent_;
IanBenzMaxim 16:a004191a79ab 173 ChildContainer children_;
IanBenzMaxim 16:a004191a79ab 174 Graphic * focusedChild_;
IanBenzMaxim 16:a004191a79ab 175 int x_;
IanBenzMaxim 16:a004191a79ab 176 int y_;
IanBenzMaxim 16:a004191a79ab 177 int width_;
IanBenzMaxim 16:a004191a79ab 178 int height_;
IanBenzMaxim 16:a004191a79ab 179 bool valid_;
IanBenzMaxim 13:6a6225690c2e 180
IanBenzMaxim 13:6a6225690c2e 181 void updateAll();
IanBenzMaxim 13:6a6225690c2e 182 bool redrawInvalid(Bitmap & canvas);
IanBenzMaxim 13:6a6225690c2e 183 void setAllValid();
IanBenzMaxim 13:6a6225690c2e 184
IanBenzMaxim 13:6a6225690c2e 185 // Uncopyable
IanBenzMaxim 13:6a6225690c2e 186 Graphic(const Graphic &);
IanBenzMaxim 13:6a6225690c2e 187 const Graphic & operator=(const Graphic &);
IanBenzMaxim 0:33d4e66780c0 188 };
IanBenzMaxim 0:33d4e66780c0 189
IanBenzMaxim 0:33d4e66780c0 190 #endif