Device interface library for multiple platforms including Mbed.

Dependents:   DeepCover Embedded Security in IoT MaximInterface MAXREFDES155#

Embed: (wiki syntax)

« Back to documentation index

DS28EL22 Class Reference

Interface to the DS28EL22 (low power) authenticator. More...

#include <DS28E15_22_25.hpp>

Inherits MaximInterfaceDevices::DS28E15_22_25.

Inherited by DS28E22.

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< void > 
writeScratchpad (Page::const_span data)
 Perform Write Scratchpad operation on the device.
MaximInterfaceDevices_EXPORT
Core::Result< Page::array
readScratchpad () const
 Perform a Read Scratchpad operation on the device.
MaximInterfaceDevices_EXPORT
Core::Result< BlockProtection
readBlockProtection (int blockNum) const
 Read the status of a memory protection block using the Read Status command.
MaximInterfaceDevices_EXPORT
Core::Result< void > 
writeAuthSegment (int pageNum, int segmentNum, Segment::const_span newData, Page::const_span mac)
 Write memory segment using the Authenticated Write Memory command.
MaximInterfaceDevices_EXPORT
Core::Result< void > 
continueWriteAuthSegment (Segment::const_span newData, Page::const_span mac)
 Continue an in-progress Authenticated Write Memory command.
MaximInterfaceDevices_EXPORT
Core::Result< Core::array
< BlockProtection,
protectionBlocks > > 
readAllBlockProtection () const
 Read the status of all memory protection blocks using the Read Status command.
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 DS28EL22 (low power) authenticator.

Definition at line 327 of file DS28E15_22_25.hpp.


Member Typedef Documentation

typedef Core::array_span<uint_least8_t, 32> Page [inherited]

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 [inherited]

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 [inherited]

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 
) [inherited]

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 [inherited]

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 [inherited]

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 > continueWriteAuthSegment ( Segment::const_span  newData,
Page::const_span  mac 
)

Continue an in-progress Authenticated Write Memory command.

Parameters:
[in]newDataNew data to write to the segment.
[in]macWrite MAC computed for this operation.

Definition at line 607 of file DS28E15_22_25.cpp.

Result< void > continueWriteSegment ( Segment::const_span  data ) [inherited]

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 ) [inherited]

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< array< DS28E15_22_25::BlockProtection, DS28E22::protectionBlocks > > readAllBlockProtection (  ) const

Read the status of all memory protection blocks using the Read Status command.

Returns:
Receives protection statuses read from device.

Definition at line 613 of file DS28E15_22_25.cpp.

Result< DS28E15_22_25::BlockProtection > readBlockProtection ( int  blockNum ) const

Read the status of a memory protection block using the Read Status command.

Parameters:
blockNumBlock number to to read status of.
Returns:
Receives protection status read from device.

Definition at line 597 of file DS28E15_22_25.cpp.

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

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 [inherited]

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::Page::array > readScratchpad (  ) const

Perform a Read Scratchpad operation on the device.

Returns:
Buffer to read data from the scratchpad into.

Definition at line 592 of file DS28E15_22_25.cpp.

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

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 
) [inherited]

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 > writeAuthSegment ( int  pageNum,
int  segmentNum,
Segment::const_span  newData,
Page::const_span  mac 
)

Write memory segment using the Authenticated Write Memory command.

Parameters:
pageNumPage number for write operation.
segmentNumSegment number within page for write operation.
[in]newDataNew data to write to the segment.
[in]macWrite MAC computed for this operation.

Definition at line 601 of file DS28E15_22_25.cpp.

Result< void > writeBlockProtection ( BlockProtection  protection ) [inherited]

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 > writeScratchpad ( Page::const_span  data )

Perform Write Scratchpad operation on the device.

Parameters:
[in]dataData to write to the scratchpad.

Definition at line 588 of file DS28E15_22_25.cpp.

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

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, inherited]

Number of segments per page.

Definition at line 65 of file DS28E15_22_25.hpp.