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

Embed: (wiki syntax)

« Back to documentation index

ISha256MacCoproc Class Reference

ISha256MacCoproc Class Reference

Interface for SHA-256 coprocessors compatible with the DS28E15/22/25 family and similar. More...

#include <ISha256MacCoproc.h>

Inherited by DS2465.

Public Types

typedef array< uint8_t, 32 > DevicePage
 Holds the contents of a device memory page.
typedef array< uint8_t, 32 > DeviceScratchpad
 Holds the contents of a device scratchpad.
typedef array< uint8_t, 32 > Secret
 Holds the contents of a device secret.
typedef array< uint8_t, 32 > Mac
 Container for a SHA-256 MAC.
typedef array< uint8_t, 20 > WriteMacData
 Additional data fields for Compute Write MAC operation.
typedef array< uint8_t, 12 > AuthMacData
 Additional data fields for the Compute Auth. MAC operation.
typedef array< uint8_t, 12 > SlaveSecretData
 Additional data field for the Compute Slave Secret operation.

Public Member Functions

virtual CmdResult setMasterSecret (const Secret &masterSecret)=0
 Set Master Secret in coprocessor.
virtual CmdResult computeSlaveSecret (const DevicePage &devicePage, const DeviceScratchpad &deviceScratchpad, const SlaveSecretData &slaveSecretData)=0
 Compute Slave Secret in the coprocessor.
virtual CmdResult computeWriteMac (const WriteMacData &writeMacData, Mac &mac) const =0
 Compute Write MAC.
virtual CmdResult computeAuthMac (const DevicePage &devicePage, const DeviceScratchpad &challenge, const AuthMacData &authMacData, Mac &mac) const =0
 Compute Authentication MAC.

Detailed Description

Interface for SHA-256 coprocessors compatible with the DS28E15/22/25 family and similar.

Definition at line 43 of file ISha256MacCoproc.h.


Member Typedef Documentation

typedef array<uint8_t, 12> AuthMacData

Additional data fields for the Compute Auth. MAC operation.

Definition at line 68 of file ISha256MacCoproc.h.

typedef array<uint8_t, 32> DevicePage

Holds the contents of a device memory page.

Definition at line 53 of file ISha256MacCoproc.h.

typedef array<uint8_t, 32> DeviceScratchpad

Holds the contents of a device scratchpad.

Definition at line 56 of file ISha256MacCoproc.h.

typedef array<uint8_t, 32> Mac

Container for a SHA-256 MAC.

Definition at line 62 of file ISha256MacCoproc.h.

typedef array<uint8_t, 32> Secret

Holds the contents of a device secret.

Definition at line 59 of file ISha256MacCoproc.h.

typedef array<uint8_t, 12> SlaveSecretData

Additional data field for the Compute Slave Secret operation.

Definition at line 71 of file ISha256MacCoproc.h.

typedef array<uint8_t, 20> WriteMacData

Additional data fields for Compute Write MAC operation.

Definition at line 65 of file ISha256MacCoproc.h.


Member Function Documentation

virtual CmdResult computeAuthMac ( const DevicePage devicePage,
const DeviceScratchpad challenge,
const AuthMacData authMacData,
Mac mac 
) const [pure virtual]

Compute Authentication MAC.

Note:
Uses the previously computed Slave Secret in computation.
Parameters:
[in]devicePagePage data stored on device.
[in]challegeRandom challenge for device.
[in]authMacDataAdditional data fields as specified by device.
[out]macThe computed MAC.

Implemented in DS2465.

virtual CmdResult computeSlaveSecret ( const DevicePage devicePage,
const DeviceScratchpad deviceScratchpad,
const SlaveSecretData slaveSecretData 
) [pure virtual]

Compute Slave Secret in the coprocessor.

Note:
Uses the previously set Master Secret in computation.
Parameters:
[in]devicePagePage data stored on device.
[in]deviceScratchpadScratchpad data stored on device.
[in]slaveSecretDataAdditional data fields as specified by device.

Implemented in DS2465.

virtual CmdResult computeWriteMac ( const WriteMacData writeMacData,
Mac mac 
) const [pure virtual]

Compute Write MAC.

Note:
Uses the previously computed Slave Secret in computation.
Parameters:
[in]writeMacDataAdditional data fields as specified by device.
[out]macThe computed MAC.

Implemented in DS2465.

virtual CmdResult setMasterSecret ( const Secret masterSecret ) [pure virtual]

Set Master Secret in coprocessor.

Parameters:
[in]masterSecretNew master secret to set.

Implemented in DS2465.