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:
13:6a6225690c2e
Parent:
10:71359af61af8
--- a/Graphic.cpp	Thu Jun 01 14:21:58 2017 -0500
+++ b/Graphic.cpp	Mon Nov 06 18:12:27 2017 -0600
@@ -37,236 +37,203 @@
 
 static const int minWidthHeight = 1;
 
-Graphic::Graphic() :
-    m_parent(NULL), m_children(), m_focusedChild(NULL),
-    m_x(0), m_y(0), m_width(minWidthHeight), m_height(minWidthHeight),
-    m_valid(false) { }
+Graphic::Graphic()
+    : m_parent(NULL), m_children(), m_focusedChild(NULL), m_x(0), m_y(0),
+      m_width(minWidthHeight), m_height(minWidthHeight), m_valid(false) {}
+
+static void setParentNull(Graphic * node) { node->setParent(NULL); }
 
-static void setParentNull(Graphic * node)
-{
-    node->setParent(NULL);
-}
-
-Graphic::~Graphic()
-{    
-    // Set children's parent to NULL.
-    std::for_each(m_children.begin(), m_children.end(), setParentNull);
-    // Remove from parent.
-    setParent(NULL);
+Graphic::~Graphic() {
+  // Set children's parent to NULL.
+  std::for_each(m_children.begin(), m_children.end(), setParentNull);
+  // Remove from parent.
+  setParent(NULL);
 }
 
-void Graphic::setParent(Graphic * parent)
-{
-    if ((m_parent == parent) || (parent == this))
-        return;
-        
-    if (m_parent != NULL)
-    {
-        // Remove this from the old parent's list of children.
-        m_parent->m_children.erase(std::remove(m_parent->m_children.begin(), m_parent->m_children.end(), this));
-        // Ensure that the old parent's focused child is not this.
-        if (m_parent->m_focusedChild == this)
-        {
-            m_parent->m_focusedChild = NULL;
-        }
-        // Signal children changed event on old parent.
-        m_parent->childrenChanged();
+void Graphic::setParent(Graphic * parent) {
+  if ((m_parent == parent) || (parent == this))
+    return;
+
+  if (m_parent != NULL) {
+    // Remove this from the old parent's list of children.
+    m_parent->m_children.erase(std::remove(m_parent->m_children.begin(),
+                                           m_parent->m_children.end(), this));
+    // Ensure that the old parent's focused child is not this.
+    if (m_parent->m_focusedChild == this) {
+      m_parent->m_focusedChild = NULL;
     }
-    if (parent != NULL)
-    {
-        // Add this to new parent's list of children.
-        parent->m_children.push_back(this);
-        // Signal children changed event on new parent.
-        parent->childrenChanged();
-    }
-    m_parent = parent;
+    // Signal children changed event on old parent.
+    m_parent->childrenChanged();
+  }
+  if (parent != NULL) {
+    // Add this to new parent's list of children.
+    parent->m_children.push_back(this);
+    // Signal children changed event on new parent.
+    parent->childrenChanged();
+  }
+  m_parent = parent;
 }
 
-bool Graphic::focused() const
-{
-    // First check if a focused child has not been set on this graphic.
-    bool focused = (m_focusedChild == NULL);
-    // Then check if each parent has the correct focused child set.
-    for (const Graphic * node = this; focused && (node->m_parent != NULL); node = node->m_parent)
-    {
-        focused = (node->m_parent->m_focusedChild == node);
-    }
-    return focused;
+bool Graphic::focused() const {
+  // First check if a focused child has not been set on this graphic.
+  bool focused = (m_focusedChild == NULL);
+  // Then check if each parent has the correct focused child set.
+  for (const Graphic * node = this; focused && (node->m_parent != NULL);
+       node = node->m_parent) {
+    focused = (node->m_parent->m_focusedChild == node);
+  }
+  return focused;
 }
 
-void Graphic::setFocused()
-{
-    // Locate top-level parent.
-    Graphic * node = this;
-    while (node->m_parent != NULL)
-    {
-        node = node->m_parent;
-    }
-    // Locate currently focused item.
-    while (node->m_focusedChild != NULL)
-    {
-        node = node->m_focusedChild;
-    }
-    // Do nothing if this is already focused.
-    if (node == this)
-        return;
-    
-    // Create new focus chain by setting the focused child of each parent.
-    m_focusedChild = NULL;
-    for (Graphic * node = this; node->m_parent != NULL; node = node->m_parent)
-    {
-        node->m_parent->m_focusedChild = node;
-    }
-    // Raise focus changed events on both nodes.
-    node->focusChanged(false);
-    focusChanged(true);
+void Graphic::setFocused() {
+  // Locate top-level parent.
+  Graphic * node = this;
+  while (node->m_parent != NULL) {
+    node = node->m_parent;
+  }
+  // Locate currently focused item.
+  while (node->m_focusedChild != NULL) {
+    node = node->m_focusedChild;
+  }
+  // Do nothing if this is already focused.
+  if (node == this)
+    return;
+
+  // Create new focus chain by setting the focused child of each parent.
+  m_focusedChild = NULL;
+  for (Graphic * node = this; node->m_parent != NULL; node = node->m_parent) {
+    node->m_parent->m_focusedChild = node;
+  }
+  // Raise focus changed events on both nodes.
+  node->focusChanged(false);
+  focusChanged(true);
 }
 
-void Graphic::move(int x, int y)
-{
-    if (m_x != x || m_y != y)
-    {
-        m_x = x;
-        m_y = y;
-        invalidate();
-        moved();
-    }
+void Graphic::move(int x, int y) {
+  if (m_x != x || m_y != y) {
+    m_x = x;
+    m_y = y;
+    invalidate();
+    moved();
+  }
 }
 
-void Graphic::resize(int width, int height)
-{
-    if (m_width != width || m_height != height)
-    {
-        m_width = std::max(width, minWidthHeight);
-        m_height = std::max(height, minWidthHeight);
-        invalidate();
-        resized();
-    }
+void Graphic::resize(int width, int height) {
+  if (m_width != width || m_height != height) {
+    m_width = std::max(width, minWidthHeight);
+    m_height = std::max(height, minWidthHeight);
+    invalidate();
+    resized();
+  }
 }
 
 // Functor overlays rendered graphics onto a bitmap.
-class RenderOverlay
-{
+class RenderOverlay {
 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);
-        }
+  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;
+  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()));
+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()));
 }
 
-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, 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
-{
-    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::render(Bitmap & bitmap) const {
+  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.
-    std::for_each(m_children.begin(), m_children.end(), std::mem_fun(&Graphic::updateAll));
+void Graphic::updateAll() {
+  // Perform updated event on this graphic.
+  updated();
+  // Call recursively on each child.
+  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)
-    {
-        // Redraw if invalid.
-        render(canvas);
-        // Set all children to valid since they were incorporated in the redraw.
-        setAllValid();
+bool Graphic::redrawInvalid(Bitmap & canvas) {
+  bool redraw = !m_valid;
+  if (redraw) {
+    // Redraw if invalid.
+    render(canvas);
+    // Set all children to valid since they were incorporated in the redraw.
+    setAllValid();
+  } else {
+    // Call recursively on each child.
+    for (ChildContainer::iterator it = m_children.begin();
+         it != m_children.end(); it++) {
+      if ((*it)->redrawInvalid(canvas)) {
+        redraw = true;
+      }
     }
-    else
-    {
-        // Call recursively on each child.
-        for (ChildContainer::iterator it = m_children.begin(); it != m_children.end(); it++)
-        {
-            if ((*it)->redrawInvalid(canvas))
-            {
-                redraw = true;
-            }
-        }
-    }
-    return redraw;
+  }
+  return redraw;
 }
 
-void Graphic::setAllValid()
-{
-    m_valid = true;
-    // Call recursively on each child.
-    std::for_each(m_children.begin(), m_children.end(), std::mem_fun(&Graphic::setAllValid));
+void Graphic::setAllValid() {
+  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)
-    {
-        redraw = redrawInvalid(*canvas);
-    }
-    return redraw;
+bool Graphic::update(Bitmap * canvas) {
+  bool redraw = false;
+  updateAll();
+  if (canvas != NULL) {
+    redraw = redrawInvalid(*canvas);
+  }
+  return redraw;
 }
 
-bool Graphic::processKey(Key key)
-{
-    // Find focused child.
-    Graphic * receiver = this;
-    while (receiver->m_focusedChild != NULL)
-    {
-        receiver = receiver->m_focusedChild;
-    }
-    // Pass event to focused child and then to each parent until handled.
-    bool handled = false;
-    do
-    {
-        handled = receiver->doProcessKey(key);
-        receiver = receiver->m_parent;
-    } while (!handled && (receiver != NULL));
-    return handled;
+bool Graphic::processKey(Key key) {
+  // Find focused child.
+  Graphic * receiver = this;
+  while (receiver->m_focusedChild != NULL) {
+    receiver = receiver->m_focusedChild;
+  }
+  // Pass event to focused child and then to each parent until handled.
+  bool handled = false;
+  do {
+    handled = receiver->doProcessKey(key);
+    receiver = receiver->m_parent;
+  } while (!handled && (receiver != NULL));
+  return handled;
 }
 
 void Graphic::childrenChanged() { invalidate(); }
 
-void Graphic::focusChanged(bool) { }
+void Graphic::focusChanged(bool) {}
 
-void Graphic::moved() { }
+void Graphic::moved() {}
 
-void Graphic::resized() { }
+void Graphic::resized() {}
 
-void Graphic::updated() { }
+void Graphic::updated() {}
 
 bool Graphic::doProcessKey(Key) { return false; }