ECB — AES electronic codebook mode encryption

The AES electronic codebook mode encryption (ECB) can be used for a range of cryptographic functions like hash generation, digital signatures, and keystream generation for data encryption/decryption. The ECB encryption block supports 128 bit AES encryption (encryption only, not decryption).

AES ECB operates with EasyDMA access to system Data RAM for in-place operations on cleartext and ciphertext during encryption. ECB uses the same AES core as the CCM and AAR blocks, and is an asynchronous operation which may not complete if the AES core is busy.

AES ECB features:

  • 128 bit AES encryption
  • Supports standard AES ECB block encryption
  • Memory pointer support
  • DMA data transfer

AES ECB performs a 128 bit AES block encrypt. At the STARTECB task, data and key is loaded into the algorithm by EasyDMA. When output data has been written back to memory, the ENDECB event is triggered.

AES ECB can be stopped by triggering the STOPECB task.

Shared resources

The ECB, CCM, and AAR share the same AES module. The ECB will always have lowest priority, and if there is a sharing conflict during encryption, the ECB operation will be aborted and an ERRORECB event will be generated.

EasyDMA

The ECB implements an EasyDMA mechanism for reading and writing to the Data RAM. This DMA cannot access the program memory or any other parts of the memory area except RAM.

If the ECBDATAPTR is not pointing to the Data RAM region, an EasyDMA transfer may result in a HardFault or RAM corruption. See Memory for more information about the different memory regions.

The EasyDMA will have finished accessing the Data RAM when the ENDECB or ERRORECB is generated.

ECB data structure

Block encrypt input and output is stored in the same data structure. ECBDATAPTR should point to this data structure before STARTECB is initiated.

Table 1. ECB data structure overview
PropertyAddress offsetDescription
KEY016 byte AES key
CLEARTEXT1616 byte AES cleartext input block
CIPHERTEXT3216 byte AES ciphertext output block

Registers

Instances

InstanceBase addressDescription
ECB0x4000E000

AES electronic code book (ECB) mode block encryption

Register overview

RegisterOffsetDescription
TASKS_STARTECB0x000

Start ECB block encrypt

TASKS_STOPECB0x004

Abort a possible executing ECB operation

EVENTS_ENDECB0x100

ECB block encrypt complete

EVENTS_ERRORECB0x104

ECB block encrypt aborted because of a STOPECB task or due to an error

INTENSET0x304

Enable interrupt

INTENCLR0x308

Disable interrupt

ECBDATAPTR0x504

ECB block encrypt memory pointers

TASKS_STARTECB

Address offset: 0x000

Start ECB block encrypt

If a crypto operation is already running in the AES core, the STARTECB task will not start a new encryption and an ERRORECB event will be triggered.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
A

W

TASKS_STARTECB

Start ECB block encrypt

If a crypto operation is already running in the AES core, the STARTECB task will not start a new encryption and an ERRORECB event will be triggered.

Trigger

1

Trigger task

TASKS_STOPECB

Address offset: 0x004

Abort a possible executing ECB operation

If a running ECB operation is aborted by STOPECB, the ERRORECB event is triggered.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
A

W

TASKS_STOPECB

Abort a possible executing ECB operation

If a running ECB operation is aborted by STOPECB, the ERRORECB event is triggered.

Trigger

1

Trigger task

EVENTS_ENDECB

Address offset: 0x100

ECB block encrypt complete

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
A

RW

EVENTS_ENDECB

ECB block encrypt complete

NotGenerated

0

Event not generated

Generated

1

Event generated

EVENTS_ERRORECB

Address offset: 0x104

ECB block encrypt aborted because of a STOPECB task or due to an error

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
A

RW

EVENTS_ERRORECB

ECB block encrypt aborted because of a STOPECB task or due to an error

NotGenerated

0

Event not generated

Generated

1

Event generated

INTENSET

Address offset: 0x304

Enable interrupt

Bit number313029282726252423222120191817161514131211109876543210
IDBA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
A

RW

ENDECB

Write '1' to enable interrupt for event ENDECB

Set

1

Enable

Disabled

0

Read: Disabled

Enabled

1

Read: Enabled

B

RW

ERRORECB

Write '1' to enable interrupt for event ERRORECB

Set

1

Enable

Disabled

0

Read: Disabled

Enabled

1

Read: Enabled

INTENCLR

Address offset: 0x308

Disable interrupt

Bit number313029282726252423222120191817161514131211109876543210
IDBA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
A

RW

ENDECB

Write '1' to disable interrupt for event ENDECB

Clear

1

Disable

Disabled

0

Read: Disabled

Enabled

1

Read: Enabled

B

RW

ERRORECB

Write '1' to disable interrupt for event ERRORECB

Clear

1

Disable

Disabled

0

Read: Disabled

Enabled

1

Read: Enabled

ECBDATAPTR

Address offset: 0x504

ECB block encrypt memory pointers

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
A

RW

ECBDATAPTR

Pointer to the ECB data structure (see Table 1 ECB data structure overview)

Electrical specification

ECB Electrical Specification

SymbolDescriptionMin.Typ.Max.Units
tECB

Run time per 16 byte block in all modes

7.2µs