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.

Revision:
10:71359af61af8
Parent:
8:a0d75dff3c9b
Child:
13:6a6225690c2e
--- a/Graphic.cpp	Thu Apr 06 15:19:57 2017 -0500
+++ b/Graphic.cpp	Mon Apr 10 11:55:33 2017 -0500
@@ -31,7 +31,8 @@
 *******************************************************************************/
 
 #include <algorithm>
-#include "Display.hpp"
+#include <functional>
+#include "Bitmap.hpp"
 #include "Graphic.hpp"
 
 static const int minWidthHeight = 1;
@@ -143,47 +144,101 @@
     }
 }
 
-Bitmap Graphic::render() const
+// Functor overlays rendered graphics onto a bitmap.
+class RenderOverlay
 {
-    Bitmap bitmap(width(), height());
-    doRender(bitmap);
-    return bitmap;
+public:
+    RenderOverlay(Bitmap & bitmap, int xOffset, int yOffset) :
+        bitmap(bitmap), xOffset(xOffset), yOffset(yOffset) { }
+    
+    void operator()(const Graphic * graphic)
+    {
+        if (graphic != NULL)
+        {
+            graphic->render(bitmap, xOffset, yOffset);
+        }
+    }
+    
+private:
+    Bitmap & bitmap;
+    const int xOffset;
+    const int yOffset;
+};
+
+void Graphic::doRender(Bitmap & bitmap, int xOffset, int yOffset) const
+{
+    std::for_each(m_children.begin(), m_children.end(),
+        RenderOverlay(bitmap, xOffset + x(), yOffset + y()));
 }
 
-bool Graphic::doUpdate(bool setValid)
+void Graphic::render(Bitmap & bitmap, int xOffset, int yOffset) const
+{
+    // Clear region.
+    bitmap.clear(xOffset + x(), yOffset + y(), width(), height());
+    // Do actual rendering.
+    doRender(bitmap, xOffset, yOffset);
+}
+
+void Graphic::render(Bitmap & bitmap) const
 {
-    bool redraw = false;
+    int xOffset = 0;
+    int yOffset = 0;
+    for (const Graphic * graphic = parent(); graphic != NULL; graphic = graphic->parent())
+    {
+        xOffset += graphic->x();
+        yOffset += graphic->y();
+    }
+    render(bitmap, xOffset, yOffset);
+}
+
+void Graphic::updateAll()
+{
     // Perform updated event on this graphic.
     updated();
     // Call recursively on each child.
-    for (ChildContainer::iterator it = m_children.begin(); it != m_children.end(); it++)
+    std::for_each(m_children.begin(), m_children.end(), std::mem_fun(&Graphic::updateAll));
+}
+
+bool Graphic::redrawInvalid(Bitmap & canvas)
+{
+    bool redraw = !m_valid;
+    if (redraw)
     {
-        if ((*it)->doUpdate(setValid))
-        {
-            redraw = true;
-        }
+        // Redraw if invalid.
+        render(canvas);
+        // Set all children to valid since they were incorporated in the redraw.
+        setAllValid();
     }
-    // Request redraw if region invalid.
-    if (!m_valid)
+    else
     {
-        redraw = true;
-        if (setValid)
+        // Call recursively on each child.
+        for (ChildContainer::iterator it = m_children.begin(); it != m_children.end(); it++)
         {
-            m_valid = true;
+            if ((*it)->redrawInvalid(canvas))
+            {
+                redraw = true;
+            }
         }
     }
     return redraw;
 }
 
-void Graphic::update(Display * display)
+void Graphic::setAllValid()
 {
-    bool redraw = doUpdate(display != NULL);
-    if (display != NULL && redraw)
+    m_valid = true;
+    // Call recursively on each child.
+    std::for_each(m_children.begin(), m_children.end(), std::mem_fun(&Graphic::setAllValid));
+}
+
+bool Graphic::update(Bitmap * canvas)
+{
+    bool redraw = false;
+    updateAll();
+    if (canvas != NULL)
     {
-        Bitmap bitmap(Display::width, Display::height);
-        bitmap.overlay(render(), x(), y());
-        display->update(bitmap);
+        redraw = redrawInvalid(*canvas);
     }
+    return redraw;
 }
 
 bool Graphic::processKey(Key key)
@@ -204,7 +259,7 @@
     return handled;
 }
 
-void Graphic::childrenChanged() { }
+void Graphic::childrenChanged() { invalidate(); }
 
 void Graphic::focusChanged(bool) { }
 
@@ -214,27 +269,4 @@
 
 void Graphic::updated() { }
 
-// Functor overlays rendered graphics onto a bitmap.
-class RenderOverlay
-{
-public:
-    RenderOverlay(Bitmap & bitmap) : bitmap(bitmap) { }
-    
-    void operator()(const Graphic * graphic)
-    {
-        if (graphic != NULL)
-        {
-            bitmap.overlay(graphic->render(), graphic->x(), graphic->y());
-        }
-    }
-    
-private:
-    Bitmap & bitmap;
-};
-
-void Graphic::doRender(Bitmap & bitmap) const
-{
-    std::for_each(m_children.begin(), m_children.end(), RenderOverlay(bitmap));
-}
-
 bool Graphic::doProcessKey(Key) { return false; }