Device interface library for multiple platforms including Mbed.

Dependents:   DeepCover Embedded Security in IoT MaximInterface MAXREFDES155#

Embed: (wiki syntax)

« Back to documentation index

DS28E15_22_25 Class Reference

Interface to the DS28E15/22/25 series of authenticators including low power variants. More...

#include <DS28E15_22_25.hpp>

Inherited by DS28EL15, DS28EL22, and DS28EL25.

Data Structures

class  AuthenticationData
 Format data to hash for device authentication or computing the next secret from the existing secret. More...
class  BlockProtection
 Represents the status of a memory protection block. More...
struct  Personality
 Container for the device personality. More...
class  ProtectionWriteMacData
 Format data to hash for an Authenticated Write to a memory protection block. More...
class  SegmentWriteMacData
 Format data to hash for an Authenticated Write to a memory segment. More...

Public Types

typedef Core::array_span
< uint_least8_t, 4 > 
Segment
 Holds the contents of a device memory segment.
typedef Core::array_span
< uint_least8_t, 32 > 
Page
 Holds the contents of a device memory page.

Public Member Functions

MaximInterfaceDevices_EXPORT
Core::Result< Segment::array
readSegment (int pageNum, int segmentNum) const
 Read memory segment using the Read Memory command on the device.
MaximInterfaceDevices_EXPORT
Core::Result< Segment::array
continueReadSegment () const
 Continue an in-progress readSegment operation.
MaximInterfaceDevices_EXPORT
Core::Result< void > 
writeSegment (int pageNum, int segmentNum, Segment::const_span data)
 Write memory segment using the Write Memory command.
MaximInterfaceDevices_EXPORT
Core::Result< void > 
continueWriteSegment (Segment::const_span data)
 Continue an in-progress Write Memory command.
MaximInterfaceDevices_EXPORT
Core::Result< Page::array
readPage (int pageNum) const
 Read memory page using the Read Memory command on the device.
MaximInterfaceDevices_EXPORT
Core::Result< Page::array
continueReadPage () const
 Continue an in-progress readPageOperation.
MaximInterfaceDevices_EXPORT
Core::Result< Page::array
computeReadPageMac (int pageNum, bool anon) const
 Perform a Compute Page MAC command on the device.
MaximInterfaceDevices_EXPORT
Core::Result< void > 
writeBlockProtection (BlockProtection protection)
 Update the status of a memory protection block using the Write Page Protection command.
MaximInterfaceDevices_EXPORT
Core::Result< void > 
writeAuthBlockProtection (BlockProtection newProtection, Page::const_span mac)
 Update the status of a memory protection block using the Authenticated Write Page Protection command.
MaximInterfaceDevices_EXPORT
Core::Result< void > 
loadSecret (bool lock)
 Perform Load and Lock Secret command on the device.
MaximInterfaceDevices_EXPORT
Core::Result< void > 
computeSecret (int pageNum, bool lock)
 Perform a Compute and Lock Secret command on the device.
MaximInterfaceDevices_EXPORT
Core::Result< Personality
readPersonality () const
 Read the personality bytes using the Read Status command.

Static Public Attributes

static const int segmentsPerPage = Page::size / Segment::size
 Number of segments per page.

Detailed Description

Interface to the DS28E15/22/25 series of authenticators including low power variants.

Const member functions should not affect the state of the memory, block protection, or secret on the device.

Definition at line 54 of file DS28E15_22_25.hpp.


Member Typedef Documentation

typedef Core::array_span<uint_least8_t, 32> Page

Holds the contents of a device memory page.

Definition at line 62 of file DS28E15_22_25.hpp.

typedef Core::array_span<uint_least8_t, 4> Segment

Holds the contents of a device memory segment.

Definition at line 59 of file DS28E15_22_25.hpp.


Member Function Documentation

Result< DS28E15_22_25::Page::array > computeReadPageMac ( int  pageNum,
bool  anon 
) const

Perform a Compute Page MAC command on the device.

Read back the MAC and verify the CRC16.

Parameters:
pageNumPage number to use for the computation.
anonTrue to compute in anonymous mode where ROM ID is not used.
Returns:
The device computed MAC.

Definition at line 262 of file DS28E15_22_25.cpp.

Result< void > computeSecret ( int  pageNum,
bool  lock 
)

Perform a Compute and Lock Secret command on the device.

Parameters:
pageNumPage number to use as the binding data.
lockPrevent further changes to the secret on the device after computing.

Reimplemented in DS28E15, DS28E22, and DS28E25.

Definition at line 518 of file DS28E15_22_25.cpp.

Result< DS28E15_22_25::Page::array > continueReadPage (  ) const

Continue an in-progress readPageOperation.

Returns:
Buffer to read data from the page into.

Definition at line 355 of file DS28E15_22_25.cpp.

Result< DS28E15_22_25::Segment::array > continueReadSegment (  ) const

Continue an in-progress readSegment operation.

Note:
A CRC16 will encountered after reading the last segment of a page.
Returns:
Buffer to read data from the segment into.

Definition at line 426 of file DS28E15_22_25.cpp.

Result< void > continueWriteSegment ( Segment::const_span  data )

Continue an in-progress Write Memory command.

Parameters:
[in]dataData to write to the memory segment.

Definition at line 443 of file DS28E15_22_25.cpp.

Result< void > loadSecret ( bool  lock )

Perform Load and Lock Secret command on the device.

Note:
The secret should already be stored in the scratchpad on the device.
Parameters:
lockPrevent further changes to the secret on the device after loading.

Reimplemented in DS28E15, DS28E22, and DS28E25.

Definition at line 513 of file DS28E15_22_25.cpp.

Result< DS28E15_22_25::Page::array > readPage ( int  pageNum ) const

Read memory page using the Read Memory command on the device.

Parameters:
pageNumPage number for write operation.
Returns:
Buffer to read data from the page into.

Definition at line 346 of file DS28E15_22_25.cpp.

Result< DS28E15_22_25::Personality > readPersonality (  ) const

Read the personality bytes using the Read Status command.

Returns:
Receives personality read from device.

Definition at line 523 of file DS28E15_22_25.cpp.

Result< DS28E15_22_25::Segment::array > readSegment ( int  pageNum,
int  segmentNum 
) const

Read memory segment using the Read Memory command on the device.

Parameters:
pageNumPage number for read operation.
segmentNumSegment number within page for read operation.
Returns:
Buffer to read data from the segment into.

Definition at line 416 of file DS28E15_22_25.cpp.

Result< void > writeAuthBlockProtection ( BlockProtection  newProtection,
Page::const_span  mac 
)

Update the status of a memory protection block using the Authenticated Write Page Protection command.

Parameters:
newProtectionNew protection status to write.
[in]macWrite MAC computed for this operation.

Definition at line 210 of file DS28E15_22_25.cpp.

Result< void > writeBlockProtection ( BlockProtection  protection )

Update the status of a memory protection block using the Write Page Protection command.

Parameters:
protectionDesired protection status for the block. It is not possible to disable existing protections.

Definition at line 239 of file DS28E15_22_25.cpp.

Result< void > writeSegment ( int  pageNum,
int  segmentNum,
Segment::const_span  data 
)

Write memory segment using the Write Memory command.

Note:
1-Wire ROM selection should have already occurred.
Parameters:
pageNumPage number for write operation.
segmentNumSegment number within page for write operation.
[in]dataData to write to the memory segment.

Definition at line 432 of file DS28E15_22_25.cpp.


Field Documentation

const int segmentsPerPage = Page::size / Segment::size [static]

Number of segments per page.

Definition at line 65 of file DS28E15_22_25.hpp.