1-Wire® library for mbed. Complete 1-Wire library that supports our silicon masters along with a bit-bang master on the MAX32600MBED platform with one common interface for mbed. Slave support has also been included and more slaves will be added as time permits.

Dependents:   MAXREFDES131_Qt_Demo MAX32630FTHR_iButton_uSD_Logger MAX32630FTHR_DS18B20_uSD_Logger MAXREFDES130_131_Demo ... more

Superseded by MaximInterface.

OneWire_Masters/ISha256MacCoprocessor.hpp

Committer:
IanBenzMaxim
Date:
2016-03-31
Revision:
33:a4c015046956
Parent:
21:00c94aeb533e
Child:
48:6f9208ae280e

File content as of revision 33:a4c015046956:

#ifndef ISHA256MACCOPROCESSOR_H
#define ISHA256MACCOPROCESSOR_H

#include <cstddef>
#include <cstdint>

#include "array.hpp"

class ISha256MacCoprocessor
{
public:
  enum CmdResult
  {
    Success,
    OperationFailure
  };

  typedef array<std::uint8_t, 32> DevicePage;
  typedef array<std::uint8_t, 32> DeviceScratchpad;
  typedef array<std::uint8_t, 32> Secret;
  typedef array<std::uint8_t, 32> Mac;
  typedef array<std::uint8_t, 20> WriteMacData;
  typedef array<std::uint8_t, 12> AuthMacData;
  typedef array<std::uint8_t, 12> SlaveSecretData;
  
  virtual CmdResult setMasterSecret(const Secret & secret) = 0;
  virtual CmdResult computeWriteMac(const WriteMacData & writeMacData, Mac & mac) const = 0;
  virtual CmdResult computeAuthMac(const DevicePage & devicePage, const DeviceScratchpad & challenge, const AuthMacData & authMacData, Mac & mac) const = 0;
  virtual CmdResult computeSlaveSecret(const DevicePage & devicePage, const DeviceScratchpad & deviceScratchpad, const SlaveSecretData & slaveSecretData) = 0;
};

#endif