Texas Instruments CC2650DK Benutzerhandbuch

Seite von 1570
AES Cryptoprocessor Overview
10.1.6.3.2 Key Store
Before any encryption or decryption operation starts, the key store module must have at least one key
loaded and available for crypto operations. Keys can only be loaded from external memory using a DMA
operation. DMAC channel 0 (inbound) is used for this purpose.
10.1.6.3.2.1 Load Keys From External Memory
The following software example in pseudocode describes the actions that are typically executed by the
host software to load one or more keys into the key store module.
// configure master control module
write ALGSEL 0x0000_0001 // enable DMA path to the key store module
write IRQCLR 0x0000_0001 // clear any outstanding events
// configure key store module (area, size)
write KEYSIZE 0x0000_0001 // 128-bit key size
write KEYWRITEAREA 0x0000_0001 // enable keys to write (e.g. Key 0)
// configure DMAC
write DMACH0CTL 0x0000_00001 // enable DMA channel 0
write DMACH0EXTADDR <ext_memory_address> // base address of the key in ext. memory
write DMACH0LEN <length> // total key length in bytes (e.g. 16 for 1 x 128-bit
// key)
// wait for completion
wait IRQSTAT[0]==’1’ // wait for operation completed
check IRQSTAT[31:30] == ‘00’ // check for absence of errors in DMA and key store
write IRQCLR 0x0000_0001 // acknowledge the interrupt
write ALGSEL 0x0000_0000 // disable master control/DMA clock
// check status
check KEYWRITTENAREA 0x0000_00001 // check that Key 0 was written
// end of algorithm
10.1.6.3.3 Basic AES Modes
10.1.6.3.3.1 AES-ECB
For AES-ECB operations, the following configuration parameters are required:
Key from the key store module
Control register settings (mode, direction, key size)
Length of the data
The length field can have any value. If a data stream is finished and the next data stream uses the same
key and control, only the length field has to be written with a new value. The length field may also be zero,
for continued processing.
814
SWCU117A – February 2015 – Revised March 2015
Copyright © 2015, Texas Instruments Incorporated